public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: gdb-patches@sourceware.org, Tom Tromey <tom@tromey.com>,
	Guinevere Larsen <blarsen@redhat.com>
Subject: Re: [PATCH v3] gdb: Modify the output of "info breakpoints" and "delete breakpoints"
Date: Mon, 19 Feb 2024 12:54:13 -0700	[thread overview]
Message-ID: <20240219125413.590cbf7f@f39-zbm-amd> (raw)
In-Reply-To: <20240219075230.23058-1-yangtiezhu@loongson.cn>

On Mon, 19 Feb 2024 15:52:30 +0800
Tiezhu Yang <yangtiezhu@loongson.cn> wrote:

> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index 5f05657a8b3..8215290a13c 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -7080,9 +7080,9 @@ breakpoint_1 (const char *bp_num_list, bool show_internal,
>        if (!filter)
>  	{
>  	  if (bp_num_list == NULL || *bp_num_list == '\0')
> -	    uiout->message ("No breakpoints or watchpoints.\n");
> +	    uiout->message ("No breakpoints, watchpoints, tracepoints, or catchpoints.\n");

The GDB coding standard specifies an 80 column limit for all source
files except for .exp files.  Therefore, I suggest breaking the line
above as follows:

	    uiout->message ("No breakpoints, watchpoints, tracepoints, "
			    "or catchpoints.\n");

The coding standard can be found here:

https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards

>  	  else
> -	    uiout->message ("No breakpoint or watchpoint matching
> '%s'.\n",
> +	    uiout->message ("No breakpoint, watchpoint, tracepoint,
> or catchpoint matching '%s'.\n", bp_num_list);

Likewise, with respect to line length.

[...]
> @@ -12711,7 +12711,7 @@ delete_command (const char *arg, int from_tty)
>  
>        /* Ask user only if there are some breakpoints to delete.  */
>        if (!from_tty
> -	  || (breaks_to_delete && query (_("Delete all breakpoints? "))))
> +	  || (breaks_to_delete && query (_("Delete all breakpoints, watchpoints, tracepoints, and catchpoints? "))))

Likewise.  (For this one, you might also consider moving the '&&...'
portion to a new line.)

[...]
> @@ -14830,7 +14830,7 @@ This command may be abbreviated \"disable\"."),
>  Delete all or some breakpoints.\n\
>  Usage: delete [BREAKPOINTNUM]...\n\
>  Arguments are breakpoint numbers with spaces in between.\n\
> -To delete all breakpoints, give no argument.\n\
> +To delete all breakpoints, watchpoints, tracepoints, and catchpoints, give no argument.\n\

I think Eli mentioned this one in his review.  This line needs to be
split so that it's no longer than 80 characters.

>  \n\
>  Also a prefix command for deletion of other GDB objects."),
>  		      &deletelist, 1, &cmdlist);
> @@ -14841,7 +14841,7 @@ Also a prefix command for deletion of other GDB objects."),
>  Delete all or some breakpoints or auto-display expressions.\n\
>  Usage: delete breakpoints [BREAKPOINTNUM]...\n\
>  Arguments are breakpoint numbers with spaces in between.\n\
> -To delete all breakpoints, give no argument.\n\
> +To delete all breakpoints, watchpoints, tracepoints, and catchpoints, give no argument.\n\

Likewise.

> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo

I'm skipping the texinfo file since that's Eli's area...

[...]
> diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
> index 0adaa6dbed6..52057c25f89 100644
> --- a/gdb/ppc-linux-nat.c
> +++ b/gdb/ppc-linux-nat.c
> @@ -2358,7 +2358,7 @@ ppc_linux_nat_target::can_use_watchpoint_cond_accel (void)
>  
>    auto process_it = m_process_info.find (inferior_ptid.pid ());
>  
> -  /* No breakpoints or watchpoints have been requested for this process,
> +  /* No breakpoints, watchpoints, tracepoints, or catchpoints have been requested for this process,
>       we have at least one free DVC register.  */

Adjust this comment so that the it doesn't exceed the 80 column limit.

[...]
> diff --git a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
> index e2c89b879ad..84b3806d234 100644
> --- a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
> +++ b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
> @@ -76,7 +76,7 @@ gdb_test_multiple "watch gap1" "$test" {
>  gdb_test "delete" \
>      "" \
>      "delete all watchpoints" \
> -    {Delete all breakpoints\? \(y or n\) $} \
> +    {Delete all breakpoints, watchpoints, tracepoints, and catchpoints\? \(y or n\) $} \

FYI, things like this are okay since they're in .exp files.  But if you see
a way to shorten it without making it less readable, I encourage you to do
so.

I won't comment on the other long lines in .exp files...

Kevin


      parent reply	other threads:[~2024-02-19 19:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19  7:52 Tiezhu Yang
2024-02-19 12:46 ` Eli Zaretskii
2024-02-19 19:54 ` Kevin Buettner [this message]

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=20240219125413.590cbf7f@f39-zbm-amd \
    --to=kevinb@redhat.com \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    --cc=yangtiezhu@loongson.cn \
    /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).