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