public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use section name in DWARF error message
@ 2024-04-17 13:44 Tom Tromey
  2024-04-17 14:48 ` Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2024-04-17 13:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: mark, Tom Tromey

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
---
 gdb/dwarf2/read.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 061db8c2a2a..af69e1d9d9e 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);
 }
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Use section name in DWARF error message
  2024-04-17 13:44 [PATCH] Use section name in DWARF error message Tom Tromey
@ 2024-04-17 14:48 ` Simon Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2024-04-17 14:48 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches; +Cc: mark



On 2024-04-17 09:44, Tom Tromey wrote:
> 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
> ---
>  gdb/dwarf2/read.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index 061db8c2a2a..af69e1d9d9e 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);
>  }
>  

LGTM, thanks.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-17 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 13:44 [PATCH] Use section name in DWARF error message Tom Tromey
2024-04-17 14:48 ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).