aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/read.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-04-17 07:42:28 -0600
committerTom Tromey <tromey@adacore.com>2024-04-17 08:58:26 -0600
commitc7d73a715775ade814370212726d50ab4b7c6fe0 (patch)
tree2a3d5fbc173dfbe9ed0fe4be2a1a86899832b43c /gdb/dwarf2/read.c
parentcbb97c5be367123a00846d4dacb6a042fff87901 (diff)
downloadbinutils-c7d73a715775ade814370212726d50ab4b7c6fe0.zip
binutils-c7d73a715775ade814370212726d50ab4b7c6fe0.tar.gz
binutils-c7d73a715775ade814370212726d50ab4b7c6fe0.tar.bz2
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>
Diffstat (limited to 'gdb/dwarf2/read.c')
-rw-r--r--gdb/dwarf2/read.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 061db8c..af69e1d 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -17469,8 +17469,9 @@ read_str_index (struct dwarf2_cu *cu,
str_offset = bfd_get_64 (abfd, info_ptr);
if (str_offset >= str_section->size)
error (_("Offset from %s pointing outside of"
- " .debug_str.dwo section in CU at offset %s [in module %s]"),
- form_name, sect_offset_str (cu->header.sect_off), objf_name);
+ " %s section in CU at offset %s [in module %s]"),
+ form_name, str_section->get_name (),
+ sect_offset_str (cu->header.sect_off), objf_name);
return (const char *) (str_section->buffer + str_offset);
}