--- nono/debugger/debugger.cpp 2026/04/29 17:04:43 1.1.1.6 +++ nono/debugger/debugger.cpp 2026/04/29 17:04:51 1.1.1.8 @@ -9,8 +9,8 @@ #include "debugger_m680x0.h" #include "debugger_m88xx0.h" #include "mainapp.h" -#include "mystring.h" #include "mythread.h" +#include "scheduler.h" #include #include @@ -151,6 +151,9 @@ Debugger::ThreadRun() break; } + // 実時間を停止 + gRealtime.Stop(); + // d/m をいきなり引数なしで実行した時のため、現在地にしておく。 pc = md->GetPC(); m_last_addr.Set(pc, md->IsSuper(), true); @@ -164,6 +167,9 @@ Debugger::ThreadRun() // 次回との差分のため、今のレジスタセットをバックアップ md->BackupRegs(); + // 実時間を再開 + gRealtime.Start(); + // メインループから戻ったということは Leave か Quit なので // どちらにしても、ここでプロンプトを手放す。 gCVPrompt->NotifyRelease(); @@ -264,6 +270,12 @@ Debugger::CommandAction Debugger::MainLoop() { for (;;) { + // ブレークポイント到達メッセージがあればここで表示 + if (bpointmsg.empty() == false) { + cons->Print("%s", bpointmsg.c_str()); + bpointmsg.clear(); + } + cons->Prompt(); if (cons->Gets(cmdbuf) == false) { // EOF or Error @@ -420,7 +432,8 @@ Debugger::Check() // ブレークポイントがどれかでも成立するかを調べる。 // 1つ以上成立してブレークするなら true を返す。 // 1つも成立しておらずブレークしないなら false を返す。 -// 成立すれば内容をここで表示する。 +// このルーチン内では Console があることを期待してはいけない (プロンプトが +// ない時でも呼ばれるので)。 bool Debugger::CheckAllBreakpoints() { @@ -509,7 +522,13 @@ Debugger::CheckAllBreakpoints() assert(false); break; } - cons->Print("breakpoint #%d (%s) reached\n", i, desc.c_str()); + + // 到達メッセージを作成。 + // この時点ではまだコンソールを取得していない可能性があるので + // (-D なしで起動した場合とか)、表示せず用意するだけ。 + // コンソールが取得できたところで表示する。 + bpointmsg += string_format("breakpoint #%d (%s) reached\n", + i, desc.c_str()); } // 例外通知は通過ごとに常に下ろしておく @@ -842,7 +861,7 @@ Debugger::HelpDetails = { Shows disassemble. The first form ("D") interprets
as a physical address. The second and third form ("d", "dt") interprets
as a logical - address if the address translation is enabled. Normally,
is + address if the address translation is enabled. Normally,
is interpreted in the current privilege and current address space. You can change it by modifier. On m68k, can be specified either by function code number directly @@ -1638,8 +1657,8 @@ Debugger::GetAddr(saddr_t *sa, bool defa if (ParseAddr(str.c_str() + addrpos, &addr) == false) { return false; } - // 偶数番地に丸める - sa->SetAddr(addr & 0xfffffffe); + // 命令境界に丸める + sa->SetAddr(addr & ~(md->inst_bytes - 1)); return true; } @@ -2031,7 +2050,7 @@ Debugger::ShowTextScreen(TextScreen& mon // その際属性もエスケープシーケンスで再現する。 int col = monitor.GetCol(); int row = monitor.GetRow(); - const uint16 *src = monitor.GetBuf(); + const std::vector& src = monitor.GetBuf(); for (int y = 0; y < row; y++) { int sy = y * col;