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

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: 
                      7: #pragma once
                      8: 
                      9: #include "debugger_private.h"
1.1.1.2 ! root       10: #include "mpu88xx0.h"
1.1       root       11: #include "m88100.h"
                     12: #include "m88100disasm.h"
                     13: 
                     14: class DebuggerMD_m88xx0 : public DebuggerMD
                     15: {
1.1.1.2 ! root       16:        using inherited = DebuggerMD;
1.1       root       17:  public:
1.1.1.2 ! root       18:        DebuggerMD_m88xx0(Debugger *parent_, m88kcpu *cpu_);
        !            19:        ~DebuggerMD_m88xx0() override;
1.1       root       20: 
1.1.1.2 ! root       21:        void ReqSet(uint32 flag) override { cpu->atomic_reqflag |= flag; }
        !            22:        void ReqClr(uint32 flag) override { cpu->atomic_reqflag &= ~flag; }
1.1       root       23: 
1.1.1.2 ! root       24:        bool IsSuper() const override { return (cpu->psr & m88100reg::PSR_SUPER); }
        !            25:        bool MMUEnabled() const override;
        !            26:        uint64 TranslateAddr(saddr_t laddr) override;
1.1       root       27: 
                     28:        // XXX ?
1.1.1.2 ! root       29:        uint32 GetPC() const override { return cpu->Getxip(); }
1.1       root       30: 
1.1.1.2 ! root       31:        void SetStepOut() override;
        !            32:        bool IsStepOut() const override;
        !            33:        uint64 GetRegAddr(const char *name) const override;
        !            34:        void BackupRegs() override;
        !            35:        bool ShowRegister(Console *cons, const std::vector<std::string>& args)
        !            36:                override;
        !            37:        const HelpMessages& GetRegisterHelp() const override;
        !            38: 
        !            39:        Object& GetBrHist() const override { return cpu->brhist; }
1.1       root       40: 
1.1.1.2 ! root       41:        bool CheckLEA(uint32 laddr) override {
1.1       root       42:                bool rv = cpu->lastaddr == laddr;
                     43:                cpu->lastaddr = 0;      // XXX: ていうかここでクリアはおかしい
                     44:                return rv;
                     45:        }
                     46: 
                     47:        bool Disassemble(saddr_t laddr,
1.1.1.2 ! root       48:                std::string& mnemonic, std::vector<uint8>& bin) override;
1.1       root       49:        std::string FormatDisasm(const std::string& mnemonic,
1.1.1.2 ! root       50:                const std::vector<uint8>& bin) override;
1.1       root       51:        std::string FormatDisasmLive(const std::string& mnemonic,
1.1.1.2 ! root       52:                const std::vector<uint8>& bin) override;
1.1       root       53: 
                     54:  private:
                     55:        m88kcpu *cpu = NULL;            // CPU コア
                     56:        m88100reg prev {};
1.1.1.2 ! root       57: 
        !            58:        // 前回アクセス時の論理ページ。.addr == 0xffffffff なら無効。
        !            59:        // [0] が Inst、[1] が Data XXX とりあえず
        !            60:        saddr_t last_lpage[2];
        !            61:        uint32  last_ppage[2];
        !            62: 
        !            63:        static bool IsBBTB0(uint32 op);
        !            64:        static bool IsBB1(uint32 op);
        !            65:        static bool IsTB1(uint32 op);
        !            66:        static bool IsBBTB1(uint32 op);
        !            67:        const char *CondStr(uint32 op);
        !            68: 
        !            69:        static const HelpMessages HelpMsgRegister;
        !            70:        bool MatchCMMUCmd(const std::string& cmdname, const char *name, int *);
        !            71:        void ShowRegMain(Console *cons);
        !            72:        void ShowRegCache(Console *cons, const std::vector<std::string>& args,
        !            73:                int id);
        !            74:        void ShowRegCacheOverview(Console *cons, int id);
        !            75:        void ShowRegCacheSet(Console *cons, int id, int setidx);
        !            76:        void ShowRegCtrl(Console *cons);
        !            77:        void ShowRegFPU(Console *cons);
        !            78:        void ShowRegMMU(Console *cons, int id);
        !            79:        void ShowRegOther(Console *cons);
        !            80: 
        !            81:        // cmp 命令後の分岐命令で結果レジスタを表示するため、
        !            82:        // cmp 命令のデスティネーションレジスタを覚えておく。
        !            83:        // -1 なら該当しないの意。
        !            84:        int cmp_rd;
        !            85: 
        !            86:        uint32 so_r1 = 0;               // ステップアウト判定用
1.1       root       87: };

unix.superglobalmegacorp.com

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