]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/dwarf: make .gdb_index reader use its own list of units
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Jul 2025 15:35:11 +0000 (11:35 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 1 Aug 2025 04:25:51 +0000 (00:25 -0400)
commit52f0642b075c9f81c63f554203cee84cbc1f5bf8
treee6bdda2506b59902aa8fc4521399c162f6b793ce
parent5acdeb08eb52cb1dd893853376c380412d5706cb
gdb/dwarf: make .gdb_index reader use its own list of units

The .gdb_index reader currently uses per_bfd::all_units when translating
a numerical index (as found in an index entry) to a dwarf2_per_cu.  The
order of per_bfd::all_units is going to change in a subsequent patch, so
the indices as found in the index won't map to the right unit in
all_units.  Change the .gdb_index reader to maintain its own vector,
with the units in the same order as found in the .gdb_index header.

This is similar to what the .debug_names reader does.  But unlike
.debug_names, .gdb_index treats the CUs and TUs as a single list, as far
as the numerical indices are concerned, so we only need a single list
here (versus two for .debug_names).

Change-Id: I235e9b99bf02fc160dfcdaa610c9aca471f298a7
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read-gdb-index.c