[v4,0/4] Small changes to "list" command

Message ID 20230713102411.2279542-1-blarsen@redhat.com
Headers
Series Small changes to "list" command |

Message

Guinevere Larsen July 13, 2023, 10:24 a.m. UTC
  I decided to tackle PR cli/30497, and while doing so, Andrew mentioned
that it would also be nice if we could explicitly ask GDB to print the
current location, so I also decided to add that into a series. The first
patch is just some groundwork preparation to make the rest smooth. On
the second pass, I realized that 'list +' isn't properly documented, so
I added it to the docs as well.

After last round of reviews, I changed my approach to fixing cli/30497
to only have a more obvious error message to the end user instead of
jumping back to the current location.

Changes from v3:
 * Reordered patches - now '.' comes first so the UX change can
reference it
 * completely rewrote approach to patch 3
 * made "list ." no longer throw an error when inferior isn't started

Changes from v2:
 * Addressed Eli's comments
 * Added Eli reviews.

Changes from v1:
 * added new arguments to the docs
 * Added patch 4, completely new.
 * Fixed wording, per Eli's suggestions.

Bruno Larsen (4):
  gdb/cli: Factor out code to list lines around a given line
  gdb/cli: add '.' as an argument for 'list' command
  gdb/cli: Improve UX when using list with no args
  gdb/doc: document '+' argument for 'list' command

 gdb/NEWS                        |  9 ++++
 gdb/cli/cli-cmds.c              | 85 +++++++++++++++++++++++++--------
 gdb/doc/gdb.texinfo             | 12 ++++-
 gdb/source.c                    | 16 +++++++
 gdb/source.h                    |  7 +++
 gdb/testsuite/gdb.base/list.exp | 47 ++++++++++++++++--
 gdb/testsuite/gdb.base/list1.c  |  2 +-
 7 files changed, 153 insertions(+), 25 deletions(-)
  

Comments

Tom Tromey July 13, 2023, 5:31 p.m. UTC | #1
>>>>> "Bruno" == Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:

Bruno> I decided to tackle PR cli/30497, and while doing so, Andrew mentioned
Bruno> that it would also be nice if we could explicitly ask GDB to print the
Bruno> current location, so I also decided to add that into a series. The first
Bruno> patch is just some groundwork preparation to make the rest smooth. On
Bruno> the second pass, I realized that 'list +' isn't properly documented, so
Bruno> I added it to the docs as well.

Bruno> After last round of reviews, I changed my approach to fixing cli/30497
Bruno> to only have a more obvious error message to the end user instead of
Bruno> jumping back to the current location.

This all looks good to me, modulo a nit I sent earlier.
Thank you.
Approved-By: Tom Tromey <tom@tromey.com>


Tom