diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 8dc2be6f176..2e85deeaa39 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2536,6 +2536,12 @@ create_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, debug_info_offset_to_per_cu; for (const auto &per_cu : per_bfd->all_comp_units) { + /* A TU will not need aranges, and skipping them here is an easy + way of ignoring .debug_types -- and possibly seeing a + duplicate section offset -- entirely. */ + if (per_cu->is_debug_types) + continue; + const auto insertpair = debug_info_offset_to_per_cu.emplace (per_cu->sect_off, per_cu.get ()); diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.exp b/gdb/testsuite/gdb.dwarf2/fission-reread.exp index 16a139eb0cd..661e90b2f21 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-reread.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-reread.exp @@ -47,7 +47,8 @@ if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" $options \ return -1 } -clean_restart $binfile +clean_restart +gdb_load_no_complaints $binfile gdb_test "break -q main" "Breakpoint.*at.*"