MCPcopy Create free account
hub / github.com/decaf-emu/decaf-emu / hostFaultWithStackTrace

Function hostFaultWithStackTrace

src/common/src/assert.cpp:73–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void
74hostFaultWithStackTrace(const std::string &fault,
75 platform::StackTrace *stackTrace)
76{
77 auto trace = platform::formatStackTrace(stackTrace);
78
79 fmt::memory_buffer out;
80 fmt::format_to(std::back_inserter(out), "Encountered host cpu fault:\n");
81 fmt::format_to(std::back_inserter(out), "Fault: {}\n", fault);
82
83 if (trace.size()) {
84 fmt::format_to(std::back_inserter(out), "Stacktrace:\n{}\n", trace);
85 }
86 out.push_back('\0');
87
88 gLog->critical("{}", out.data());
89 std::cerr << out.data() << std::endl;
90
91#ifdef PLATFORM_WINDOWS
92 if (IsDebuggerPresent()) {
93 OutputDebugStringW(platform::toWinApiString(out.data()).c_str());
94 } else {
95 MessageBoxW(NULL,
96 platform::toWinApiString(fault).c_str(),
97 L"Encountered host cpu fault",
98 MB_OK | MB_ICONERROR);
99 }
100#endif
101}

Callers

nothing calls this directly

Calls 6

toWinApiStringFunction · 0.85
criticalMethod · 0.80
formatStackTraceFunction · 0.70
sizeMethod · 0.45
push_backMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected