--- nono/debugger/debugger_private.h 2026/04/29 17:05:09 1.1.1.9 +++ nono/debugger/debugger_private.h 2026/04/29 17:05:13 1.1.1.10 @@ -225,17 +225,15 @@ class Debugger : public ThreadDevice static const uint32 REQUEST_ACCEPT = 0x0004; // 着信通知 static const uint32 REQUEST_PROMPT = 0x0008; // プロンプト要求 - // 型 - enum CommandAction { + // コマンド + enum CmdAct { Stay, // デバッガプロンプトに留まる Leave, // デバッガプロンプトを抜けて VM を実行する Quit, // デバッガとの接続を終了する }; - using cmdfunc_t = void (Debugger::*)(); struct cmddef_t { const char *name; - cmdfunc_t func; - CommandAction action; + CmdAct (Debugger::*func)(); }; // ブレークポイント種別 @@ -310,63 +308,65 @@ class Debugger : public ThreadDevice void LeavePrompt(); void PrintPrompt(); - CommandAction Command(); + CmdAct Command(); bool CheckAllBreakpoints(); bool CheckBreakpointInst(breakpoint_t&); void ParseCmdbuf(); // コマンド名は大文字小文字を区別する関係でスネークスタイル。 - void cmd_b(); - void cmd_bi(); - void cmd_bm(); - void cmd_bv(); - void cmd_b_list(); - void cmd_b_set(BreakpointType); - void cmd_b_delete(); - void cmd_brhist(); - void cmd_bx(); - void cmd_c(); - void cmd_d(); - void cmd_dt(); - void cmd_D(); - void cmd_disp(); - void cmd_exhist(); - void cmd_h(); - void cmd_hb(); - void cmd_hr(); - void cmd_L(); - void cmd_m(); - void cmd_mt(); - void cmd_M(); - void cmd_minus(); - void cmd_n(); - void cmd_nt(); - void cmd_q(); - void cmd_reset(); - void cmd_s(); - void cmd_st(); - void cmd_so(); - void cmd_sot(); - void cmd_show(); - void cmd_t(); + CmdAct cmd_b(); + CmdAct cmd_bi(); + CmdAct cmd_bm(); + CmdAct cmd_bv(); + CmdAct cmd_b_list(); + CmdAct cmd_b_set(BreakpointType); + CmdAct cmd_b_delete(); + CmdAct cmd_brhist(); + CmdAct cmd_bx(); + CmdAct cmd_c(); + CmdAct cmd_ct(); + CmdAct cmd_d(); + CmdAct cmd_dt(); + CmdAct cmd_D(); + CmdAct cmd_disp(); + CmdAct cmd_exhist(); + CmdAct cmd_h(); + CmdAct cmd_hb(); + CmdAct cmd_hr(); + CmdAct cmd_L(); + CmdAct cmd_m(); + CmdAct cmd_mt(); + CmdAct cmd_M(); + CmdAct cmd_minus(); + CmdAct cmd_n(); + CmdAct cmd_nt(); + CmdAct cmd_q(); + CmdAct cmd_reset(); + CmdAct cmd_s(); + CmdAct cmd_st(); + CmdAct cmd_so(); + CmdAct cmd_sot(); + CmdAct cmd_show(); + CmdAct cmd_t(); bool Check(); int AddBreakpoint(const breakpoint_t&); void RecalcInstMask(); bool GetAddr(saddr_t *addr, bool); - void cmd_d_common(MemoryMode access_mode, MMULookupMode lookup_mode); - void cmd_hist_common(BranchHistory& hist); - void cmd_m_common(MemoryMode access_mode, MMULookupMode lookup_mode); - void cmd_n_common(bool); - void cmd_s_common(bool); - void cmd_so_common(bool); + CmdAct cmd_d_common(MemoryMode access_mode, MMULookupMode lookup_mode); + CmdAct cmd_hist_common(BranchHistory& hist); + CmdAct cmd_m_common(MemoryMode access_mode, MMULookupMode lookup_mode); + CmdAct cmd_n_common(bool); + CmdAct cmd_s_common(bool); + CmdAct cmd_so_common(bool); bool ParseVerbHex(const char *arg, uint32 *valp); bool ParseAddr(const char *arg, uint32_t *addrp); + bool ParseTime(const char *arg, uint64 *timep); void SetNBreakpoint(); static const HelpMessages HelpListMain; static const HelpMessages HelpListBreakpoints; static const HelpMessages HelpDetails; - void ShowHelpList(const HelpMessages& msgs); + CmdAct ShowHelpList(const HelpMessages& msgs); // 個別ヘルプメッセージを出力用に置換 std::string HelpConvert(const std::string& msg); @@ -406,6 +406,9 @@ class Debugger : public ThreadDevice int bi_inst_bytes {}; int bi_need_bytes {}; int bv_vector = -1; + bool ct_enable {}; + uint64 ct_end_time {}; + uint64 ct_timespan {}; saddr_t d_last_addr {}; saddr_t m_last_addr {}; bool n_enable {};