|
|
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 "m88100.h"
16: #include "m88100disasm.h"
17:
18: class DebuggerMD_m88xx0 : public DebuggerMD
19: {
1.1.1.2 root 20: using inherited = DebuggerMD;
1.1 root 21: public:
1.1.1.2 root 22: DebuggerMD_m88xx0(Debugger *parent_, m88kcpu *cpu_);
23: ~DebuggerMD_m88xx0() override;
1.1 root 24:
1.1.1.2 root 25: void ReqSet(uint32 flag) override { cpu->atomic_reqflag |= flag; }
26: void ReqClr(uint32 flag) override { cpu->atomic_reqflag &= ~flag; }
1.1 root 27:
1.1.1.2 root 28: bool IsSuper() const override { return (cpu->psr & m88100reg::PSR_SUPER); }
29: bool MMUEnabled() const override;
1.1.1.5 root 30: uint64 TranslateAddr(saddr_t laddr, bool lookup) const override;
1.1 root 31:
32: // XXX ?
1.1.1.4 root 33: uint32 GetPC() const override { return cpu->GetXIP(); }
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:
1.1.1.3 root 44: BranchHistory& GetBrHist() const override { return cpu->brhist; }
45: BranchHistory& GetExHist() const override { return cpu->exhist; }
1.1 root 46:
1.1.1.2 root 47: bool CheckLEA(uint32 laddr) override {
1.1 root 48: bool rv = cpu->lastaddr == laddr;
49: cpu->lastaddr = 0; // XXX: ていうかここでクリアはおかしい
50: return rv;
51: }
52:
1.1.1.5 root 53: bool Disassemble(DebuggerMemoryStream& mem,
1.1.1.2 root 54: std::string& mnemonic, std::vector<uint8>& bin) override;
1.1 root 55: std::string FormatDisasm(const std::string& mnemonic,
1.1.1.2 root 56: const std::vector<uint8>& bin) override;
1.1 root 57: std::string FormatDisasmLive(const std::string& mnemonic,
1.1.1.2 root 58: const std::vector<uint8>& bin) override;
1.1 root 59:
60: private:
1.1.1.4 root 61: m88kcpu *cpu {}; // CPU コア
62: m88100reg prev {}; // 前回のレジスタセットのコピー
1.1.1.2 root 63:
1.1.1.4 root 64: static bool IsBB0(uint32 op);
65: static bool IsTB0(uint32 op);
1.1.1.2 root 66: static bool IsBBTB0(uint32 op);
67: static bool IsBB1(uint32 op);
68: static bool IsTB1(uint32 op);
69: static bool IsBBTB1(uint32 op);
70: const char *CondStr(uint32 op);
71:
1.1.1.5 root 72: static const HelpMessages HelpListReg;
73: static const HelpMessages HelpReg;
1.1.1.2 root 74: bool MatchCMMUCmd(const std::string& cmdname, const char *name, int *);
1.1.1.7 ! root 75: void ShowRegMain();
! 76: bool ShowRegCache(FILE *, const std::vector<std::string>& args, int id);
! 77: void ShowRegCacheOverview(m88200 *cmmu);
! 78: void ShowRegCacheSet(m88200 *cmmu, int setidx);
! 79: void ShowRegCtrl();
! 80: void ShowRegFPU();
! 81: void ShowRegOther();
1.1.1.2 root 82:
83: // cmp 命令後の分岐命令で結果レジスタを表示するため、
84: // cmp 命令のデスティネーションレジスタを覚えておく。
85: // -1 なら該当しないの意。
1.1.1.4 root 86: int cmp_rd {};
1.1.1.2 root 87:
1.1.1.4 root 88: uint32 so_r1 {}; // ステップアウト判定用
1.1 root 89: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.