From b16c1213889565d1e7b19f09c0f50b28cbbcc4ec Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 5 Sep 2015 13:37:31 -0700 Subject: [PATCH] SvcBreak: Print out stack trace --- src/core/hle/svc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index ae54afb1c..79f58a6b8 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -411,6 +411,12 @@ static void Break(u8 break_reason) { default: reason_str = "UNKNOWN"; break; } LOG_CRITICAL(Debug_Emulated, "Break reason: %s", reason_str.c_str()); + + std::vector stack_trace = Core::g_app_core->GetStackTrace(); + for (int i = 0; i < stack_trace.size(); i++) { + // Mimic GDB, print stack traces with highest-level procedures displayed first + LOG_CRITICAL(Debug_Emulated, " #%d: 0x%08X", i, stack_trace[stack_trace.size() - 1 - i]); + } } /// Used to output a message on a debug hardware unit - does nothing on a retail unit