]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: make the error message for unreadable objfiles more informative
authorGuinevere Larsen <guinevere@redhat.com>
Thu, 7 Nov 2024 19:15:20 +0000 (16:15 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Fri, 8 Nov 2024 11:59:05 +0000 (08:59 -0300)
When GDB is unable to read an objfile, it prints the error message "I'm
sorry Dave, I can't do that. Symbol format `%s' unknown.". While it is a
great reference, an end user won't have much information about the
problem.

So far this wasn't much of a problem, as it is very uncommon for GDB to
be unable to read an objfile. However, a future patch will allow users
to selectively disable support to some formats, making it somewhat
expected that the message will be seen by end users.

This commit makes the end message more informative and direct.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=13299
Approved-By: Tom Tromey <tom@tromey.com>
gdb/symfile.c

index 1502fdbe500be34e5178ee0cfd54a0e1e410a991..adc60e1b72385be2ca5304c0c00eb6c4f2841c0d 100644 (file)
@@ -1775,8 +1775,8 @@ find_sym_fns (bfd *abfd)
     if (our_flavour == rsf.sym_flavour)
       return rsf.sym_fns;
 
-  error (_("I'm sorry, Dave, I can't do that.  Symbol format `%s' unknown."),
-        bfd_get_target (abfd));
+  error (_("Object file %s could not be read.  Symbol format `%s' unknown."),
+        abfd->filename, bfd_get_target (abfd));
 }
 \f