mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-10 07:24:54 +01:00
Add stacktrace in case of exception
This commit is contained in:
parent
1c5e30e83f
commit
d97851376d
|
|
@ -14,6 +14,11 @@
|
|||
#include "Emu/CPU/Backends/AArch64/AArch64Signal.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_lib_stacktrace
|
||||
#include "rpcs3_version.h"
|
||||
#include <stacktrace>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <Psapi.h>
|
||||
|
|
@ -2800,6 +2805,16 @@ void thread_base::exec()
|
|||
|
||||
[[noreturn]] void thread_ctrl::emergency_exit(std::string_view reason)
|
||||
{
|
||||
// Print stacktrace
|
||||
#ifdef __cpp_lib_stacktrace
|
||||
if (rpcs3::is_local_build())
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << std::stacktrace::current();
|
||||
sys_log.notice("StackTrace\n\n%s\n", oss.str());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (const std::string info = dump_useful_thread_info(); !info.empty())
|
||||
{
|
||||
sys_log.notice("\n%s", info);
|
||||
|
|
|
|||
Loading…
Reference in a new issue