mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 13:25:07 +01:00
Extend HostSignalHandler
's SIGSEGV
debugger path
The function now returns from a segmentation fault when a debugger is present, this allows the entire context to be intact which can allow the debugger to correctly pick up variables from all stack frames while it could not extrapolate most variables when trapped inside the signal handler without the values of all registers.
This commit is contained in:
parent
4149ab1067
commit
c910e29168
@ -162,8 +162,16 @@ namespace skyline::nce {
|
|||||||
return false;
|
return false;
|
||||||
}()};
|
}()};
|
||||||
|
|
||||||
if (runningUnderDebugger)
|
if (runningUnderDebugger) {
|
||||||
|
/* Variables for debugger, these are meant to be read and utilized by the debugger to break in user code with all registers intact */
|
||||||
|
void *pc{reinterpret_cast<void *>(ctx->uc_mcontext.pc)}; // Use 'p pc' to get the value of this and 'breakpoint set -t current -a ${value of pc}' to break in user code
|
||||||
|
bool shouldReturn{true}; // Set this to false to throw an exception instead of returning
|
||||||
|
|
||||||
raise(SIGTRAP); // Notify the debugger if we've got a SIGSEGV as the debugger doesn't catch them by default as they might be hooked
|
raise(SIGTRAP); // Notify the debugger if we've got a SIGSEGV as the debugger doesn't catch them by default as they might be hooked
|
||||||
|
|
||||||
|
if (shouldReturn)
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
signal::ExceptionalSignalHandler(signal, info, ctx); // Delegate throwing a host exception to the exceptional signal handler
|
signal::ExceptionalSignalHandler(signal, info, ctx); // Delegate throwing a host exception to the exceptional signal handler
|
||||||
|
Loading…
Reference in New Issue
Block a user