]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
Change how .debug_aranges padding is skipped
authorTom Tromey <tom@tromey.com>
Fri, 25 Jun 2021 18:34:41 +0000 (12:34 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 25 Jun 2021 18:34:41 +0000 (12:34 -0600)
commit3da4c6449b1ce57accfb1b9fa8415ad1cf42039b
treeeb17dd638c517d85674b7e7cd14e3e36aff95b8f
parent3e9f1ca148ca2ecf6cd008ed2678a4cbe253620b
Change how .debug_aranges padding is skipped

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.
gdb/ChangeLog
gdb/dwarf2/read.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.rust/dwindex.exp [new file with mode: 0644]
gdb/testsuite/gdb.rust/dwindex.rs [new file with mode: 0644]
gdb/testsuite/lib/gdb.exp