public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Bruno Larsen <blarsen@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/4] gdb/cli: Improve UX when using list with no args
Date: Tue, 20 Jun 2023 19:19:28 +0300	[thread overview]
Message-ID: <83mt0u5cof.fsf@gnu.org> (raw)
In-Reply-To: <20230620155259.2476415-3-blarsen@redhat.com> (message from Bruno Larsen on Tue, 20 Jun 2023 17:52:58 +0200)

> From: Bruno Larsen <blarsen@redhat.com>
> Cc: eliz@gnu.org,
> 	Bruno Larsen <blarsen@redhat.com>
> Date: Tue, 20 Jun 2023 17:52:58 +0200
> 
>  gdb/NEWS                        |  7 +++++++
>  gdb/cli/cli-cmds.c              | 36 +++++++++++++++++++++++++++++++--
>  gdb/doc/gdb.texinfo             |  7 +++++--
>  gdb/source.c                    | 18 +++++++++++++++++
>  gdb/source.h                    |  4 ++++
>  gdb/testsuite/gdb.base/list.exp |  8 ++++----
>  6 files changed, 72 insertions(+), 8 deletions(-)

Thanks.

> +* Using the 'list' command with no arguments in a situation where the
> +  command would attempt to list past the end of the file, instead of
> +  erroring out, it will now warn the user that the end of file has been
> +  reached and the default location will be printed.  The default location
> +  is either the last solitary line printed (if there was one) or around
> +  the main function.

The first sentence is too complex.  I suggest to rephrase:

  Using the 'list' command with no arguments in a situation where the
  command would attempt to list past the end of the file now warns the
  user that the end of file has been reached, and prints the default
  location.  Previously, it would error out.  The default location for
  this purpose is the last solitary line printed, if there was one,
  else the lines around the main function.

> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -9142,9 +9142,12 @@ Print lines centered around the beginning of function
>  @item list
>  Print more lines.  If the last lines printed were printed with a
>  @code{list} command, this prints lines following the last lines
> -printed; however, if the last line printed was a solitary line printed
> +printed; however, if those lines are past the end of the source
> +file, or if the last line printed was a solitary line printed
>  as part of displaying a stack frame (@pxref{Stack, ,Examining the
> -Stack}), this prints lines centered around that line.
> +Stack}), this prints lines centered around that line. If no
                                                       ^^
Two spaces there, please.

> +@code{list} command has been used and no solitary line was printed,
> +it prints the lines around the function @code{main}.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>

  reply	other threads:[~2023-06-20 16:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 15:52 [PATCH v2 0/4] Small changes to "list" command Bruno Larsen
2023-06-20 15:52 ` [PATCH v2 1/4] gdb/cli: Factor out code to list lines for the first time Bruno Larsen
2023-06-20 15:52 ` [PATCH v2 2/4] gdb/cli: Improve UX when using list with no args Bruno Larsen
2023-06-20 16:19   ` Eli Zaretskii [this message]
2023-06-20 15:52 ` [PATCH v2 3/4] gdb/cli: add '.' as an argument for 'list' command Bruno Larsen
2023-06-20 16:22   ` Eli Zaretskii
2023-06-20 15:53 ` [PATCH v2 4/4] gdb/doc: document '+' " Bruno Larsen
2023-06-20 16:20   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mt0u5cof.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).