summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/svc.cpp46
1 files changed, 42 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 690b84930..2cf0326e6 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -374,9 +374,18 @@ static ResultCode ArbitrateUnlock(VAddr mutex_addr) {
374 return Mutex::Release(mutex_addr); 374 return Mutex::Release(mutex_addr);
375} 375}
376 376
377enum BreakType : u32 {
378 Panic = 0,
379 PreNROLoad = 3,
380 PostNROLoad = 4,
381 PreNROUnload = 5,
382 PostNROUnload = 6,
383};
384
377struct BreakReason { 385struct BreakReason {
378 union { 386 union {
379 u32 raw; 387 u32 raw;
388 BitField<0, 30, BreakType> break_type;
380 BitField<31, 1, u32> signal_debugger; 389 BitField<31, 1, u32> signal_debugger;
381 }; 390 };
382}; 391};
@@ -384,12 +393,41 @@ struct BreakReason {
384/// Break program execution 393/// Break program execution
385static void Break(u32 reason, u64 info1, u64 info2) { 394static void Break(u32 reason, u64 info1, u64 info2) {
386 BreakReason break_reason{reason}; 395 BreakReason break_reason{reason};
387 if (break_reason.signal_debugger) { 396
397 switch (break_reason.break_type) {
398 case BreakType::Panic:
399 LOG_ERROR(Debug_Emulated, "Signalling debugger, PANIC! info1=0x{:016X}, info2=0x{:016X}",
400 info1, info2);
401 break;
402 case BreakType::PreNROLoad:
403 LOG_ERROR(Debug_Emulated,
404 "Signalling debugger, Attempting to load an NRO at 0x{:016X} with size 0x{:016X}",
405 info1, info2);
406 break;
407 case BreakType::PostNROLoad:
408 LOG_ERROR(Debug_Emulated,
409 "Signalling debugger, Loaded an NRO at 0x{:016X} with size 0x{:016X}", info1,
410 info2);
411 break;
412 case BreakType::PreNROUnload:
388 LOG_ERROR( 413 LOG_ERROR(
389 Debug_Emulated, 414 Debug_Emulated,
390 "Emulated program broke execution! reason=0x{:016X}, info1=0x{:016X}, info2=0x{:016X}", 415 "Signalling debugger, Attempting to unload an NRO at 0x{:016X} with size 0x{:016X}",
391 reason, info1, info2); 416 info1, info2);
392 } else { 417 break;
418 case BreakType::PostNROUnload:
419 LOG_ERROR(Debug_Emulated,
420 "Signalling debugger, Unloaded an NRO at 0x{:016X} with size 0x{:016X}", info1,
421 info2);
422 break;
423 default:
424 LOG_ERROR(Debug_Emulated,
425 "Signalling debugger, Unknown break reason {}, info1=0x{:016X}, info2=0x{:016X}",
426 static_cast<u32>(break_reason.break_type), info1, info2);
427 break;
428 }
429
430 if (!break_reason.signal_debugger) {
393 LOG_CRITICAL( 431 LOG_CRITICAL(
394 Debug_Emulated, 432 Debug_Emulated,
395 "Emulated program broke execution! reason=0x{:016X}, info1=0x{:016X}, info2=0x{:016X}", 433 "Emulated program broke execution! reason=0x{:016X}, info1=0x{:016X}, info2=0x{:016X}",