diff options
author | Bruno Larsen <blarsen@redhat.com> | 2023-06-15 12:14:22 +0200 |
---|---|---|
committer | Bruno Larsen <blarsen@redhat.com> | 2023-07-14 10:58:17 +0200 |
commit | 3e3a1874fcec34bcf51b4baf4be09aebab561bff (patch) | |
tree | 28291dbcba9467ac6cf0a882be94b441b60d24a7 /gdb/doc | |
parent | 0f819434f242abef3cdbdd3b6f1d94317bc1e81a (diff) | |
download | gdb-3e3a1874fcec34bcf51b4baf4be09aebab561bff.zip gdb-3e3a1874fcec34bcf51b4baf4be09aebab561bff.tar.gz gdb-3e3a1874fcec34bcf51b4baf4be09aebab561bff.tar.bz2 |
gdb/cli: add '.' as an argument for 'list' command
Currently, after the user has used the list command once, there is no
self-contained way to ask GDB to print the location where the inferior is
stopped. The current best options require either using a separate
command to scope out where the inferior is stopped, or using "list *$pc"
requiring knowledge of GDB standard registers. This commit adds a way
to do that using '.' as a new argument for the 'list' command. If the
inferior isn't running, the command prints around the main function.
Because this necessitated having the inferior running and the test was
(seemingly unnecessarily) using printf in a non-essential way and it
would make the resulting log harder to read for no benefit, it was
replaced by a different statement.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index b10c06a..7619efe 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -9148,6 +9148,11 @@ Stack}), this prints lines centered around that line. @item list - Print lines just before the lines last printed. + +@item list . +Print the lines surrounding the location that is where the inferior +is stopped. If the inferior is not running, print around the main +function instead. @end table @cindex @code{list}, how many lines to display |