mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +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 kernelAbove200(void);
|
||||||
bool kernelAbove300(void);
|
bool kernelAbove300(void);
|
||||||
bool kernelAbove400(void);
|
bool kernelAbove400(void);
|
||||||
|
bool detectDebugger(void);
|
||||||
|
@ -33,3 +33,9 @@ bool kernelAbove400(void) {
|
|||||||
_CacheValues();
|
_CacheValues();
|
||||||
return g_IsAbove400;
|
return g_IsAbove400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool detectDebugger(void) {
|
||||||
|
u64 tmp;
|
||||||
|
svcGetInfo(&tmp, 8, 0, 0);
|
||||||
|
return !!tmp;
|
||||||
|
}
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
void fatalSimple(Result err) {
|
void fatalSimple(Result err) {
|
||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
|
|
||||||
|
if (detectDebugger()) {
|
||||||
|
svcBreak(0x80000000, err, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (!smHasInitialized()) {
|
if (!smHasInitialized()) {
|
||||||
rc = smInitialize();
|
rc = smInitialize();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user