binutils-gdb/gdb/dwarf2
Tom de Vries c7cd10637c [gdb/symtab] Fix assert in read_addrmap_from_aranges
When loading the debug-names-duplicate-cu executable included in this
test-case, we run into:
...
(gdb) file debug-names-duplicate-cu^M
Reading symbols from debug-names-duplicate-cu...^M
src/gdb/dwarf2/read.c:2353: internal-error: read_addrmap_from_aranges: \
  Assertion `insertpair.second' failed.^M
...

This assert was added in recent commit 75337cbc14 ("[gdb/symtab] Fix
.debug_aranges duplicate offset warning").

The assert triggers because the CU table in the .debug_names section contains
a duplicate:
...
Version 5
Augmentation string: 47 44 42 00  ("GDB")
CU table:
[  0] 0x0
[  1] 0x0
...

Fix this by rejecting the .debug_names index:
...
(gdb) file debug-names-duplicate-cu^M
Reading symbols from debug-names-duplicate-cu...^M
warning: Section .debug_names has duplicate entry in CU table, \
  ignoring .debug_names.^M
...

Likewise for the case where the CU table is not sorted by increasing offset.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29436
2022-08-07 08:31:37 +02:00
..
abbrev-cache.c
abbrev-cache.h
abbrev.c
abbrev.h
attribute.c
attribute.h
comp-unit-head.c
comp-unit-head.h
cooked-index.c
cooked-index.h
cu.c gdb: add "id" fields to identify symtabs and subfiles 2022-07-29 20:54:49 -04:00
cu.h
die.h
dwz.c
dwz.h
expr.c Use registry in gdbarch 2022-08-04 13:28:04 -06:00
expr.h
file-and-dir.h
frame-tailcall.c
frame-tailcall.h
frame.c Use registry in gdbarch 2022-08-04 13:28:04 -06:00
frame.h
index-cache.c Use gdb_bfd_ref_ptr in objfile 2022-08-03 13:26:58 -06:00
index-cache.h
index-common.c
index-common.h
index-write.c Use gdb_bfd_ref_ptr in objfile 2022-08-03 13:26:58 -06:00
index-write.h
leb.c
leb.h
line-header.c gdb: add "id" fields to identify symtabs and subfiles 2022-07-29 20:54:49 -04:00
line-header.h gdb: add "id" fields to identify symtabs and subfiles 2022-07-29 20:54:49 -04:00
loc.c Use gdb_bfd_ref_ptr in objfile 2022-08-03 13:26:58 -06:00
loc.h
macro.c gdb/dwarf: pass a file_entry to line_header::file_file_name 2022-07-29 20:54:49 -04:00
macro.h
mapped-index.h
public.h
read.c [gdb/symtab] Fix assert in read_addrmap_from_aranges 2022-08-07 08:31:37 +02:00
read.h
sect-names.h
section.c
section.h
stringify.c
stringify.h
tag.h