|
11 | 11 | #ifdef _WIN32 |
12 | 12 | #include "Windows.h" |
13 | 13 | #include "DbgHelp.h" |
14 | | -#include "RTEStackTrace.h" |
15 | 14 | #endif |
16 | 15 |
|
17 | 16 | #include <array> |
|
30 | 29 | #include <sys/utsname.h> |
31 | 30 | #include <fstream> |
32 | 31 | #include <filesystem> |
33 | | -#include "backward/backward.hpp" |
34 | 32 | #elif defined(__APPLE__) && defined(__MACH__) |
35 | 33 | #include <sys/sysctl.h> |
36 | | -#include "backward/backward.hpp" |
37 | 34 | #endif |
38 | 35 |
|
| 36 | +#include "backward/backward.hpp" |
| 37 | + |
39 | 38 |
|
40 | 39 | using namespace RTE; |
41 | 40 |
|
@@ -163,9 +162,13 @@ static LONG WINAPI RTEWindowsExceptionHandler([[maybe_unused]] EXCEPTION_POINTER |
163 | 162 | exceptionDescription << getExceptionDescriptionFromCode(exceptionCode) << " at address 0x" << std::uppercase << std::hex << exceptionAddress << ".\n\n" |
164 | 163 | << symbolNameAtAddress << std::endl; |
165 | 164 |
|
166 | | - RTEStackTrace stackTrace; |
| 165 | + backward::StackTrace st; |
| 166 | + st.load_here(32, exceptPtr->ContextRecord); |
| 167 | + backward::Printer printer; |
| 168 | + std::ostringstream stack; |
| 169 | + printer.print(st, stack); |
167 | 170 |
|
168 | | - RTEError::UnhandledExceptionFunc(exceptionDescription.str(), stackTrace.GetCallStackAsString(processHandle, exceptPtr->ContextRecord)); |
| 171 | + RTEError::UnhandledExceptionFunc(exceptionDescription.str(), stack.str()); |
169 | 172 | return EXCEPTION_EXECUTE_HANDLER; |
170 | 173 | #endif |
171 | 174 | } |
@@ -350,17 +353,12 @@ void RTEError::AbortFunc(const std::string& description, const std::source_locat |
350 | 353 |
|
351 | 354 | std::string callstack = ""; |
352 | 355 |
|
353 | | -#ifdef _WIN32 |
354 | | - RTEStackTrace stackTrace; |
355 | | - callstack += ("\n\n" + stackTrace.GetCallStackAsString()); |
356 | | -#else |
357 | 356 | backward::StackTrace st; |
358 | 357 | st.load_here(); |
359 | 358 | backward::Printer printer; |
360 | 359 | std::ostringstream stack; |
361 | 360 | printer.print(st, stack); |
362 | 361 | callstack = stack.str(); |
363 | | -#endif |
364 | 362 |
|
365 | 363 | std::string consoleSaveMsg; |
366 | 364 | if (!callstack.empty()) { |
|
0 commit comments