From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0AB1A385E021; Sun, 28 Mar 2021 16:15:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AB1A385E021 From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/23504] index cache: Produce and consume DWARF5 format Date: Sun, 28 Mar 2021 16:15:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb 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 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: Sun, 28 Mar 2021 16:15:26 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23504 --- Comment #6 from Tom Tromey --- (In reply to Mark Wielaard from comment #5) > It is clear, I just don't know enough about the index cache to understand > which design makes most sense. It seems for strings you need some way to > tell which section they came from, either .debug_string [ ... ] The issue is that .debug_names can only reference strings from .debug_str. Quoting from DWARF 5: The string offsets in the first array refer to names in the .debug_str (or .debug_str.dwo ) section. So, if gdb tries to create a new index, and it needs a string that isn't in .debug_str for some reason, then it must have a way to add a string to that section. Now, currently this happens a lot, because gdb puts the wrong names into the index. However, it's possible for this to happen even when gdb is changed to work correctly, because nothing guarantees that some DIE's name attribute will be in .debug_str. > These could be addressed using the length of the main .debug_str > as a base, to make it easy to tell which section to consult. It turns out gdb already does this. Which Simon mentioned originally and I somehow neglected to read and/or understand. So I think what should probably happen is: * Change the DWARF 5 index writer to use BFD to create a new file that has .debug_names and .debug_str (and maybe .debug_aranges) sections; * Write only the newly-needed strings to .debug_str (what gdb already does, essentially); * Change the index cache reader to know to use the extended .debug_str when necessary I think this would make DWARF 5 index cache management work the same as .gdb_index. It would require some tweaks to gdb-add-index and to the manual. --=20 You are receiving this mail because: You are on the CC list for the bug.=