Flush emulation logs after exceptions

A lot of logs are incomplete due to being unable to flush inside the signal handler, now we flush after any exceptions so that there is a guarantee of any exceptions being logged as this is crucial for proper debugging.
This commit is contained in:
PixelyIon
2022-04-10 13:19:50 +05:30
parent 62ba180550
commit ea00f1bb82
4 changed files with 13 additions and 0 deletions

View File

@ -126,11 +126,13 @@ namespace skyline::soc::host1x {
} catch (const signal::SignalException &e) {
if (e.signal != SIGINT) {
Logger::Error("{}\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();
signal::BlockSignal({SIGINT});
state.process->Kill(false);
}