public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/30497] New: Bad User Experience with multiple list commands reaching end of file
@ 2023-05-30 11:04 blarsen at redhat dot com
  2023-07-14  9:03 ` [Bug cli/30497] " cvs-commit at gcc dot gnu.org
  2023-07-14  9:06 ` blarsen at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: blarsen at redhat dot com @ 2023-05-30 11:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30497

            Bug ID: 30497
           Summary: Bad User Experience with multiple list commands
                    reaching end of file
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: blarsen at redhat dot com
  Target Milestone: ---

A question was raised today on the Libera IRC instance where a user couldn't
understand the error raised by the list command. While the original user never
replied, it was mentioned that a possibly confusing UX would happen in the
following situation:

While debugging a file close to its end, for instance the following:
int main () {
  return 0;
}

starting the inferior, then trying the command list twice we get the following
session:
(gdb) list
1       int main(){
2           return 0;
3       }
(gdb) 
Line number 4 out of range; t.cc has 3 lines.

With this session, the error is pretty easy to understand, but if a user is in
a more complex session, having used "list" then run multiple other commands, to
a point where the user would like to see the current source location again,
they would get the error.

In my opinion, the ideal solution is that GDB should not continue listing the
program if the previous command was not "list", but reprint the current context
instead. If that isn't possible, adding a message like "end of file was
reached. Printing current context again" if there was no argument given to the
command "list" sounds like a decent work-around.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2023-07-14  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 11:04 [Bug cli/30497] New: Bad User Experience with multiple list commands reaching end of file blarsen at redhat dot com
2023-07-14  9:03 ` [Bug cli/30497] " cvs-commit at gcc dot gnu.org
2023-07-14  9:06 ` blarsen at redhat dot com

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).