aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-05-28 16:20:03 -0600
committerTom Tromey <tom@tromey.com>2021-07-05 11:57:14 -0600
commitb5b44b5df07883e9dd81860ab49e08400727b70d (patch)
tree45058b793fef7f410e979550f35502cad0a56fae
parentb6aeb717a8bdaa9cc348ec88a5fdf059e1337580 (diff)
downloadbinutils-b5b44b5df07883e9dd81860ab49e08400727b70d.zip
binutils-b5b44b5df07883e9dd81860ab49e08400727b70d.tar.gz
binutils-b5b44b5df07883e9dd81860ab49e08400727b70d.tar.bz2
Fix oddity in write_gdbindex
My recent patch to unify CUs and TUs introduced an oddity in write_gdbindex. Here, we pass 'i' to recursively_write_psymbols, but we must instead pass 'counter', to handle the situation where a TU is mixed in with the CUs. I am not sure a test case for this is possible. I think it can only happen when using DWARF 5, where a TU appears in .debug_info. However, this situation is already not handled correctly by .gdb_index. I filed a bug about this.
-rw-r--r--gdb/dwarf2/index-write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index 2da222a..ccd6ef1 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -1441,7 +1441,7 @@ write_gdbindex (dwarf2_per_objfile *per_objfile, FILE *out_file,
{
if (psymtab->user == NULL)
recursively_write_psymbols (objfile, psymtab, &symtab,
- psyms_seen, i);
+ psyms_seen, counter);
const auto insertpair = cu_index_htab.emplace (psymtab, counter);
gdb_assert (insertpair.second);