--- nono/debugger/debugger_m88xx0.h 2026/04/29 17:04:33 1.1.1.2 +++ nono/debugger/debugger_m88xx0.h 2026/04/29 17:05:09 1.1.1.7 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// デバッガ (M88xx0 依存部分) +// + #pragma once #include "debugger_private.h" @@ -23,20 +27,22 @@ class DebuggerMD_m88xx0 : public Debugge bool IsSuper() const override { return (cpu->psr & m88100reg::PSR_SUPER); } bool MMUEnabled() const override; - uint64 TranslateAddr(saddr_t laddr) override; + uint64 TranslateAddr(saddr_t laddr, bool lookup) const override; // XXX ? - uint32 GetPC() const override { return cpu->Getxip(); } + uint32 GetPC() const override { return cpu->GetXIP(); } void SetStepOut() override; bool IsStepOut() const override; + bool IsOpStepIn(DebuggerMemoryStream& mem) override; uint64 GetRegAddr(const char *name) const override; void BackupRegs() override; - bool ShowRegister(Console *cons, const std::vector& args) - override; - const HelpMessages& GetRegisterHelp() const override; + bool ShowRegister(FILE *, const std::vector& args) override; + const HelpMessages& GetHelpListReg() const override; + const HelpMessages& GetHelpReg() const override; - Object& GetBrHist() const override { return cpu->brhist; } + BranchHistory& GetBrHist() const override { return cpu->brhist; } + BranchHistory& GetExHist() const override { return cpu->exhist; } bool CheckLEA(uint32 laddr) override { bool rv = cpu->lastaddr == laddr; @@ -44,7 +50,7 @@ class DebuggerMD_m88xx0 : public Debugge return rv; } - bool Disassemble(saddr_t laddr, + bool Disassemble(DebuggerMemoryStream& mem, std::string& mnemonic, std::vector& bin) override; std::string FormatDisasm(const std::string& mnemonic, const std::vector& bin) override; @@ -52,36 +58,32 @@ class DebuggerMD_m88xx0 : public Debugge const std::vector& bin) override; private: - m88kcpu *cpu = NULL; // CPU コア - m88100reg prev {}; - - // 前回アクセス時の論理ページ。.addr == 0xffffffff なら無効。 - // [0] が Inst、[1] が Data XXX とりあえず - saddr_t last_lpage[2]; - uint32 last_ppage[2]; + m88kcpu *cpu {}; // CPU コア + m88100reg prev {}; // 前回のレジスタセットのコピー + static bool IsBB0(uint32 op); + static bool IsTB0(uint32 op); static bool IsBBTB0(uint32 op); static bool IsBB1(uint32 op); static bool IsTB1(uint32 op); static bool IsBBTB1(uint32 op); const char *CondStr(uint32 op); - static const HelpMessages HelpMsgRegister; + static const HelpMessages HelpListReg; + static const HelpMessages HelpReg; bool MatchCMMUCmd(const std::string& cmdname, const char *name, int *); - void ShowRegMain(Console *cons); - void ShowRegCache(Console *cons, const std::vector& args, - int id); - void ShowRegCacheOverview(Console *cons, int id); - void ShowRegCacheSet(Console *cons, int id, int setidx); - void ShowRegCtrl(Console *cons); - void ShowRegFPU(Console *cons); - void ShowRegMMU(Console *cons, int id); - void ShowRegOther(Console *cons); + void ShowRegMain(); + bool ShowRegCache(FILE *, const std::vector& args, int id); + void ShowRegCacheOverview(m88200 *cmmu); + void ShowRegCacheSet(m88200 *cmmu, int setidx); + void ShowRegCtrl(); + void ShowRegFPU(); + void ShowRegOther(); // cmp 命令後の分岐命令で結果レジスタを表示するため、 // cmp 命令のデスティネーションレジスタを覚えておく。 // -1 なら該当しないの意。 - int cmp_rd; + int cmp_rd {}; - uint32 so_r1 = 0; // ステップアウト判定用 + uint32 so_r1 {}; // ステップアウト判定用 };