From b412594127a3edc1d58e3a98db814b99e9f59cfc Mon Sep 17 00:00:00 2001 From: Jarek Syrylak Date: Fri, 8 Jun 2018 01:03:24 +0100 Subject: [PATCH] Extra diagnostics for multi-threaded breaks. --- src/core/gdbstub/gdbstub.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 9c2f7935e2..a9f4cc008a 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -636,7 +636,7 @@ static void SendSignal(Kernel::Thread* thread, u32 signal, bool full = true) { 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()); } @@ -1209,13 +1209,15 @@ void SetCpuStepFlag(bool is_step) { } void SendTrap(Kernel::Thread* thread, int trap) { - // NGLOG_ERROR(Debug_GDBStub, "SendTrap {} {} {} {} {}", send_trap, thread->GetThreadId(), - // current_thread->GetThreadId(), halt_loop, step_loop); - if (send_trap && (!halt_loop || (thread == current_thread))) { - send_trap = false; - halt_loop = true; - // NGLOG_ERROR(Debug_GDBStub, "SendTrap Fired!"); - SendSignal(thread, trap); + if (send_trap) { + NGLOG_ERROR(Debug_GDBStub, "SendTrap {} {} {} {}", thread->GetThreadId(), + current_thread->GetThreadId(), halt_loop, step_loop); + if (!halt_loop || (thread == current_thread)) { + NGLOG_ERROR(Debug_GDBStub, "SendTrap Fired!"); + halt_loop = true; + send_trap = false; + SendSignal(thread, trap); + } } } }; // namespace GDBStub