From: Tom Tromey Date: Tue, 16 Nov 2021 21:25:08 +0000 (-0700) Subject: Fix latent bug in read_addrmap_from_aranges X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ddd39f58fea3ec9837018506ea1d7b86e51dc7b;p=binutils-gdb.git Fix latent bug in read_addrmap_from_aranges Tom de Vries found a failure that we tracked down to a latent bug in read_addrmap_from_aranges (previously create_addrmap_from_aranges). The bug is that this code can erroneously reject .debug_aranges when dwz is in use, due to CUs at duplicate offsets. Because aranges can't refer to a CU coming from the dwz file, the fix is to simply skip such CUs in the loop. --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 9c78097bc45..425244358a7 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2602,8 +2602,9 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, { /* 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) + duplicate section offset -- entirely. The same applies to + units coming from a dwz file. */ + if (per_cu->is_debug_types || per_cu->is_dwz) continue; const auto insertpair