On Mon, 22 Nov 2021, Eric Pouech wrote:
This series:
- fixes all the bugs I'm aware of in all the recent dbghelp
changes (dwarf4, but others too).
- and let dwarf4 replace dwarf2 as default debug format (it's been
almost 15 years <g>)
FWIW, I ran into a surprise due to this (just mentioning for reference, it's probably not worth changing anything about); this broke the recently contributed stack unwinding on ARM, when built with Clang.
When building with -gdwarf-4 with Clang, the CIEs in .debug_frame end up as version 4, but libunwind (which is needed for unwinding the ELF modules) breaks when there's such data present - https://github.com/libunwind/libunwind/issues/256 tracks that issue upstream. (It's easy to work around and patch locally though.)
This is only an issue on ARM, as -fasynchronous-unwind-tables ensures producing .eh_frame (which doesn't have this issue with CIE version) on other architectures (including ARM64). (On ARM on ELF, a different unwinding mechanism, ARMEH, is used primarily, but libunwind doesn't parse that, but can make do with .debug_frame instead.)
So far I'm working around it by explicitly passing in CFLAGS="-g -O2 -gdwarf-2" when building with Clang for ARM, and I guess will be fixed eventually in upstream libunwind too.
// Martin