mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Detect debugger and use svcBreak in panic
This commit is contained in:
parent
5f860ad4b3
commit
6585261210
@ -2,3 +2,4 @@
|
||||
bool kernelAbove200(void);
|
||||
bool kernelAbove300(void);
|
||||
bool kernelAbove400(void);
|
||||
bool detectDebugger(void);
|
||||
|
@ -33,3 +33,9 @@ bool kernelAbove400(void) {
|
||||
_CacheValues();
|
||||
return g_IsAbove400;
|
||||
}
|
||||
|
||||
bool detectDebugger(void) {
|
||||
u64 tmp;
|
||||
svcGetInfo(&tmp, 8, 0, 0);
|
||||
return !!tmp;
|
||||
}
|
||||
|
@ -4,6 +4,10 @@
|
||||
void fatalSimple(Result err) {
|
||||
Result rc = 0;
|
||||
|
||||
if (detectDebugger()) {
|
||||
svcBreak(0x80000000, err, 0);
|
||||
}
|
||||
|
||||
if (!smHasInitialized()) {
|
||||
rc = smInitialize();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user