public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix latent bug in read_addrmap_from_aranges
@ 2022-04-12 15:39 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-04-12 15:39 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1ddd39f58fea3ec9837018506ea1d7b86e51dc7b
commit 1ddd39f58fea3ec9837018506ea1d7b86e51dc7b
Author: Tom Tromey <tom@tromey.com>
Date: Tue Nov 16 14:25:08 2021 -0700
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:
---
gdb/dwarf2/read.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-12 15:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 15:39 [binutils-gdb] Fix latent bug in read_addrmap_from_aranges Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).