diff --git a/src/symbols/symbols_with_dl.cpp b/src/symbols/symbols_with_dl.cpp index bdebca6..bf346b6 100644 --- a/src/symbols/symbols_with_dl.cpp +++ b/src/symbols/symbols_with_dl.cpp @@ -20,7 +20,8 @@ namespace libdl { nullable::null(), nullable::null(), info.dli_fname ? info.dli_fname : "", - info.dli_sname ? info.dli_sname : "" + info.dli_sname ? info.dli_sname : "", + false }; } else { return { @@ -28,7 +29,8 @@ namespace libdl { nullable::null(), nullable::null(), "", - "" + "", + false }; } } diff --git a/src/unwind/unwind_with_execinfo.cpp b/src/unwind/unwind_with_execinfo.cpp index 57cb2c9..2797e2d 100644 --- a/src/unwind/unwind_with_execinfo.cpp +++ b/src/unwind/unwind_with_execinfo.cpp @@ -5,6 +5,7 @@ #include "../platform/utils.hpp" #include +#include #include #include @@ -15,8 +16,9 @@ namespace detail { CPPTRACE_FORCE_NO_INLINE std::vector capture_frames(std::size_t skip, std::size_t max_depth) { skip++; - std::vector addrs(std::min(hard_max_frames, skip + max_depth), nullptr); - const int n_frames = backtrace(addrs.data(), static_cast(addrs.size())); // thread safe + std::vector addrs(skip + std::min(hard_max_frames, max_depth), nullptr); + // thread safe + const int n_frames = backtrace(addrs.data(), static_cast(addrs.size())); // I hate the copy here but it's the only way that isn't UB std::vector frames(n_frames - skip, 0); for(int i = skip; i < n_frames; i++) { diff --git a/src/unwind/unwind_with_unwind.cpp b/src/unwind/unwind_with_unwind.cpp index edd9403..abdc6ba 100644 --- a/src/unwind/unwind_with_unwind.cpp +++ b/src/unwind/unwind_with_unwind.cpp @@ -55,7 +55,7 @@ namespace detail { CPPTRACE_FORCE_NO_INLINE std::vector capture_frames(std::size_t skip, std::size_t max_depth) { - std::vector frames(std::min(hard_max_frames, max_depth), 0); + std::vector frames(skip + std::min(hard_max_frames, max_depth), 0); unwind_state state{skip + 1, 0, frames}; _Unwind_Backtrace(unwind_callback, &state); // presumably thread-safe frames.resize(state.count); diff --git a/src/unwind/unwind_with_winapi.cpp b/src/unwind/unwind_with_winapi.cpp index c316986..c6c7150 100644 --- a/src/unwind/unwind_with_winapi.cpp +++ b/src/unwind/unwind_with_winapi.cpp @@ -20,7 +20,7 @@ namespace cpptrace { namespace detail { CPPTRACE_FORCE_NO_INLINE std::vector capture_frames(std::size_t skip, std::size_t max_depth) { - std::vector addrs(std::min(hard_max_frames, max_depth), nullptr); + std::vector addrs(skip + std::min(hard_max_frames, max_depth), nullptr); int n_frames = CaptureStackBackTrace( static_cast(skip + 1), static_cast(addrs.size()),