Change .gdb_index de-duplication implementation
authorTom Tromey <tromey@adacore.com>
Thu, 22 Sep 2022 19:10:55 +0000 (13:10 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 17 Oct 2022 14:01:39 +0000 (08:01 -0600)
commitdd05fc7071a6517de13975fcddca861547351266
tree74c9271226de482efbeec87d5f9d774d8fbfd646
parent5fea97943259a2bd997f92ffa66116b5c0d4eaab
Change .gdb_index de-duplication implementation

While investigating PR symtab/29179, I found that one Ada test failed
because, although a certain symbol was present in the index, with the
new DWARF reader it pointed to a different CU than was chosen by
earlier versions of gdb.

This patch changes how symbol de-duplication is done, deferring the
process until the entire symbol table has been constructed.  This way,
it's possible to always choose the lower-numbered CU among duplicates,
which is how gdb (implicitly) previously worked.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29179
gdb/dwarf2/index-write.c