From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by sourceware.org (Postfix) with ESMTPS id 074073858289 for ; Sat, 15 Apr 2023 15:13:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 074073858289 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw13.mail.unifiedlayer.com (unknown [10.0.90.128]) by progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id AD708100483DC for ; Sat, 15 Apr 2023 15:13:44 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id nhayp0QCWNX2anhaypdFwd; Sat, 15 Apr 2023 15:13:44 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=NMAQR22g c=1 sm=1 tr=0 ts=643abf28 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=dKHAf1wccvYA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=NEAV23lmAAAA:8 a=44wLcLznSzQ9Nl_H1qsA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qJ0ppDvYEMqMS/Dc3UxU1cKcprkpY4ckXUMB35pSbBQ=; b=L/dacOpMVAcOxDlppI58Z8Vn9z 0bJ0rVS9uPkfKaog1xCfFWMlC720PpaNTwjfLixuydJ+WiX7jcepvrd5qJowVTS/vxQnxDDgdn6e1 D9U0I1ugYD4STMZMzkz1r8I7j; Received: from 71-211-191-82.hlrn.qwest.net ([71.211.191.82]:43720 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pnhay-0021Ms-BL; Sat, 15 Apr 2023 09:13:44 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 5/5] Use "critical runto" in gdb.rust Date: Sat, 15 Apr 2023 09:13:36 -0600 Message-Id: <20230415151336.4104455-6-tom@tromey.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230415151336.4104455-1-tom@tromey.com> References: <20230415151336.4104455-1-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.191.82 X-Source-L: No X-Exim-ID: 1pnhay-0021Ms-BL X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-191-82.hlrn.qwest.net (localhost.localdomain) [71.211.191.82]:43720 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3025.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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::(23u32)" " = 23" gdb_test "ptype identity::(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