public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Don't use ensure_gdb_index with require
Date: Fri, 13 Jan 2023 20:33:56 +0000 (GMT)	[thread overview]
Message-ID: <20230113203356.378433858425@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=15bdcf4ca1514b89c242eccd3a74599bdd00e3e0

commit 15bdcf4ca1514b89c242eccd3a74599bdd00e3e0
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Dec 14 17:04:35 2022 -0700

    Don't use ensure_gdb_index with require
    
    This series changes 'require' to take a list of simple predicates.
    This patch backs out the one use of 'require' that doesn't conform to
    this -- calling ensure_gdb_index.

Diff:
---
 gdb/testsuite/gdb.base/with-mf.exp                    | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp    | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-add-index.exp            | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp   | 5 ++++-
 gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp | 5 ++++-
 gdb/testsuite/gdb.rust/dwindex.exp                    | 5 ++++-
 6 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/with-mf.exp b/gdb/testsuite/gdb.base/with-mf.exp
index c16027b6f18..f26d48e1026 100644
--- a/gdb/testsuite/gdb.base/with-mf.exp
+++ b/gdb/testsuite/gdb.base/with-mf.exp
@@ -24,7 +24,10 @@ if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart $binfile
 
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
index e65cc88e427..d8ed180e31b 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -29,7 +29,10 @@ with_test_prefix non-symlink {
 	return -1
     }
 
-    require {ensure_gdb_index $binfile} != -1
+    if { [ensure_gdb_index $binfile] == -1 } {
+	untested "error adding gdb index"
+	return -1
+    }
 }
 
 # Regenerate exec without index.
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
index 12dc2c3d2d7..248bb28aabf 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
@@ -27,7 +27,10 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 # Ok, we have a copy of $binfile with an index.
 # Restart gdb and verify the index was used.
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
index fc85795b996..2c9f037a80e 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
@@ -24,7 +24,10 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-require {ensure_gdb_index $binfile} == 1
+if { [ensure_gdb_index $binfile] != 1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart ${binfile}
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
index 92573034b9b..09c26ebaaf5 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
@@ -74,7 +74,10 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart ${binfile}
 
diff --git a/gdb/testsuite/gdb.rust/dwindex.exp b/gdb/testsuite/gdb.rust/dwindex.exp
index 306a7e7b246..4f05cb9eca8 100644
--- a/gdb/testsuite/gdb.rust/dwindex.exp
+++ b/gdb/testsuite/gdb.rust/dwindex.exp
@@ -26,7 +26,10 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
     return -1
 }
 
-require {ensure_gdb_index $binfile -dwarf-5} != -1
+if {[ensure_gdb_index $binfile -dwarf-5] == -1} {
+    untested "error adding gdb index"
+    return -1
+}
 
 gdb_exit
 gdb_start

                 reply	other threads:[~2023-01-13 20:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230113203356.378433858425@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@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).