Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Use require for ensure_gdb_index
Date: Mon, 11 Oct 2021 12:29:29 +0200	[thread overview]
Message-ID: <20211011102927.GA21678@delia.home> (raw)

Hi,

Replace:
...
if { [ensure_gdb_index $binfile] == -1 } {
    return -1
}
...
with:
...
require {ensure_gdb_index $binfile} != -1
...
and consequently, add a missing UNTESTED message.

Tested on x86_64-linux, both with native and target board readnow.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Use require for ensure_gdb_index

---
 gdb/testsuite/gdb.base/with-mf.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp    | 4 +---
 gdb/testsuite/gdb.dwarf2/gdb-add-index.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp | 4 +---
 gdb/testsuite/gdb.rust/dwindex.exp                    | 4 +---
 gdb/testsuite/lib/gdb.exp                             | 4 ++++
 6 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/gdb/testsuite/gdb.base/with-mf.exp b/gdb/testsuite/gdb.base/with-mf.exp
index d0667b31183..a0f5b279f2d 100644
--- a/gdb/testsuite/gdb.base/with-mf.exp
+++ b/gdb/testsuite/gdb.base/with-mf.exp
@@ -24,9 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
     return -1
 }
 
-if { [ensure_gdb_index $binfile] == -1 } {
-    return -1
-}
+require {ensure_gdb_index $binfile} != -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 74c558ad231..3f09aa8719b 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -29,9 +29,7 @@ with_test_prefix non-symlink {
 	return -1
     }
 
-    if { [ensure_gdb_index $binfile] == -1 } {
-	return -1
-    }
+    require {ensure_gdb_index $binfile} != -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 2a83eb1ac23..17c278e8af1 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
@@ -27,9 +27,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-if { [ensure_gdb_index $binfile] == -1 } {
-    return -1
-}
+require {ensure_gdb_index $binfile} != -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/imported-unit-runto-main.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
index 9034f4c0085..b3a7005a834 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
@@ -74,9 +74,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if { [ensure_gdb_index $binfile] == -1 } {
-    return -1
-}
+require {ensure_gdb_index $binfile} != -1
 
 clean_restart ${binfile}
 
diff --git a/gdb/testsuite/gdb.rust/dwindex.exp b/gdb/testsuite/gdb.rust/dwindex.exp
index 1bc61993240..07de0b4b2a5 100644
--- a/gdb/testsuite/gdb.rust/dwindex.exp
+++ b/gdb/testsuite/gdb.rust/dwindex.exp
@@ -26,9 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
     return -1
 }
 
-if {[ensure_gdb_index $binfile "-dwarf-5"] == -1} {
-    return -1
-}
+require {ensure_gdb_index $binfile -dwarf-5} != -1
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index c2e6595f594..90131fe4ee7 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -8247,6 +8247,10 @@ proc require { fn arg1 {arg2 ""} } {
 
     switch "$fn $op $val" {
 	"gdb_skip_xml_test == 0" { set msg "missing xml support" }
+	"ensure_gdb_index $binfile != -1" -
+	"ensure_gdb_index $binfile -dwarf-5 != -1" {
+	    set msg "Couldn't ensure index in binfile"
+	}
 	default { set msg "$fn != $val" }
     }
 

                 reply	other threads:[~2021-10-11 10:30 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=20211011102927.GA21678@delia.home \
    --to=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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