]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Pre-read .debug_aranges section
authorTom Tromey <tom@tromey.com>
Sat, 14 Oct 2023 18:31:31 +0000 (12:31 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 29 Oct 2023 16:34:51 +0000 (10:34 -0600)
commitc7224db7af39652f36fd538ac997eb40cc79d770
treef04a5221ce6fc168d64d457d65b4ba1dcb480b6c
parentca362799ee0ab2bd4d4ea4f521726fefbfbad738
Pre-read .debug_aranges section

While working on background DWARF reading, I found a race case that I
tracked down to the handling of the .debug_aranges section.  Currently
the section data is only read in after the CUs have all been created.
However, there's no real reason to do this -- it seems fine to read it
a little earlier, when all the other necessary sections are read in.

This patch makes this change, and updates the
read_addrmap_from_aranges API to assert that the section is read in.

This patch slightly changes the read_addrmap_from_aranges API as well,
to reject an empty section.  This seems better to me than what the
current code does, which is try to read an empty section but then do
no work.

Regression tested on x86-64 Fedora 38.

Reviewed-By: Guinevere Larsen <blarsen@redhat.com>
gdb/dwarf2/read-debug-names.c
gdb/dwarf2/read.c