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