Bug 32808 - Handle DW_FORM_ref_sup*
Summary: Handle DW_FORM_ref_sup*
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 17.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks: 27453
  Show dependency treegraph
 
Reported: 2025-03-20 15:15 UTC by Tom Tromey
Modified: 2025-04-22 22:20 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2025-03-20 15:15:25 UTC
gdb doesn't handle DW_FORM_ref_sup*.

There was a thread about this:

https://sourceware.org/pipermail/gdb-patches/2021-February/176508.html

... that I totally forgot about.

These forms can be used by dwz in its DWARF 5 mode.
See https://sourceware.org/bugzilla/show_bug.cgi?id=27440
Comment 1 Tom Tromey 2025-03-20 15:16:26 UTC
I'll probably update my patch but I wanted to note that
I should look at whether BFD helps now:
https://sourceware.org/pipermail/gdb-patches/2021-February/176584.html
Comment 2 Tom Tromey 2025-03-21 15:33:13 UTC
(In reply to Tom Tromey from comment #1)
> I'll probably update my patch but I wanted to note that
> I should look at whether BFD helps now:
> https://sourceware.org/pipermail/gdb-patches/2021-February/176584.html

The support code was added in binutils, so nothing there
for gdb to use.
Comment 4 Sourceware Commits 2025-04-22 22:08:35 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7b80401da008375af1e7cc154fb8163aa406f13d

commit 7b80401da008375af1e7cc154fb8163aa406f13d
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Mar 19 14:47:29 2025 -0600

    Handle DWARF 5 separate debug sections
    
    DWARF 5 standardized the .gnu_debugaltlink section that dwz emits in
    multi-file mode.  This is handled via some new forms, and a new
    .debug_sup section.
    
    This patch adds support for this to gdb.  It is largely
    straightforward, I think, though one oddity is that I chose not to
    have this code search the system build-id directories for the
    supplementary file.  My feeling was that, while it makes sense for a
    distro to unify the build-id concept with the hash stored in the
    .debug_sup section, there's no intrinsic need to do so.
    
    This in turn means that a few tests -- for example those that test the
    index cache -- will not work in this mode.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32808
    Acked-By: Simon Marchi <simon.marchi@efficios.com>
Comment 5 Sourceware Commits 2025-04-22 22:08:43 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d43070861f5e6e890b6d1dcbe4c4d0354fa20b75

commit d43070861f5e6e890b6d1dcbe4c4d0354fa20b75
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Mar 23 10:21:25 2025 -0600

    Add "-5" flag to cc-with-tweaks
    
    This adds a "-5" flag to cc-with-tweaks, mirroring dwz's "-5" flag,
    and also adds a new cc-with-dwz-5 target board.
    
    The "-5" flag tells dwz to use the DWARF 5 .debug_sup section in
    multi-file mode.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32808
Comment 6 Tom Tromey 2025-04-22 22:20:52 UTC
Fixed.