Add stack tracing to skyline::exception

Skyline's `exception` class now stores a list of all stack frames during the invocation of the exception. These can later be parsed by the exception handler to generate a human-readable stack trace. To assist with more complete stack traces, `-fno-omit-frame-pointer` is now passed on debug builds which forces the inclusion of frames on function calls.
This commit is contained in:
PixelyIon
2022-04-11 21:37:47 +05:30
parent cd8fa66326
commit 41b98c7daa
11 changed files with 88 additions and 12 deletions

View File

@ -130,6 +130,11 @@ namespace skyline::soc::host1x {
signal::BlockSignal({SIGINT});
state.process->Kill(false);
}
} catch (const exception &e) {
Logger::ErrorNoPrefix("{}\nStack Trace:{}", e.what(), state.loader->GetStackTrace(e.frames));
Logger::EmulationContext.Flush();
signal::BlockSignal({SIGINT});
state.process->Kill(false);
} catch (const std::exception &e) {
Logger::Error(e.what());
Logger::EmulationContext.Flush();