Detect debugger and use svcBreak in panic

This commit is contained in:
plutoo 2018-01-11 21:49:06 +01:00
parent 5f860ad4b3
commit 6585261210
3 changed files with 11 additions and 0 deletions

View File

@ -2,3 +2,4 @@
bool kernelAbove200(void);
bool kernelAbove300(void);
bool kernelAbove400(void);
bool detectDebugger(void);

View File

@ -33,3 +33,9 @@ bool kernelAbove400(void) {
_CacheValues();
return g_IsAbove400;
}
bool detectDebugger(void) {
u64 tmp;
svcGetInfo(&tmp, 8, 0, 0);
return !!tmp;
}

View File

@ -4,6 +4,10 @@
void fatalSimple(Result err) {
Result rc = 0;
if (detectDebugger()) {
svcBreak(0x80000000, err, 0);
}
if (!smHasInitialized()) {
rc = smInitialize();
}