From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Prepare nodebug exec in gdb.base/cvexpr.exp
Date: Thu, 30 Sep 2021 19:09:35 +0200 [thread overview]
Message-ID: <20210930170932.GA25085@delia> (raw)
Hi,
When running test-case gdb.base/cvexpr.exp with target board unix/-bad, I get:
...
gdb compile failed, gcc: error: unrecognized command line option '-bad'
ERROR: tcl error sourcing src/gdb/testsuite/gdb.base/cvexpr.exp.
ERROR: can't read "use_gdb_stub": no such variable
...
This is triggered in a part of the test that claims to require no debug
information, but uses the exec containing either dwarf or ctf.
Fix this by preparing another executable compiled with nodebug, and using
that one instead.
Also use with_test_prefix to mark the nodebug part, such that we have:
...
gdb compile failed, gcc: error: unrecognized command line option '-bad'
UNTESTED: gdb.base/cvexpr.exp: dwarf: failed to prepare
gdb compile failed, gcc: error: unrecognized command line option '-bad'
UNTESTED: gdb.base/cvexpr.exp: nodebug: failed to prepare
...
Tested on x86_64-linux.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Prepare nodebug exec in gdb.base/cvexpr.exp
---
gdb/testsuite/gdb.base/cvexpr.exp | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp
index 33ae1be0322..f9bb467b4f7 100644
--- a/gdb/testsuite/gdb.base/cvexpr.exp
+++ b/gdb/testsuite/gdb.base/cvexpr.exp
@@ -509,14 +509,20 @@ foreach testspec $specs {
}
# These tests don't rely on the debug format.
-gdb_test "ptype _Atomic int" "type = _Atomic int"
-gdb_test "ptype int * restrict" "type = int \\* restrict"
+with_test_prefix nodebug {
+ if { [prepare_for_testing "failed to prepare" $binfile $srcfile {nodebug}] } {
+ return 0
+ }
-# C++ does not have "restrict".
-gdb_test_no_output "set lang c++"
-with_test_prefix c++ {
- gdb_test "ptype int * restrict" "A syntax error in expression.*"
+ gdb_test "ptype _Atomic int" "type = _Atomic int"
+ gdb_test "ptype int * restrict" "type = int \\* restrict"
- # There is a GCC extension for __restrict__, though.
- gdb_test "ptype int * __restrict__" "type = int \\* __restrict__"
+ # C++ does not have "restrict".
+ gdb_test_no_output "set lang c++"
+ with_test_prefix c++ {
+ gdb_test "ptype int * restrict" "A syntax error in expression.*"
+
+ # There is a GCC extension for __restrict__, though.
+ gdb_test "ptype int * __restrict__" "type = int \\* __restrict__"
+ }
}
reply other threads:[~2021-09-30 17:10 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=20210930170932.GA25085@delia \
--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