Bug 31639 - read_str_index error message hard codes section name
Summary: read_str_index error message hard codes section name
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 15.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-13 11:06 UTC by Mark Wielaard
Modified: 2024-04-17 15:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2024-04-13 11:06:53 UTC
If there is a problem with GNU_str_index or strx form in read_str_index the error produced is:

Offset from DW_FORM_GNU_str_index or                                                                                                                                             
DW_FORM_strx pointing outside of .debug_str.dwo section

But when called through read_stub_str_index the section name should not be .debug_str.dwo. Which is really confusing when trying to debug what is wrong with a debug file.
Comment 1 Tom Tromey 2024-04-17 13:40:49 UTC
Sending a patch.
Comment 3 Sourceware Commits 2024-04-17 14:59:03 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

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

commit c7d73a715775ade814370212726d50ab4b7c6fe0
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Apr 17 07:42:28 2024 -0600

    Use section name in DWARF error message
    
    A bug points out that a certain error message in read_str_index uses a
    hard-coded section name.  This patch changes it to use
    dwarf2_section_info::get_name instead, like the other errors in the
    function.
    
    No test because it didn't seem worthwhile.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31639
    Approved-By: Simon Marchi <simon.marchi@efficios.com>
Comment 4 Tom Tromey 2024-04-17 15:00:04 UTC
Fixed.