bombela / backward-cpp

A beautiful stack trace pretty printer for C++
MIT License
3.73k stars 471 forks source link

Support libdwarf >= 20210528 #232

Open jgcodes2020 opened 3 years ago

jgcodes2020 commented 3 years ago

My library links in a relatively recent version of libdwarf, commit c70361. This version removed old methods (like dwarf_get_ranges_a, dwarf_siblingof) in favour of the latest versions of the function (i.e. dwarf_get_ranges_b, dwarf_siblingof_b). In addition, it deprecated pulling in libelf, you should instead use dwarf_init_path.

Gist with my compiler's error logs

okeuday commented 1 year ago

To avoid compatibility problems, it should be best to focus on the 0.x.y releases of libdwarf which utilize the libdwarf-0 include directory instead of the libdwarf include directory (https://github.com/bombela/backward-cpp/pull/237). With all the API functions changing a separate macro like BACKWARD_HAS_DWARF0 could be used to allow the older API to remain while the newer API receives more testing.