Skip to content

Commit 5882c62

Browse files
committed
replace stackwalker with backward-cpp for win as well
1 parent f0e7ebc commit 5882c62

File tree

9 files changed

+8
-2340
lines changed

9 files changed

+8
-2340
lines changed

RTEA.vcxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,6 @@
810810
<ClInclude Include="Source\System\Semver200\semver200.h" />
811811
<ClInclude Include="Source\System\Semver200\version.h" />
812812
<ClInclude Include="Source\System\SpatialPartitionGrid.h" />
813-
<ClInclude Include="Source\System\RTEStackTrace.h" />
814-
<ClInclude Include="Source\System\StackWalker\StackWalker.h" />
815813
<ClInclude Include="Source\System\StandardIncludes.h" />
816814
<ClInclude Include="Source\System\Box.h" />
817815
<ClInclude Include="Source\System\Color.h" />
@@ -1330,8 +1328,6 @@
13301328
<ClCompile Include="Source\System\Semver200\Semver200_parser.cpp" />
13311329
<ClCompile Include="Source\System\Serializable.cpp" />
13321330
<ClCompile Include="Source\System\SpatialPartitionGrid.cpp" />
1333-
<ClCompile Include="Source\System\RTEStackTrace.cpp" />
1334-
<ClCompile Include="Source\System\StackWalker\StackWalker.cpp" />
13351331
<ClCompile Include="Source\System\StandardIncludes.cpp">
13361332
<PrecompiledHeader>Create</PrecompiledHeader>
13371333
<PrecompiledHeaderFile>StandardIncludes.h</PrecompiledHeaderFile>

Source/System/RTEError.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#ifdef _WIN32
1212
#include "Windows.h"
1313
#include "DbgHelp.h"
14-
#include "RTEStackTrace.h"
1514
#endif
1615

1716
#include <array>
@@ -30,12 +29,12 @@
3029
#include <sys/utsname.h>
3130
#include <fstream>
3231
#include <filesystem>
33-
#include "backward/backward.hpp"
3432
#elif defined(__APPLE__) && defined(__MACH__)
3533
#include <sys/sysctl.h>
36-
#include "backward/backward.hpp"
3734
#endif
3835

36+
#include "backward/backward.hpp"
37+
3938

4039
using namespace RTE;
4140

@@ -163,9 +162,13 @@ static LONG WINAPI RTEWindowsExceptionHandler([[maybe_unused]] EXCEPTION_POINTER
163162
exceptionDescription << getExceptionDescriptionFromCode(exceptionCode) << " at address 0x" << std::uppercase << std::hex << exceptionAddress << ".\n\n"
164163
<< symbolNameAtAddress << std::endl;
165164

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);
167170

168-
RTEError::UnhandledExceptionFunc(exceptionDescription.str(), stackTrace.GetCallStackAsString(processHandle, exceptPtr->ContextRecord));
171+
RTEError::UnhandledExceptionFunc(exceptionDescription.str(), stack.str());
169172
return EXCEPTION_EXECUTE_HANDLER;
170173
#endif
171174
}
@@ -350,17 +353,12 @@ void RTEError::AbortFunc(const std::string& description, const std::source_locat
350353

351354
std::string callstack = "";
352355

353-
#ifdef _WIN32
354-
RTEStackTrace stackTrace;
355-
callstack += ("\n\n" + stackTrace.GetCallStackAsString());
356-
#else
357356
backward::StackTrace st;
358357
st.load_here();
359358
backward::Printer printer;
360359
std::ostringstream stack;
361360
printer.print(st, stack);
362361
callstack = stack.str();
363-
#endif
364362

365363
std::string consoleSaveMsg;
366364
if (!callstack.empty()) {

Source/System/RTEStackTrace.cpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

Source/System/RTEStackTrace.h

Lines changed: 0 additions & 41 deletions
This file was deleted.

Source/System/StackWalker/CODE_OF_CONDUCT.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

Source/System/StackWalker/LICENSE

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)