public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFC 5/5] Use "critical runto" in gdb.rust
Date: Sat, 15 Apr 2023 09:13:36 -0600	[thread overview]
Message-ID: <20230415151336.4104455-6-tom@tromey.com> (raw)
In-Reply-To: <20230415151336.4104455-1-tom@tromey.com>

This converts gdb.rust to use "critical runto" rather than "if".
---
 gdb/testsuite/gdb.rust/completion.exp  | 5 +----
 gdb/testsuite/gdb.rust/finish.exp      | 5 +----
 gdb/testsuite/gdb.rust/fnfield.exp     | 5 +----
 gdb/testsuite/gdb.rust/generics.exp    | 5 +----
 gdb/testsuite/gdb.rust/main-crash.exp  | 5 +----
 gdb/testsuite/gdb.rust/methods.exp     | 5 +----
 gdb/testsuite/gdb.rust/modules.exp     | 5 +----
 gdb/testsuite/gdb.rust/onetwoeight.exp | 5 +----
 gdb/testsuite/gdb.rust/pp.exp          | 5 +----
 gdb/testsuite/gdb.rust/rawids.exp      | 5 +----
 gdb/testsuite/gdb.rust/rust-style.exp  | 5 +----
 gdb/testsuite/gdb.rust/simple.exp      | 5 +----
 gdb/testsuite/gdb.rust/traits.exp      | 5 +----
 gdb/testsuite/gdb.rust/unicode.exp     | 5 +----
 gdb/testsuite/gdb.rust/union.exp       | 5 +----
 gdb/testsuite/gdb.rust/unsized.exp     | 5 +----
 gdb/testsuite/gdb.rust/watch.exp       | 5 +----
 17 files changed, 17 insertions(+), 68 deletions(-)

diff --git a/gdb/testsuite/gdb.rust/completion.exp b/gdb/testsuite/gdb.rust/completion.exp
index 91f8b230f4a..e49720bb1ac 100644
--- a/gdb/testsuite/gdb.rust/completion.exp
+++ b/gdb/testsuite/gdb.rust/completion.exp
@@ -25,9 +25,6 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "complete break pars" ".*"
diff --git a/gdb/testsuite/gdb.rust/finish.exp b/gdb/testsuite/gdb.rust/finish.exp
index 630b093b440..8dc114cefae 100644
--- a/gdb/testsuite/gdb.rust/finish.exp
+++ b/gdb/testsuite/gdb.rust/finish.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "BREAK"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 # This 'finish' used to crash.  See PR rust/30090.  Also, this does
 # not currently print the correct value, because rustc does not use
diff --git a/gdb/testsuite/gdb.rust/fnfield.exp b/gdb/testsuite/gdb.rust/fnfield.exp
index 93b00f11b8a..bd8aab6dd40 100644
--- a/gdb/testsuite/gdb.rust/fnfield.exp
+++ b/gdb/testsuite/gdb.rust/fnfield.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print foo.f()" " = 6" "call impl function"
 gdb_test "print (foo.f)()" " = 5" "call function field"
diff --git a/gdb/testsuite/gdb.rust/generics.exp b/gdb/testsuite/gdb.rust/generics.exp
index 9eba8f5786e..358fb31f465 100644
--- a/gdb/testsuite/gdb.rust/generics.exp
+++ b/gdb/testsuite/gdb.rust/generics.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print identity::<u32>(23u32)" " = 23"
 gdb_test "ptype identity::<u32>(23u32)" " = u32"
diff --git a/gdb/testsuite/gdb.rust/main-crash.exp b/gdb/testsuite/gdb.rust/main-crash.exp
index 450af9ed18c..621718c24f8 100644
--- a/gdb/testsuite/gdb.rust/main-crash.exp
+++ b/gdb/testsuite/gdb.rust/main-crash.exp
@@ -25,10 +25,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
 
 set line [gdb_get_line_number "BREAK"]
 # The bug was that this would crash.
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 # Test that gdb is alive.
 gdb_test "print 23" " = 23"
diff --git a/gdb/testsuite/gdb.rust/methods.exp b/gdb/testsuite/gdb.rust/methods.exp
index 67792986fad..7dd0b7807b1 100644
--- a/gdb/testsuite/gdb.rust/methods.exp
+++ b/gdb/testsuite/gdb.rust/methods.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint 1 here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print x" " = methods::HasMethods \\{value: 0\\}"
 
diff --git a/gdb/testsuite/gdb.rust/modules.exp b/gdb/testsuite/gdb.rust/modules.exp
index ddb9a05c58f..550e9ba3101 100644
--- a/gdb/testsuite/gdb.rust/modules.exp
+++ b/gdb/testsuite/gdb.rust/modules.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 # Currently a closure type is not described by rustc.
 # https://github.com/rust-lang/rust/issues/33121
diff --git a/gdb/testsuite/gdb.rust/onetwoeight.exp b/gdb/testsuite/gdb.rust/onetwoeight.exp
index ad536d27900..2fc4b499d46 100644
--- a/gdb/testsuite/gdb.rust/onetwoeight.exp
+++ b/gdb/testsuite/gdb.rust/onetwoeight.exp
@@ -30,10 +30,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "BREAK"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print x" " = 340282366920938463463374607431768211455"
 gdb_test "print y" " = 170141183460469231731687303715884105727"
diff --git a/gdb/testsuite/gdb.rust/pp.exp b/gdb/testsuite/gdb.rust/pp.exp
index 0f8fee20fb9..2fdc5b5f14b 100644
--- a/gdb/testsuite/gdb.rust/pp.exp
+++ b/gdb/testsuite/gdb.rust/pp.exp
@@ -29,10 +29,7 @@ set remote_python_file [gdb_remote_download host \
 gdb_test_no_output "source ${remote_python_file}" "load python file"
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print outer" " = pp::Outer \\(x\\(5\\)\\)"
 gdb_test "print outer.0" " = x\\(5\\)"
diff --git a/gdb/testsuite/gdb.rust/rawids.exp b/gdb/testsuite/gdb.rust/rawids.exp
index 0c9ecaabe32..09b71079ce6 100644
--- a/gdb/testsuite/gdb.rust/rawids.exp
+++ b/gdb/testsuite/gdb.rust/rawids.exp
@@ -25,10 +25,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print r#if" " = 23"
 gdb_test "print r#thread" " = 27"
diff --git a/gdb/testsuite/gdb.rust/rust-style.exp b/gdb/testsuite/gdb.rust/rust-style.exp
index 71a484ae933..cce5a78cd5d 100644
--- a/gdb/testsuite/gdb.rust/rust-style.exp
+++ b/gdb/testsuite/gdb.rust/rust-style.exp
@@ -28,10 +28,7 @@ save_vars { env(TERM) } {
 	{debug rust}
 
     set line [gdb_get_line_number "breakpoint"]
-    if {![runto ${srcfile}:$line]} {
-	untested "could not run to breakpoint"
-	return -1
-    }
+    critical runto ${srcfile}:$line
 
     set vfield [style value variable]
     set v2field [style value2 variable]
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index dd73f50af81..5b8a08814a8 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print a" " = \\(\\)"
 gdb_test "ptype a" " = \\(\\)"
diff --git a/gdb/testsuite/gdb.rust/traits.exp b/gdb/testsuite/gdb.rust/traits.exp
index a614065a129..fc06260bad9 100644
--- a/gdb/testsuite/gdb.rust/traits.exp
+++ b/gdb/testsuite/gdb.rust/traits.exp
@@ -36,10 +36,7 @@ if {![regexp DW_AT_containing_type $output]} {
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print *td" " = 23.5"
 gdb_test "print *tu" " = 23"
diff --git a/gdb/testsuite/gdb.rust/unicode.exp b/gdb/testsuite/gdb.rust/unicode.exp
index 8063d7ec1b9..9e5af414107 100644
--- a/gdb/testsuite/gdb.rust/unicode.exp
+++ b/gdb/testsuite/gdb.rust/unicode.exp
@@ -30,10 +30,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print 𝕯" " = 98" "print D"
 gdb_test "print \"𝕯\"" " = \"𝕯\"" "print D in string"
diff --git a/gdb/testsuite/gdb.rust/union.exp b/gdb/testsuite/gdb.rust/union.exp
index d4a12156f3e..1e65c664f59 100644
--- a/gdb/testsuite/gdb.rust/union.exp
+++ b/gdb/testsuite/gdb.rust/union.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "print u" " = union::Union {f1: -1, f2: 255}"
 
diff --git a/gdb/testsuite/gdb.rust/unsized.exp b/gdb/testsuite/gdb.rust/unsized.exp
index 61c671dce6a..275491e432a 100644
--- a/gdb/testsuite/gdb.rust/unsized.exp
+++ b/gdb/testsuite/gdb.rust/unsized.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 gdb_test "ptype us" " = .*V<\\\[u8\\\]>.*"
 
diff --git a/gdb/testsuite/gdb.rust/watch.exp b/gdb/testsuite/gdb.rust/watch.exp
index f9bf6ad2269..c4170b2a248 100644
--- a/gdb/testsuite/gdb.rust/watch.exp
+++ b/gdb/testsuite/gdb.rust/watch.exp
@@ -24,10 +24,7 @@ critical prepare_for_testing "failed to prepare" $testfile $srcfile \
     {debug rust}
 
 set line [gdb_get_line_number "set breakpoint here"]
-if {![runto ${srcfile}:$line]} {
-    untested "could not run to breakpoint"
-    return -1
-}
+critical runto ${srcfile}:$line
 
 # Just setting a watchpoint was enough to trigger the bug.
 gdb_test "watch -location y" ".*\[wW\]atchpoint .* -location .*"
-- 
2.39.2


      parent reply	other threads:[~2023-04-15 15:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-15 15:13 [RFC 0/5] Add new "critical" command to test suite Tom Tromey
2023-04-15 15:13 ` [RFC 1/5] Bug fix in prepare_for_testing Tom Tromey
2023-04-15 15:13 ` [RFC 2/5] Introduce the "critical" testsuite command Tom Tromey
2023-04-15 23:35   ` Kevin Buettner
2023-04-15 15:13 ` [RFC 3/5] Use "critical ensure_gdb_index" in gdb.rust Tom Tromey
2023-04-15 15:13 ` [RFC 4/5] Use "critical prepare_for_testing" " Tom Tromey
2023-04-15 15:13 ` Tom Tromey [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=20230415151336.4104455-6-tom@tromey.com \
    --to=tom@tromey.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).