mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-28 04:13:28 +08:00

When GCC emits .debug_aranges, it adds padding to align the contents to two times the address size. GCC has done this for many years -- but there is nothing in the DWARF standard that says this should be done, and LLVM does not seem to add this padding. It's simple to detect if the padding exists, though: if the contents of one .debug_aranges CU (excluding the header) are not a multiple of the alignment that GCC uses, then anything extra must be padding. This patch changes gdb to correctly read both styles. It removes the requirement that the padding bytes be zero, as this seemed unnecessarily pedantic to me. gdb/ChangeLog 2021-06-25 Tom Tromey <tom@tromey.com> * dwarf2/read.c (create_addrmap_from_aranges): Change padding logic. gdb/testsuite/ChangeLog 2021-06-25 Tom Tromey <tom@tromey.com> * lib/gdb.exp (add_gdb_index, ensure_gdb_index): Add "style" parameter. * gdb.rust/dwindex.exp: New file. * gdb.rust/dwindex.rs: New file.