--- nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:04:57 1.1.1.8 +++ nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:05:09 1.1.1.9 @@ -4,7 +4,10 @@ // Licensed under nono-license.txt // -#include "console.h" +// +// デバッガ (M88xx0 依存部分) +// + #include "debugger_private.h" #include "debugger_m88xx0.h" #include "m88100disasm.h" @@ -21,12 +24,11 @@ // コンストラクタ DebuggerMD_m88xx0::DebuggerMD_m88xx0(Debugger *parent_, m88kcpu *cpu_) - : inherited(parent_, Debugger::Arch::M88xx0) + : inherited(parent_, Arch::M88xx0) { cpu = cpu_; // 機種依存変数 - vector_max = 512; inst_bytes = 4; inst_bytes_fixed = 4; @@ -287,7 +289,7 @@ DebuggerMD_m88xx0::GetHelpReg() const // レジスタ表示系コマンド bool -DebuggerMD_m88xx0::ShowRegister(Console *cons, +DebuggerMD_m88xx0::ShowRegister(FILE *cons, const std::vector& args) { int cmmu_id; @@ -295,24 +297,24 @@ DebuggerMD_m88xx0::ShowRegister(Console // 余分な引数は無視する? if (args[0] == "r") { - ShowRegMain(cons); + ShowRegMain(); return true; } if (args[0] == "rc") { - ShowRegCtrl(cons); + ShowRegCtrl(); return true; } if (args[0] == "rf") { - ShowRegFPU(cons); + ShowRegFPU(); return true; } if (args[0] == "ro") { - ShowRegOther(cons); + ShowRegOther(); return true; } if (MatchCMMUCmd(args[0], "ra", &cmmu_id)) { - Monitor *mon = gMonitorManager.Find(ID_MONITOR_ATC(cmmu_id)); + Monitor *mon = gMonitorManager->Find(ID_MONITOR_ATC(cmmu_id)); if (mon) { parent->ShowMonitor(*mon); return true; @@ -323,7 +325,7 @@ DebuggerMD_m88xx0::ShowRegister(Console return ShowRegCache(cons, args, cmmu_id); } if (MatchCMMUCmd(args[0], "rm", &cmmu_id)) { - Monitor *mon = gMonitorManager.Find(ID_MONITOR_CMMU(cmmu_id)); + Monitor *mon = gMonitorManager->Find(ID_MONITOR_CMMU(cmmu_id)); if (mon) { parent->ShowMonitor(*mon); return true; @@ -365,7 +367,7 @@ DebuggerMD_m88xx0::MatchCMMUCmd(const st } void -DebuggerMD_m88xx0::ShowRegMain(Console *cons) +DebuggerMD_m88xx0::ShowRegMain() { TextScreen s(80, 8); @@ -406,7 +408,7 @@ r2 :0070e1a0 r10:00000000 r18:00000000 } void -DebuggerMD_m88xx0::ShowRegCtrl(Console *cons) +DebuggerMD_m88xx0::ShowRegCtrl() { TextScreen s(80, 6); int x; @@ -510,7 +512,7 @@ fip:00000000 sfip(cr6 // rd なら個別セットの詳細表示。 // id を受け付ければ true を、そうでなければ false を返す。 bool -DebuggerMD_m88xx0::ShowRegCache(Console *cons, +DebuggerMD_m88xx0::ShowRegCache(FILE *cons, const std::vector& args, int id) { m88200 *cmmu; @@ -525,21 +527,21 @@ DebuggerMD_m88xx0::ShowRegCache(Console } if (args.size() < 2) { - ShowRegCacheOverview(cons, cmmu); + ShowRegCacheOverview(cmmu); } else { int set; char *end; errno = 0; set = strtol(args[1].c_str(), &end, 16); if (end == &args[1][0] || *end != '\0' || errno == ERANGE) { - cons->Print(" must be a number\n"); + fprintf(cons, " must be a number\n"); goto done; } if (set < 0 || set > 256) { - cons->Print(" must be in 00..ff\n"); + fprintf(cons, " must be in 00..ff\n"); goto done; } - ShowRegCacheSet(cons, cmmu, set); + ShowRegCacheSet(cmmu, set); } done: return true; @@ -547,7 +549,7 @@ DebuggerMD_m88xx0::ShowRegCache(Console // CMMU データキャッシュの概要表示 void -DebuggerMD_m88xx0::ShowRegCacheOverview(Console *cons, m88200 *cmmu) +DebuggerMD_m88xx0::ShowRegCacheOverview(m88200 *cmmu) { TextScreen s(70, 17); @@ -557,7 +559,7 @@ DebuggerMD_m88xx0::ShowRegCacheOverview( // CMMU データキャッシュの指定セットの詳細表示 void -DebuggerMD_m88xx0::ShowRegCacheSet(Console *cons, m88200 *cmmu, int setidx) +DebuggerMD_m88xx0::ShowRegCacheSet(m88200 *cmmu, int setidx) { TextScreen s(70, 5); @@ -566,7 +568,7 @@ DebuggerMD_m88xx0::ShowRegCacheSet(Conso } void -DebuggerMD_m88xx0::ShowRegFPU(Console *cons) +DebuggerMD_m88xx0::ShowRegFPU() { static const char * const fcrname[] = { "fpecr", @@ -595,7 +597,7 @@ DebuggerMD_m88xx0::ShowRegFPU(Console *c } void -DebuggerMD_m88xx0::ShowRegOther(Console *cons) +DebuggerMD_m88xx0::ShowRegOther() { TextScreen s(80, 3); /* @@ -689,13 +691,6 @@ DebuggerMD_m88xx0::FormatDisasmLive(cons op, delay.c_str(), mnemonic.c_str(), cond); } -// 例外のベクタ番号から名前を取得。 -const char * -DebuggerMD_m88xx0::GetExceptionName(int vector) const -{ - return m88kcpu::GetExceptionName(vector); -} - #define TAKE_IF(expr) do { \ if ((expr)) \ return " (will take)"; \