public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Enze Li <enze.li@hotmail.com>
To: gdb-patches@sourceware.org
Cc: pedro@palves.net, enze.li@gmx.com
Subject: [PATCH 1/2] gdb/testsuite: move get_maint_bp_addr to gdb-utils.exp
Date: Sun, 19 Jun 2022 20:32:08 +0800	[thread overview]
Message-ID: <OS3P286MB2152775CA2B03841818CFECAF0B19@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM> (raw)

The get_maint_bp_addr procedure will be shared by other test suite, so
move it to gdb-utils.exp.
---
 gdb/testsuite/gdb.base/clear_non_user_bp.exp | 23 --------------------
 gdb/testsuite/lib/gdb-utils.exp              | 23 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/gdb/testsuite/gdb.base/clear_non_user_bp.exp b/gdb/testsuite/gdb.base/clear_non_user_bp.exp
index 26d7a31fa47..399a3a0f0dc 100644
--- a/gdb/testsuite/gdb.base/clear_non_user_bp.exp
+++ b/gdb/testsuite/gdb.base/clear_non_user_bp.exp
@@ -16,29 +16,6 @@
 # Regression test for PR gdb/7161.  Test that GDB cannot delete non-user
 # breakpoints with clear command.
 
-# get_maint_bp_addr num
-#
-# Purpose:
-#    Get address of the specified internal breakpoint when using command
-#    "maint info breakpoints $num".
-#
-# Parameter:
-#    The parameter "num" indicates the number of the internal breakpoint
-#    to get.  Note that this parameter must be a negative number.
-#    E.g., -1 means that we're gonna get the first internal breakpoint.
-#
-# Return:
-#    Internal breakpoint address.
-#
-proc get_maint_bp_addr { num } {
-    gdb_test_multiple "maint info break $num" "find address of internal bp $num" {
-	-re -wrap ".*(0x\[0-9a-f\]+).*" {
-	    return $expect_out(1,string)
-	}
-    }
-    return ""
-}
-
 # get_first_maint_bp_num
 #
 # Purpose:
diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp
index ffdfb75557c..bf2863722ce 100644
--- a/gdb/testsuite/lib/gdb-utils.exp
+++ b/gdb/testsuite/lib/gdb-utils.exp
@@ -72,3 +72,26 @@ proc style {str style} {
     }
     return "\033\\\[${style}m${str}\033\\\[m"
 }
+
+# get_maint_bp_addr num
+#
+# Purpose:
+#    Get address of the specified internal breakpoint when using command
+#    "maint info breakpoints $num".
+#
+# Parameter:
+#    The parameter "num" indicates the number of the internal breakpoint
+#    to get.  Note that this parameter must be a negative number.
+#    E.g., -1 means that we're gonna get the first internal breakpoint.
+#
+# Return:
+#    Internal breakpoint address.
+#
+proc get_maint_bp_addr { num } {
+    gdb_test_multiple "maint info break $num" "find address of internal bp $num" {
+	-re -wrap ".*(0x\[0-9a-f\]+).*" {
+	    return $expect_out(1,string)
+	}
+    }
+    return ""
+}
-- 
2.36.1


             reply	other threads:[~2022-06-19 12:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19 12:32 Enze Li [this message]
2022-06-19 12:33 ` [PATCH 2/2] gdb/testsuite: add a clear test to py-breakpoint.exp Enze Li
2022-06-21 16:21   ` Andrew Burgess
2022-06-23 13:29     ` Enze Li
2022-06-24 12:00       ` Andrew Burgess
2022-06-21 16:12 ` [PATCH 1/2] gdb/testsuite: move get_maint_bp_addr to gdb-utils.exp Andrew Burgess
2022-06-23 13:12   ` Enze Li

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=OS3P286MB2152775CA2B03841818CFECAF0B19@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM \
    --to=enze.li@hotmail.com \
    --cc=enze.li@gmx.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /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).