From 435b3cd00175a834bb25d186b179a50d3cc44533 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:23:19 -0400 Subject: [PATCH] Small fixes --- CMakeLists.txt | 3 +++ src/unwind/unwind_with_dbghelp.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a1e505..137f584 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,6 +348,9 @@ if(CPPTRACE_UNWIND_WITH_WINAPI) endif() if(CPPTRACE_UNWIND_WITH_DBGHELP) + if(NOT HAS_STACKWALK) + message(WARNING "Cpptrace: CPPTRACE_UNWIND_WITH_DBGHELP specified but dbghelp stackwalk64 doesn't seem to be available.") + endif() target_compile_definitions(cpptrace PUBLIC CPPTRACE_UNWIND_WITH_DBGHELP) target_link_libraries(cpptrace PRIVATE dbghelp) endif() diff --git a/src/unwind/unwind_with_dbghelp.cpp b/src/unwind/unwind_with_dbghelp.cpp index 83f5fc0..f1005af 100644 --- a/src/unwind/unwind_with_dbghelp.cpp +++ b/src/unwind/unwind_with_dbghelp.cpp @@ -50,7 +50,7 @@ namespace detail { "label:\n\t" "mov{l %%ebp, %[cEbp] | %[cEbp], ebp};\n\t" "mov{l %%esp, %[cEsp] | %[cEsp], esp};\n\t" - "mov{l $label, %%eax | eax, label};\n\t" + "mov{l $label, %%eax | eax, OFFSET label};\n\t" "mov{l %%eax, %[cEip] | %[cEip], eax};\n\t" : [cEbp] "=r" (context.Ebp), [cEsp] "=r" (context.Esp),