bombela/backward-cpp

No pretty trace if using compressed debug sections

mathiaswagner opened this issue · 0 comments

If I used compressed debug sections (see https://maskray.me/blog/2022-01-23-compressed-debug-sections) I only get outputs like (using test_stacktraceand adding -gz to the cmake configuration for compiling and linking):

Stack trace (most recent call last):
#9    Object "", at 0xffffffffffffffff, in
#8    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b52bad, in _start
BFD: DWARF error: section .debug_info is larger than its filesize! (0x93ef57 vs 0x530ea0)
#7    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff93e13c082, in __libc_start_main
#6    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b5300c, in main
#5    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b52cf9, in run_test(test::TestBase&, bool)
#4    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b5314b, in test::TestBase::run()
#3    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b5377a, in TEST_minitrace::do_test()
#2    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b53724, in collect_trace(backward::StackTrace&)
#1    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b545a9, in backward::StackTraceImpl<backward::system_tag::linux_tag>::load_here(unsigned long, void*, void*)
#0    Object "/home/m/backward-cpp/build/test_stacktrace", at 0x562503b57cb5, in unsigned long backward::details::unwind<backward::StackTraceImpl<backward::system_tag::linux_tag>::callback>(backward::StackTraceImpl<backward::system_tag::linux_tag>::callback, unsigned long)
-- test case success: minitrace

Without the -gz flags everything works as expected and I get the source printed as expected.

Not sure if there is an easy way to fix that.