--- nono/debugger/debugger.h 2026/04/29 17:05:16 1.1.1.9 +++ nono/debugger/debugger.h 2026/04/29 17:05:49 1.1.1.13 @@ -11,8 +11,8 @@ #pragma once #include "debugger_defs.h" +#include "bus.h" #include "monitor.h" -#include "saddr.h" #include "textscreen.h" #include "thread.h" #include @@ -120,8 +120,8 @@ class Debugger : public ThreadDevice private: void Close(); - void RxCallback(); - void AcceptCallback(); + void RxCallback(uint32); + void AcceptCallback(uint32); void Input(int); void EnterPrompt(); void LeavePrompt(bool trace); @@ -145,7 +145,6 @@ class Debugger : public ThreadDevice CmdAct cmd_c(); CmdAct cmd_ct(); CmdAct cmd_d(); - CmdAct cmd_dt(); CmdAct cmd_D(); CmdAct cmd_disp(); CmdAct cmd_exhist(); @@ -154,7 +153,6 @@ class Debugger : public ThreadDevice CmdAct cmd_hr(); CmdAct cmd_L(); CmdAct cmd_m(); - CmdAct cmd_mt(); CmdAct cmd_mpu(); CmdAct cmd_M(); CmdAct cmd_minus(); @@ -172,13 +170,21 @@ class Debugger : public ThreadDevice CmdAct cmd_z(); bool Check(DebuggerMD *); + bool ParseOptBreakAddr(const std::string&); + bool ParseOptBreakInst(const std::string&); + bool ParseOptBreakVector(const std::string&); + bool IsCPUStr(const std::string&) const; DebuggerMD *ParseCPU(const std::string&) const; - int AddBreakpoint(const breakpoint_t&, const std::string&); + int AddBreakInst(const std::string& cpustr, const std::string& inststr, + const std::string& skipstr, std::string *errstr); + int AddBreakVector(const std::string& cpustr, const std::string& vecstr, + const std::string& skipstr, std::string *errstr); + int AddBreakpoint(const breakpoint_t&); void RecalcInstMask(); - bool GetAddr(saddr_t *addr, bool); - CmdAct cmd_d_common(MemoryMode access_mode, MMULookupMode lookup_mode); + bool GetAddr(busaddr *addr, bool); + CmdAct cmd_d_common(busaddr access_mode); CmdAct cmd_hist_common(BranchHistory& hist); - CmdAct cmd_m_common(MemoryMode access_mode, MMULookupMode lookup_mode); + CmdAct cmd_m_common(busaddr access_mode); CmdAct cmd_n_common(bool); CmdAct cmd_s_common(bool); CmdAct cmd_so_common(bool); @@ -199,7 +205,7 @@ class Debugger : public ThreadDevice std::string HelpConvert(const std::string& msg); // モニタを更新して表示 - void ShowMonitor(Monitor& monitor); + void ShowMonitor(Monitor *monitor); // テキストスクリーンを表示 void ShowTextScreen(TextScreen& screen); @@ -226,7 +232,7 @@ class Debugger : public ThreadDevice const char *prompt {}; // プロンプト文字列 std::string cmdbuf {}; // 現在のコマンドライン std::string last_cmdbuf {}; // 直前のコマンドライン - std::vector args {}; + std::vector cmdargs {}; uint32 pc {}; std::array bpoint {}; @@ -234,8 +240,8 @@ class Debugger : public ThreadDevice int bi_inst_bytes {}; int bi_need_bytes {}; uint64 ct_timespan {}; - saddr_t d_last_addr {}; - saddr_t m_last_addr {}; + busaddr d_last_addr {}; + busaddr m_last_addr {}; StepType step_type {}; // ステップ実行種別 DebuggerMD *step_md {}; // ステップ実行中の CPU uint32 step_count {}; @@ -259,7 +265,7 @@ class Debugger : public ThreadDevice // ブレークポイントモニタ DECLARE_MONITOR_CALLBACK(MonitorUpdateBpoint); - Monitor bpoint_monitor { this }; + Monitor *bpoint_monitor {}; // 逆アセンブルとメモリダンプモニタ std::array, MAX_MEMDUMP_MONITOR>