Annotation of nono/debugger/debugger_m88xx0.h, revision 1.1.1.12

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
1.1.1.7   root        7: //
                      8: // デバッガ (M88xx0 依存部分)
                      9: //
                     10: 
1.1       root       11: #pragma once
                     12: 
                     13: #include "debugger_private.h"
1.1.1.2   root       14: #include "mpu88xx0.h"
1.1       root       15: #include "m88100disasm.h"
                     16: 
                     17: class DebuggerMD_m88xx0 : public DebuggerMD
                     18: {
1.1.1.2   root       19:        using inherited = DebuggerMD;
1.1       root       20:  public:
1.1.1.10  root       21:        explicit DebuggerMD_m88xx0(Debugger *parent_);
1.1.1.2   root       22:        ~DebuggerMD_m88xx0() override;
1.1       root       23: 
1.1.1.8   root       24:        CPUState GetCPUState() const override { return (CPUState)cpu->GetState(); }
                     25:        bool IsSuper() const override { return cpu->IsSuper(); }
1.1.1.2   root       26:        bool MMUEnabled() const override;
1.1.1.9   root       27:        busaddr TranslateAddr(busaddr laddr) const override;
1.1       root       28: 
1.1.1.8   root       29:        uint32 GetPC() const override { return cpu->GetPPC(); }
1.1.1.12! root       30:        uint32 GetNextPC() override { return GetPC() + 4; }
        !            31:        int32 GetAndResetLastVector() override {
        !            32:                return cpu->GetAndResetLastVector();
        !            33:        }
1.1       root       34: 
1.1.1.2   root       35:        void SetStepOut() override;
                     36:        bool IsStepOut() const override;
1.1.1.5   root       37:        bool IsOpStepIn(DebuggerMemoryStream& mem) override;
1.1.1.2   root       38:        uint64 GetRegAddr(const char *name) const override;
                     39:        void BackupRegs() override;
1.1.1.7   root       40:        bool ShowRegister(FILE *, const std::vector<std::string>& args) override;
1.1.1.5   root       41:        const HelpMessages& GetHelpListReg() const override;
                     42:        const HelpMessages& GetHelpReg() const override;
1.1.1.2   root       43: 
                     44:        bool CheckLEA(uint32 laddr) override {
1.1       root       45:                bool rv = cpu->lastaddr == laddr;
1.1.1.8   root       46:                cpu->lastaddr = (uint64)-1;     // XXX: ていうかここでクリアはおかしい
1.1       root       47:                return rv;
                     48:        }
                     49: 
1.1.1.8   root       50:        std::string Disassemble(DebuggerMemoryStream& mem) override;
1.1.1.11  root       51:        std::string ParseInst(const std::string&) const override;
1.1       root       52: 
                     53:  private:
1.1.1.8   root       54:        MPU88xx0Device *cpu {}; // MPU デバイス
                     55:        m88200 *cmmu0 {};               // 命令 CMMU
                     56:        m88200 *cmmu1 {};               // データ CMMU
1.1.1.4   root       57:        m88100reg prev {};              // 前回のレジスタセットのコピー
1.1.1.2   root       58: 
1.1.1.4   root       59:        static bool IsBB0(uint32 op);
                     60:        static bool IsTB0(uint32 op);
1.1.1.2   root       61:        static bool IsBBTB0(uint32 op);
                     62:        static bool IsBB1(uint32 op);
                     63:        static bool IsTB1(uint32 op);
                     64:        static bool IsBBTB1(uint32 op);
                     65:        const char *CondStr(uint32 op);
                     66: 
1.1.1.5   root       67:        static const HelpMessages HelpListReg;
                     68:        static const HelpMessages HelpReg;
1.1.1.2   root       69:        bool MatchCMMUCmd(const std::string& cmdname, const char *name, int *);
1.1.1.7   root       70:        void ShowRegMain();
                     71:        bool ShowRegCache(FILE *, const std::vector<std::string>& args, int id);
                     72:        void ShowRegCacheOverview(m88200 *cmmu);
                     73:        void ShowRegCacheSet(m88200 *cmmu, int setidx);
                     74:        void ShowRegCtrl();
                     75:        void ShowRegFPU();
                     76:        void ShowRegOther();
1.1.1.2   root       77: 
                     78:        // cmp 命令後の分岐命令で結果レジスタを表示するため、
                     79:        // cmp 命令のデスティネーションレジスタを覚えておく。
                     80:        // -1 なら該当しないの意。
1.1.1.4   root       81:        int cmp_rd {};
1.1.1.2   root       82: 
1.1.1.8   root       83:        const BranchHistory *brhist {};
                     84: 
1.1.1.4   root       85:        uint32 so_r1 {};                // ステップアウト判定用
1.1       root       86: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.