aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-11-16 14:25:08 -0700
committerTom Tromey <tom@tromey.com>2022-04-12 09:31:15 -0600
commit1ddd39f58fea3ec9837018506ea1d7b86e51dc7b (patch)
tree3cb5e6fea2a1feb03baf8cc2fdd276cfdf99f3d7 /gdb
parentfe50c292d784f5616765608c3b75206493be7b1f (diff)
downloadgdb-1ddd39f58fea3ec9837018506ea1d7b86e51dc7b.zip
gdb-1ddd39f58fea3ec9837018506ea1d7b86e51dc7b.tar.gz
gdb-1ddd39f58fea3ec9837018506ea1d7b86e51dc7b.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/read.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 9c78097..4252443 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