Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: gdb-patches@sourceware.org, kevinb@redhat.com, tom@tromey.com,
	blarsen@redhat.com
Subject: Re: [PATCH v3] gdb: Modify the output of "info breakpoints" and "delete breakpoints"
Date: Mon, 19 Feb 2024 14:46:59 +0200	[thread overview]
Message-ID: <86v86kpqnw.fsf@gnu.org> (raw)
In-Reply-To: <20240219075230.23058-1-yangtiezhu@loongson.cn> (message from Tiezhu Yang on Mon, 19 Feb 2024 15:52:30 +0800)

> From: Tiezhu Yang <yangtiezhu@loongson.cn>
> Cc: Kevin Buettner <kevinb@redhat.com>, Tom Tromey <tom@tromey.com>,
>  Bruno Larsen <blarsen@redhat.com>
> Date: Mon, 19 Feb 2024 15:52:30 +0800
> 
> The output of "info breakpoints" includes breakpoint, watchpoint,
> tracepoint, and catchpoint if they are created, so it should show
> all the four types are deleted in the output of "info breakpoints"
> to report empty list after "delete breakpoints".
> 
> It should also change the output of "delete breakpoints" to make it
> clear that watchpoints, tracepoints, and catchpoints are also being
> deleted. This is suggested by Bruno Larsen, thank you.
> 
> $ make check-gdb TESTS="gdb.base/access-mem-running.exp"
> $ gdb/gdb gdb/testsuite/outputs/gdb.base/access-mem-running/access-mem-running
> [...]
> (gdb) break main
> Breakpoint 1 at 0x12000073c: file /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c, line 32.
> (gdb) watch global_counter
> Hardware watchpoint 2: global_counter
> (gdb) trace maybe_stop_here
> Tracepoint 3 at 0x12000071c: file /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c, line 27.
> (gdb) catch fork
> Catchpoint 4 (fork)
> (gdb) info breakpoints
> Num     Type           Disp Enb Address            What
> 1       breakpoint     keep y   0x000000012000073c in main at /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c:32
> 2       hw watchpoint  keep y                      global_counter
> 3       tracepoint     keep y   0x000000012000071c in maybe_stop_here at /home/loongson/gdb.git/gdb/testsuite/gdb.base/access-mem-running.c:27
> 	not installed on target
> 4       catchpoint     keep y                      fork
> 
> Without this patch:
> 
> (gdb) delete breakpoints
> Delete all breakpoints? (y or n) y
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) info breakpoints 3
> No breakpoint or watchpoint matching '3'.
> 
> With this patch:
> 
> (gdb) delete breakpoints
> Delete all breakpoints, watchpoints, tracepoints, and catchpoints? (y or n) y
> (gdb) info breakpoints
> No breakpoints, watchpoints, tracepoints, or catchpoints.
> (gdb) info breakpoints 3
> No breakpoint, watchpoint, tracepoint, or catchpoint matching '3'.

Thanks.

> @@ -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\

Please make the lines in the documentation strings shorter than 80
columns, so they don't wrap.

> @@ -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,

> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -4343,7 +4343,7 @@ running or not, what process it is, and why it stopped.
>  @end table
>  
>  @menu
> -* Breakpoints::                 Breakpoints, watchpoints, and catchpoints
> +* Breakpoints::                 Breakpoints, watchpoints, tracepoints, and catchpoints

Here, please wrap the part after the comma to the next line.

> @@ -5650,10 +5650,10 @@ in @ref{Location Specifications}.
>  @kindex delete
>  @kindex d @r{(@code{delete})}
>  @item delete @r{[}breakpoints@r{]} @r{[}@var{list}@dots{}@r{]}
> -Delete the breakpoints, watchpoints, or catchpoints of the breakpoint
> -list specified as argument.  If no argument is specified, delete all
> -breakpoints (@value{GDBN} asks confirmation, unless you have @code{set
> -confirm off}).  You can abbreviate this command as @code{d}.
> +Delete the breakpoints, watchpoints, tracepoints, or catchpoints of the breakpoint
> +list specified as argument.  If no argument is specified, delete all breakpoints,
> +watchpoints, tracepoints, and catchpoints (@value{GDBN} asks confirmation, unless
> +you have @code{set confirm off}).  You can abbreviate this command as @code{d}.

Please break the long lines so that they are shorter than 70 columns.

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

  reply	other threads:[~2024-02-19 12:47 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 [this message]
2024-02-19 19:54 ` Kevin Buettner

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=86v86kpqnw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --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