|
|
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;
1.1.1.5 ! root 26: uint64 TranslateAddr(saddr_t laddr, bool lookup) const override;
1.1 root 27:
28: // XXX ?
1.1.1.4 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;
1.1.1.5 ! root 33: bool IsOpStepIn(DebuggerMemoryStream& mem) override;
1.1.1.2 root 34: uint64 GetRegAddr(const char *name) const override;
35: void BackupRegs() override;
36: bool ShowRegister(Console *cons, const std::vector<std::string>& args)
37: override;
1.1.1.5 ! root 38: const HelpMessages& GetHelpListReg() const override;
! 39: const HelpMessages& GetHelpReg() const override;
1.1.1.2 root 40:
1.1.1.3 root 41: BranchHistory& GetBrHist() const override { return cpu->brhist; }
42: BranchHistory& GetExHist() const override { return cpu->exhist; }
1.1 root 43:
1.1.1.2 root 44: bool CheckLEA(uint32 laddr) override {
1.1 root 45: bool rv = cpu->lastaddr == laddr;
46: cpu->lastaddr = 0; // XXX: ていうかここでクリアはおかしい
47: return rv;
48: }
49:
1.1.1.5 ! root 50: bool Disassemble(DebuggerMemoryStream& mem,
1.1.1.2 root 51: std::string& mnemonic, std::vector<uint8>& bin) override;
1.1 root 52: std::string FormatDisasm(const std::string& mnemonic,
1.1.1.2 root 53: const std::vector<uint8>& bin) override;
1.1 root 54: std::string FormatDisasmLive(const std::string& mnemonic,
1.1.1.2 root 55: const std::vector<uint8>& bin) override;
1.1 root 56:
1.1.1.4 root 57: const char *GetExceptionName(int vector) const override;
58:
1.1 root 59: private:
1.1.1.4 root 60: m88kcpu *cpu {}; // CPU コア
61: m88100reg prev {}; // 前回のレジスタセットのコピー
1.1.1.2 root 62:
1.1.1.4 root 63: static bool IsBB0(uint32 op);
64: static bool IsTB0(uint32 op);
1.1.1.2 root 65: static bool IsBBTB0(uint32 op);
66: static bool IsBB1(uint32 op);
67: static bool IsTB1(uint32 op);
68: static bool IsBBTB1(uint32 op);
69: const char *CondStr(uint32 op);
70:
1.1.1.5 ! root 71: static const HelpMessages HelpListReg;
! 72: static const HelpMessages HelpReg;
1.1.1.2 root 73: bool MatchCMMUCmd(const std::string& cmdname, const char *name, int *);
74: void ShowRegMain(Console *cons);
75: void ShowRegCache(Console *cons, const std::vector<std::string>& args,
76: int id);
77: void ShowRegCacheOverview(Console *cons, int id);
78: void ShowRegCacheSet(Console *cons, int id, int setidx);
79: void ShowRegCtrl(Console *cons);
80: void ShowRegFPU(Console *cons);
81: void ShowRegMMU(Console *cons, int id);
82: void ShowRegOther(Console *cons);
83:
84: // cmp 命令後の分岐命令で結果レジスタを表示するため、
85: // cmp 命令のデスティネーションレジスタを覚えておく。
86: // -1 なら該当しないの意。
1.1.1.4 root 87: int cmp_rd {};
1.1.1.2 root 88:
1.1.1.4 root 89: uint32 so_r1 {}; // ステップアウト判定用
1.1 root 90: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.