From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 03F393861010; Wed, 26 May 2021 09:23:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03F393861010 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/27898] [gdb] Cannot not find DIE Date: Wed, 26 May 2021 09:23:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 09:23:02 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27898 --- Comment #9 from Tom de Vries --- (In reply to Tom de Vries from comment #8) > This fixes it: But causes many regression. This also fixes it, now testing: ... $ git diff diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c index 2451df4f5b6..1031ed3aa00 100644 --- a/gdb/dwarf2/cu.c +++ b/gdb/dwarf2/cu.c @@ -35,7 +35,8 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, producer_is_icc (false), producer_is_icc_lt_14 (false), producer_is_codewarrior (false), - processing_has_namespace_info (false) + processing_has_namespace_info (false), + load_all_dies (false) { } diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h index ff56ec5527b..65a4cf8babf 100644 --- a/gdb/dwarf2/cu.h +++ b/gdb/dwarf2/cu.h @@ -283,6 +283,12 @@ struct dwarf2_cu return nullptr; } + + /* This flag will be set when reading partial DIEs if we need to load + absolutely all DIEs for this compilation unit, instead of just the on= es + we think are interesting. It gets set if we look for a DIE in the + hash table and don't find it. */ + unsigned int load_all_dies : 1; }; #endif /* GDB_DWARF2_CU_H */ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 2cd8a95658a..c23a8b99360 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18831,7 +18831,7 @@ load_partial_dies (const struct die_reader_specs *reader, last_die =3D NULL; gdb_assert (cu->per_cu !=3D NULL); - if (cu->per_cu->load_all_dies) + if (cu->load_all_dies) load_all =3D 1; cu->partial_dies @@ -19399,9 +19399,9 @@ find_partial_die (sect_offset sect_off, int offset_in_dwz, str uct dwarf2_cu *cu) /* If we didn't find it, and not all dies have been loaded, load them all and try again. */ - if (pd =3D=3D NULL && cu->per_cu->load_all_dies =3D=3D 0) + if (pd =3D=3D NULL && cu->load_all_dies =3D=3D 0) { - cu->per_cu->load_all_dies =3D 1; + cu->load_all_dies =3D 1; /* This is nasty. When we reread the DIEs, somewhere up the call ch= ain THIS_CU->cu may already be in use. So we can't just free it and diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 6af1f44bd47..0bb3da5a34a 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -421,7 +421,6 @@ struct dwarf2_per_cu_data { dwarf2_per_cu_data () : queued (false), - load_all_dies (false), is_debug_types (false), is_dwz (false), reading_dwo_directly (false), @@ -447,12 +446,6 @@ struct dwarf2_per_cu_data any of the current compilation units are processed. */ unsigned int queued : 1; - /* This flag will be set when reading partial DIEs if we need to load - absolutely all DIEs for this compilation unit, instead of just the on= es - we think are interesting. It gets set if we look for a DIE in the - hash table and don't find it. */ - unsigned int load_all_dies : 1; - /* Non-zero if this CU is from .debug_types. Struct dwarf2_per_cu_data is contained in struct signatured_type iff this is non-zero. */ ... Basically, moving load_all_dies from dwarf2_per_cu_data to dwarf2_cu. --=20 You are receiving this mail because: You are on the CC list for the bug.=