[PATCH v2] gdb: Change "list ." command's error when no debuginfo is available
Eli Zaretskii
eliz@gnu.org
Wed Apr 17 11:58:57 GMT 2024
> From: Guinevere Larsen <blarsen@redhat.com>
> Cc: Simon Marchi <simark@simark.ca>
> Date: Tue, 16 Apr 2024 17:00:59 -0300
>
> From: Simon Marchi <simark@simark.ca>
>
> Currently, when a user tries to list the current location, there are 2
> different error messages that can happen, either:
>
> (gdb) list .
> No symbol table is loaded. Use the "file" command.
> or
> (gdb) list .
> No debug information available to print source lines.
>
> The difference here is if gdb can find any symtabs at all or not, which
> is not something too important for end-users - and isn't informative at
> all. This commit changes it so that the error always says that there
> isn't debug information available, with these two variants:
>
> (gdb) list .
> No debug information available to print source lines at current PC (0x55555555511d).
> or
> (gdb) list .
> No debug information available to print source lines at default location.
>
> The difference now is if the inferior has started already, which is
> controlled by the user and may be useful.
How about this text instead:
Insufficient debug info for showing source lines at current PC (0x55555555511d).
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -36,6 +36,12 @@ set unwindonsignal on|off
> show unwindonsignal
> These commands are now aliases for the new set/show unwind-on-signal.
>
> +list .
> + When using the command "list ." in a location that has no debug information
> + or no file loaded, GDB now says that there is no debug information to print
> + lines. This makes it more obvious that there is no information, as opposed
> + to implying there is no inferior loaded.
This part is okay.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
More information about the Gdb-patches
mailing list