--- nono/debugger/debugger.h 2026/04/29 17:05:24 1.1.1.10 +++ nono/debugger/debugger.h 2026/04/29 17:05:58 1.1.1.14 @@ -72,6 +72,7 @@ class Debugger : public ThreadDevice struct { uint32 inst; // 命令ワード uint32 mask; // マスク + int instbytes; // 命令バイト数 }; }; @@ -108,8 +109,6 @@ class Debugger : public ThreadDevice void ExecMain() { Exec(md_mpu.get()); } void ExecXP() { Exec(md_xp.get()); } - void NotifyExceptionMain(int vector); - void NotifyExceptionXP(int vector); // MPU トレースが必要なら true を返す bool IsTrace() const; @@ -120,17 +119,18 @@ class Debugger : public ThreadDevice private: void Close(); - void RxCallback(); - void AcceptCallback(); + void RxCallback(uint32); + void AcceptCallback(uint32); void Input(int); void EnterPrompt(); + void QuitPrompt(); void LeavePrompt(bool trace); void PrintPrompt(); void Exec(DebuggerMD *); CmdAct Command(); bool CheckAllBreakpoints(DebuggerMD *); - bool CheckBreakpointInst(breakpoint_t&); + uint64 ReadBreakpointInst(breakpoint_t&); void ParseCmdbuf(); // コマンド名は大文字小文字を区別する関係でスネークスタイル。 CmdAct cmd_b(); @@ -158,6 +158,8 @@ class Debugger : public ThreadDevice CmdAct cmd_minus(); CmdAct cmd_n(); CmdAct cmd_nt(); + CmdAct cmd_pe(); + CmdAct cmd_pf(); CmdAct cmd_q(); CmdAct cmd_reset(); CmdAct cmd_s(); @@ -170,9 +172,16 @@ 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&); - void RecalcInstMask(); + 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&); bool GetAddr(busaddr *addr, bool); CmdAct cmd_d_common(busaddr access_mode); CmdAct cmd_hist_common(BranchHistory& hist); @@ -197,7 +206,7 @@ class Debugger : public ThreadDevice std::string HelpConvert(const std::string& msg); // モニタを更新して表示 - void ShowMonitor(Monitor& monitor); + void ShowMonitor(Monitor *monitor); // テキストスクリーンを表示 void ShowTextScreen(TextScreen& screen); @@ -224,13 +233,10 @@ 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 {}; - uint32 bi_inst {}; - int bi_inst_bytes {}; - int bi_need_bytes {}; uint64 ct_timespan {}; busaddr d_last_addr {}; busaddr m_last_addr {}; @@ -256,8 +262,8 @@ class Debugger : public ThreadDevice std::string bpointmsg {}; // ブレークポイントモニタ - DECLARE_MONITOR_CALLBACK(MonitorUpdateBpoint); - Monitor bpoint_monitor { this }; + DECLARE_MONITOR_SCREEN(MonitorScreenBpoint); + Monitor *bpoint_monitor {}; // 逆アセンブルとメモリダンプモニタ std::array, MAX_MEMDUMP_MONITOR> @@ -273,6 +279,6 @@ class Debugger : public ThreadDevice static std::vector cmdtable; }; -static inline Debugger *GetDebugger() { +inline Debugger *GetDebugger() { return Object::GetObject(OBJ_DEBUGGER); }