Bug 31361 - .debug_names uses wrong form for DW_IDX_die_offset
Summary: .debug_names uses wrong form for DW_IDX_die_offset
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 15.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks: 27453
  Show dependency treegraph
 
Reported: 2024-02-09 18:57 UTC by Tom Tromey
Modified: 2024-03-01 00:15 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 2024-02-09 18:57:56 UTC
I noticed today that DW_IDX_die_offset is documented
as having a reference form, but right now gdb emits
it as:

		m_abbrev_table.append_unsigned_leb128 (DW_IDX_die_offset);
		m_abbrev_table.append_unsigned_leb128 (DW_FORM_udata);

this should probably be DW_FORM_sec_offset
Comment 1 Tom Tromey 2024-02-09 18:58:47 UTC
Setting the target milestone here because this code is new
and so we can fix it before it is visible in a release.
Comment 2 Tom Tromey 2024-02-10 00:36:57 UTC
DW_FORM_ref_addr is better I think.
Comment 4 Sourceware Commits 2024-03-01 00:14:53 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

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

commit 932e5949a9f366d149b1b9093c49225502dee890
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Feb 9 17:40:35 2024 -0700

    Use DW_FORM_ref_addr for DIE offset in .debug_names
    
    Today I realized that while the .debug_names writer uses DW_FORM_udata
    for the DIE offset, DW_FORM_ref_addr would be more appropriate here.
    This patch makes this change.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31361
Comment 5 Tom Tromey 2024-03-01 00:15:38 UTC
Fixed.