From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 05E6438582A4; Fri, 31 Mar 2023 18:03:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05E6438582A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680285782; bh=D1x0IsarqTDGilBsVnPM2W9KF00na6QIvGxR6l4w/HM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dqCk4GDbFm7W8iBq11aqyGFGorsb6Vmb3V0Mcf7yF98gyZbU/H52QzoWqEZIfFb+S 7ZML49xf74Xb6nEHNe7p82sZebZCMtwmRNfZ0mjizGCkHkhMj1WCa4fVlv8S8K0MCU A35ckuHb+ZcYqBzEPEZLnwLKHCnliUP0atat18NQ= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug exp/30271] Addresses of static thread_local fields are badly calculated sometimes Date: Fri, 31 Mar 2023 18:03:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: exp X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30271 --- Comment #7 from Tom Tromey --- Thank you, btw, for updating the test case. That was very helpful. This patch works but I think I want to rewrite the test to use the DWARF assembler, so it's compiler-independent. diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 8f35b973f3e..609fc44190d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -16577,9 +16577,8 @@ cooked_indexer::make_index (cutu_reader *reader) for (const auto &entry : m_deferred_entries) { - CORE_ADDR key =3D form_addr (entry.die_offset, m_per_cu->is_dwz); - void *obj =3D m_die_range_map.find (key); - cooked_index_entry *parent =3D static_cast (o= bj); + void *obj =3D m_die_range_map.find (entry.spec_offset); + cooked_index_entry *parent =3D static_cast (ob= j); m_index_storage->add (entry.die_offset, entry.tag, entry.flags, entry.name, parent, m_per_cu); } --=20 You are receiving this mail because: You are on the CC list for the bug.=