public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: breakpoint: Add "tracepoint" when report empty list
@ 2022-05-14  8:09 Tiezhu Yang
  2022-05-18 13:23 ` Bruno Larsen
  0 siblings, 1 reply; 3+ messages in thread
From: Tiezhu Yang @ 2022-05-14  8:09 UTC (permalink / raw)
  To: gdb-patches

The output of "info breakpoints" includes breakpoint, watchpoint and
tracepoint, after delete all breakpoints, it should show "tracepoint"
in the output of "info breakpoints" to report empty list.

$ 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) 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
(gdb) delete breakpoints
Delete all breakpoints? (y or n) y

Without this patch:

(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) info breakpoints 3
No breakpoint or watchpoint matching '3'.

With this patch:

(gdb) info breakpoints
No breakpoints, watchpoints or tracepoints.
(gdb) info breakpoints 3
No breakpoint, watchpoint or tracepoint matching '3'.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 gdb/breakpoint.c                                   | 4 ++--
 gdb/ppc-linux-nat.c                                | 2 +-
 gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp | 2 +-
 gdb/testsuite/gdb.base/default.exp                 | 2 +-
 gdb/testsuite/gdb.base/del.exp                     | 4 ++--
 gdb/testsuite/gdb.base/ena-dis-br.exp              | 2 +-
 gdb/testsuite/gdb.base/hbreak-unmapped.exp         | 2 +-
 gdb/testsuite/gdb.base/server-del-break.exp        | 2 +-
 gdb/testsuite/gdb.cp/ovldbreak.exp                 | 2 +-
 gdb/testsuite/gdb.guile/scm-breakpoint.exp         | 6 +++---
 gdb/testsuite/gdb.python/py-breakpoint.exp         | 6 +++---
 gdb/testsuite/lib/gdb.exp                          | 2 +-
 gdb/testsuite/lib/mi-support.exp                   | 4 ++--
 13 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 9abc144..a8568c7 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6741,9 +6741,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 or tracepoints.\n");
 	  else
-	    uiout->message ("No breakpoint or watchpoint matching '%s'.\n",
+	    uiout->message ("No breakpoint, watchpoint or tracepoint matching '%s'.\n",
 			    bp_num_list);
 	}
     }
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 588dd7d..45b8116 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -2360,7 +2360,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 or tracepoints have been requested for this process,
      we have at least one free DVC register.  */
   if (process_it == m_process_info.end ())
     return true;
diff --git a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
index a3b654b..705f2d0 100644
--- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
+++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
@@ -237,7 +237,7 @@ proc test_single_step { always_inserted auto_hw } {
     }
 
     gdb_test "maint info breakpoints 0" \
-	"No breakpoint or watchpoint matching '0'\." \
+	"No breakpoint, watchpoint or tracepoint matching '0'\." \
 	"single-step breakpoint is not left behind"
 
     # Confirm the thread really advanced.
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index f7859c9..75bdb58 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -267,7 +267,7 @@ gdb_test "info args" "No frame selected."
 #test info bogus-gdb-command
 gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\".  Try \"help info\".*"
 #test info breakpoints
-gdb_test "info breakpoints" "No breakpoints or watchpoints."
+gdb_test "info breakpoints" "No breakpoints, watchpoints or tracepoints."
 #test info copying
 # FIXME -- doesn't work worth a shit
 #send_gdb "info copying"
diff --git a/gdb/testsuite/gdb.base/del.exp b/gdb/testsuite/gdb.base/del.exp
index 29ab5f5..3267c0e 100644
--- a/gdb/testsuite/gdb.base/del.exp
+++ b/gdb/testsuite/gdb.base/del.exp
@@ -35,7 +35,7 @@ proc test_delete_alias { alias } {
              "remove all breakpoints"
 
     gdb_test "info break" \
-             "No breakpoints or watchpoints." \
+             "No breakpoints, watchpoints or tracepoints." \
              "info break after clearing breakpoints"
 
 
@@ -50,7 +50,7 @@ proc test_delete_alias { alias } {
              "Remove last breakpoint"
 
     gdb_test "info break" \
-             "No breakpoints or watchpoints." \
+             "No breakpoints, watchpoints or tracepoints." \
              "info break after removing break on main"
 }
 
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index 24925cf..a9b52d8 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -133,7 +133,7 @@ gdb_test "continue" \
     "continue to auto-deleted break marker3"
 
 gdb_test "info break $bp" \
-    ".*No breakpoint or watchpoint matching.*" \
+    ".*No breakpoint, watchpoint or tracepoint matching.*" \
     "info auto-deleted break marker3"
 
 # Verify that we can set a breakpoint and manually disable it (we've
diff --git a/gdb/testsuite/gdb.base/hbreak-unmapped.exp b/gdb/testsuite/gdb.base/hbreak-unmapped.exp
index 7e6d1cb..ab943a3 100644
--- a/gdb/testsuite/gdb.base/hbreak-unmapped.exp
+++ b/gdb/testsuite/gdb.base/hbreak-unmapped.exp
@@ -73,5 +73,5 @@ gdb_test "info break" "hw breakpoint.*y.*0x0\+\[ \t\]\+" \
 gdb_test_no_output "delete \$bpnum" "" "delete" \
     "delete hw breakpoint"
 
-gdb_test "info break" "No breakpoints or watchpoints\." \
+gdb_test "info break" "No breakpoints, watchpoints or tracepoints\." \
     "info break shows no breakpoints"
diff --git a/gdb/testsuite/gdb.base/server-del-break.exp b/gdb/testsuite/gdb.base/server-del-break.exp
index 9a8b6f8..d15a35a 100644
--- a/gdb/testsuite/gdb.base/server-del-break.exp
+++ b/gdb/testsuite/gdb.base/server-del-break.exp
@@ -35,4 +35,4 @@ gdb_test_no_output "server delete breakpoints"
 
 # Double-check that the all breakpoints were in fact deleted.
 gdb_test "info break" \
-         "No breakpoints or watchpoints."
+         "No breakpoints, watchpoints or tracepoints."
diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp
index 2fc650e..39998d5 100644
--- a/gdb/testsuite/gdb.cp/ovldbreak.exp
+++ b/gdb/testsuite/gdb.cp/ovldbreak.exp
@@ -277,7 +277,7 @@ gdb_expect {
     }
 }
 
-gdb_test "info breakpoints" "No breakpoints or watchpoints." "breakpoint info (after delete)"
+gdb_test "info breakpoints" "No breakpoints, watchpoints or tracepoints." "breakpoint info (after delete)"
 
 
 
diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp
index 37607b7..26f5b49 100644
--- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp
+++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp
@@ -225,7 +225,7 @@ proc_with_prefix test_bkpt_invisible { } {
     gdb_test "guile (print (breakpoint-visible? ibp))" \
 	"= #f" "check breakpoint invisibility"
     gdb_test "info breakpoints" \
-	"No breakpoints or watchpoints.*" \
+	"No breakpoints, watchpoints or tracepoints.*" \
 	"check info breakpoints does not show invisible breakpoints"
     gdb_test "maint info breakpoints" \
 	"scm-breakpoint\.c:$ibp_location.*" \
@@ -288,7 +288,7 @@ proc_with_prefix test_bkpt_internal { } {
     gdb_scm_test_silent_cmd "guile (register-breakpoint! wp1)" \
 	"register wp1"
     gdb_test "info breakpoints" \
-	"No breakpoints or watchpoints.*" \
+	"No breakpoints, watchpoints or tracepoints.*" \
 	"check info breakpoints does not show invisible watchpoint"
     gdb_test "maint info breakpoints" \
 	".*watchpoint.*result.*" \
@@ -512,7 +512,7 @@ proc_with_prefix test_bkpt_temporary { } {
 	".*$srcfile:$ibp_location.*"
     gdb_test "guile (print (breakpoint-temporary? ibp))" "Invalid object: <gdb:breakpoint>.*" \
 	"check temporary breakpoint is deleted after being hit"
-    gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \
+    gdb_test "info breakpoints" "No breakpoints, watchpoints or tracepoints.*" \
 	"check info breakpoints shows temporary breakpoint is deleted"
 }
 
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp
index 58b1af3..e3152d7 100644
--- a/gdb/testsuite/gdb.python/py-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-breakpoint.exp
@@ -241,7 +241,7 @@ proc_with_prefix test_bkpt_invisible { } {
 	"py-breakpoint\.c:$ibp_location*" "Check breakpoint location 2"
     gdb_test "python print (ilist\[0\].visible)" \
 	"False" "Check breakpoint visibility 2"
-    gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \
+    gdb_test "info breakpoints" "No breakpoints, watchpoints or tracepoints.*" \
 	"Check info breakpoints does not show invisible breakpoints"
     gdb_test "maint info breakpoints" \
 	"py-breakpoint\.c:$ibp_location.*" \
@@ -313,7 +313,7 @@ proc_with_prefix test_bkpt_internal { } {
     gdb_py_test_silent_cmd  "python wp1 = gdb.Breakpoint (\"result\", type=gdb.BP_WATCHPOINT, wp_class=gdb.WP_WRITE, internal=True )" \
 	"Set watchpoint" 0
     gdb_test "info breakpoints" \
-	"No breakpoints or watchpoints.*" \
+	"No breakpoints, watchpoints or tracepoints.*" \
 	"Check info breakpoints does not show invisible breakpoints"
     gdb_test "maint info breakpoints" \
 	".*watchpoint.*result.*" \
@@ -475,7 +475,7 @@ proc_with_prefix test_bkpt_temporary { } {
 	"Check temporary stop callback executed before deletion."
     gdb_test "python print (ibp.temporary)" "RuntimeError: Breakpoint 2 is invalid.*" \
 	"Check temporary breakpoint is deleted after being hit"
-    gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \
+    gdb_test "info breakpoints" "No breakpoints, watchpoints or tracepoints.*" \
 	"Check info breakpoints shows temporary breakpoint is deleted"
 }
 
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 47cb2b2..c39cb3b 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -322,7 +322,7 @@ proc delete_breakpoints {} {
 	set deleted 0
 	set msg "info breakpoints"
 	gdb_test_multiple $msg $msg {
-	    -re "No breakpoints or watchpoints..*$gdb_prompt $" {
+	    -re "No breakpoints, watchpoints or tracepoints..*$gdb_prompt $" {
 		set deleted 1
 	    }
 	    -re "$gdb_prompt $" {
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index e578a7e..6fd5c05 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -374,13 +374,13 @@ proc mi_delete_breakpoints {} {
 	 timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return }
     }
 
-# The correct output is not "No breakpoints or watchpoints." but an
+# The correct output is not "No breakpoints, watchpoints or tracepoints." but an
 # empty BreakpointTable. Also, a query is not acceptable with mi.
     send_gdb "103-break-list\n"
     gdb_expect 30 {
 	 -re "103-break-list\r\n103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {}
 	 -re "103-break-list\r\n103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}\r\n$mi_gdb_prompt$" {}
-	 -re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
+	 -re "103-break-list\r\n103\\\^doneNo breakpoints, watchpoints or tracepoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
 	 -re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return }
 	 -re "Delete all breakpoints.*or n.*$" {
 	    warning "Unexpected prompt for breakpoints deletion"
-- 
2.1.0


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

end of thread, other threads:[~2022-05-19  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-14  8:09 [PATCH] gdb: breakpoint: Add "tracepoint" when report empty list Tiezhu Yang
2022-05-18 13:23 ` Bruno Larsen
2022-05-19  8:40   ` Tiezhu Yang

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