--- nono/debugger/debugger.cpp 2026/04/29 17:05:28 1.1.1.16 +++ nono/debugger/debugger.cpp 2026/04/29 17:05:32 1.1.1.17 @@ -63,9 +63,9 @@ Debugger::Debugger() pVectorTable.reset(new VectorTable(gMainApp.GetVMType())); // ブレークポイントモニタ - bpoint_monitor.func = ToMonitorCallback(&Debugger::MonitorUpdateBpoint); - bpoint_monitor.SetSize(60, 9); - bpoint_monitor.Regist(ID_MONITOR_BREAKPOINT); + bpoint_monitor = gMonitorManager->Regist(ID_MONITOR_BREAKPOINT, this); + bpoint_monitor->func = ToMonitorCallback(&Debugger::MonitorUpdateBpoint); + bpoint_monitor->SetSize(60, 9); // メモリダンプモニタ for (int i = 0, end = memdump_monitor.size(); i < end; i++) { @@ -202,7 +202,14 @@ Debugger::Init() } // を取り出す - if (!ParseVerbHex(addrstr.c_str(), &bp.addr)) { + if (ParseVerbHex(addrstr.c_str(), &bp.addr)) { + bp.type = BreakpointType::Address; + } else if (addrstr[0] == 'v' + && ParseVector( + ParseCPU(cpustr), &(addrstr.c_str()[1]), (uint32 *)&bp.vec1)) { + bp.type = BreakpointType::Exception; + bp.vec2 = bp.vec1; + } else { warnx("\"%s\": Invalid breakpoint address", str.c_str()); return false; } @@ -211,7 +218,6 @@ Debugger::Init() bp.skip = atoi(skipstr.c_str()); } // 登録 - bp.type = BreakpointType::Address; AddBreakpoint(bp, cpustr); } @@ -2013,8 +2019,8 @@ Debugger::cmd_hist_common(BranchHistory& int lines = std::min(used, maxlines) + 1; // MonitorUpdate() は TextScreen 高さに合わせて出力してくれる。 - auto& histmon = hist.monitor; - auto size = histmon.GetSize(); + auto *histmon = hist.monitor; + auto size = histmon->GetSize(); TextScreen screen; screen.Init(size.width, lines); @@ -2645,7 +2651,7 @@ Debugger::cmd_show() fprintf(cons, "unknown monitor name: \"%s\"\n", name.c_str()); } else if (candidates.size() == 1) { // 確定した - Monitor& mon = *(candidates[0]); + Monitor *mon = candidates[0]; ShowMonitor(mon); } else { // 候補が複数あった @@ -2663,12 +2669,12 @@ Debugger::cmd_show() // モニタを更新して表示。 void -Debugger::ShowMonitor(Monitor& monitor) +Debugger::ShowMonitor(Monitor *monitor) { // モニタを更新 TextScreen ts; - auto size = monitor.GetSize(); + auto size = monitor->GetSize(); ts.Init(size.width, size.height); MONITOR_UPDATE(monitor, ts); @@ -2861,11 +2867,6 @@ Debugger::ParseAddr(const char *arg, uin uint64 r; r = curmd->GetRegAddr(arg + 1); if ((int64)r < 0) { -#if 0 // not yet - fprintf(cons, "valid register name are: %s%s\n", - "%d0-%d7,%a0-%a7,%sp,%usp,%isp,%pc", - ",%msp,%vbr,%srp,%crp"); -#endif fprintf(cons, "invalid register name\n"); return false; }