Extra diagnostics for multi-threaded breaks.

This commit is contained in:
Jarek Syrylak
2018-06-08 01:03:24 +01:00
parent 56a5d60276
commit d0d834ad2d

View File

@@ -636,7 +636,7 @@ static void SendSignal(Kernel::Thread* thread, u32 signal, bool full = true) {
buffer += fmt::format("thread:{:x};", thread->GetThreadId()); buffer += fmt::format("thread:{:x};", thread->GetThreadId());
// NGLOG_ERROR(Debug_GDBStub, "{}", buffer.c_str()); NGLOG_ERROR(Debug_GDBStub, "{}", buffer.c_str());
SendReply(buffer.c_str()); SendReply(buffer.c_str());
} }
@@ -1209,13 +1209,15 @@ void SetCpuStepFlag(bool is_step) {
} }
void SendTrap(Kernel::Thread* thread, int trap) { void SendTrap(Kernel::Thread* thread, int trap) {
// NGLOG_ERROR(Debug_GDBStub, "SendTrap {} {} {} {} {}", send_trap, thread->GetThreadId(), if (send_trap) {
// current_thread->GetThreadId(), halt_loop, step_loop); NGLOG_ERROR(Debug_GDBStub, "SendTrap {} {} {} {}", thread->GetThreadId(),
if (send_trap && (!halt_loop || (thread == current_thread))) { current_thread->GetThreadId(), halt_loop, step_loop);
send_trap = false; if (!halt_loop || (thread == current_thread)) {
halt_loop = true; NGLOG_ERROR(Debug_GDBStub, "SendTrap Fired!");
// NGLOG_ERROR(Debug_GDBStub, "SendTrap Fired!"); halt_loop = true;
SendSignal(thread, trap); send_trap = false;
SendSignal(thread, trap);
}
} }
} }
}; // namespace GDBStub }; // namespace GDBStub