]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/NEWS
gdb/cli: Improve UX when using list with no args
authorBruno Larsen <blarsen@redhat.com>
Thu, 15 Jun 2023 09:17:07 +0000 (11:17 +0200)
committerBruno Larsen <blarsen@redhat.com>
Fri, 14 Jul 2023 08:58:17 +0000 (10:58 +0200)
commitf52625f1f29a87e94aa9d40e1b76be2d0ecedc10
tree53b8c986a4913bfe8404134a687e235d5db65ba8
parent3e3a1874fcec34bcf51b4baf4be09aebab561bff
gdb/cli: Improve UX when using list with no args

When using "list" with no arguments, GDB will first print the lines
around where the inferior is stopped, then print the next N lines until
reaching the end of file, at which point it warns the user "Line X out
of range, file Y only has X-1 lines.".  This is usually desirable, but
if the user can no longer see the original line, they may have forgotten
the current line or that a list command was used at all, making GDB's
error message look cryptic. It was reported in bugzilla as PR cli/30497.

This commit improves the user experience by changing the behavior of
"list" slightly when a user passes no arguments.  It now prints that the
end of the file has been reached and recommends that the user use the
command "list ." instead.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30497
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/NEWS
gdb/cli/cli-cmds.c
gdb/doc/gdb.texinfo
gdb/source.c
gdb/source.h
gdb/testsuite/gdb.base/list.exp