From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/4] [gdb/testsuite] Fix gdb.base/return-nodebug.exp with local-remote-host.exp
Date: Tue, 18 Oct 2022 15:33:26 +0200 [thread overview]
Message-ID: <20221018133328.7574-3-tdevries@suse.de> (raw)
In-Reply-To: <20221018133328.7574-1-tdevries@suse.de>
With host board local-remote-host.exp and test-case
gdb.base/return-nodebug.exp, I run into:
...
Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never \
-DTYPE=signed\ char -c -g -o return-nodebug-signed-char0.o \
/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.base/return-nodebug.c \
(timeout = 300)
builtin_spawn [open ...]^M
gcc: error: char: No such file or directory
...
Avoid the quoting problem by not using spaces in the define.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.base/return-nodebug.c | 8 ++++++++
gdb/testsuite/gdb.base/return-nodebug.exp | 18 ++++++++++++------
gdb/testsuite/gdb.base/return-nodebug1.c | 8 ++++++++
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/gdb/testsuite/gdb.base/return-nodebug.c b/gdb/testsuite/gdb.base/return-nodebug.c
index a5ec060207a..358323aa2dd 100644
--- a/gdb/testsuite/gdb.base/return-nodebug.c
+++ b/gdb/testsuite/gdb.base/return-nodebug.c
@@ -15,6 +15,14 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef TYPE_NOSPACE_long_long
+#define TYPE long long
+#elif defined TYPE_NOSPACE_signed_char
+#define TYPE signed char
+#else
+#define TYPE TYPE_NOSPACE
+#endif
+
extern TYPE func (void);
static void
diff --git a/gdb/testsuite/gdb.base/return-nodebug.exp b/gdb/testsuite/gdb.base/return-nodebug.exp
index 1cce09d2fc4..331375d89f8 100644
--- a/gdb/testsuite/gdb.base/return-nodebug.exp
+++ b/gdb/testsuite/gdb.base/return-nodebug.exp
@@ -52,17 +52,23 @@ foreach type {{signed char} {short} {int} {long} {long long} {float} {double}} {
if { $skip_float_test && ($type == "float" || $type == "double") } {
continue
}
- set typeesc [string map {{ } {\ }} $type]
- set typenospace [string map {{ } -} $type]
+ set typenospace_dash \
+ [string map {{ } -} $type]
+ set typenospace_underscore \
+ [string map {{ } _} $type]
standard_testfile .c return-nodebug1.c
- set additional_flags "additional_flags=-DTYPE=$typeesc"
+ set additional_flags {}
+ lappend additional_flags \
+ additional_flags=-DTYPE_NOSPACE=$typenospace_underscore
+ lappend additional_flags \
+ additional_flags=-DTYPE_NOSPACE_$typenospace_underscore
if {[prepare_for_testing_full "failed to prepare" \
- [list ${testfile}-${typenospace} debug \
- $srcfile [list debug $additional_flags] \
- $srcfile2 [list $additional_flags]]]} {
+ [list ${testfile}-${typenospace_dash} debug \
+ $srcfile [concat {debug} $additional_flags] \
+ $srcfile2 $additional_flags]]} {
continue
}
diff --git a/gdb/testsuite/gdb.base/return-nodebug1.c b/gdb/testsuite/gdb.base/return-nodebug1.c
index bd32fc45d74..f2269e0dd2f 100644
--- a/gdb/testsuite/gdb.base/return-nodebug1.c
+++ b/gdb/testsuite/gdb.base/return-nodebug1.c
@@ -15,6 +15,14 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef TYPE_NOSPACE_long_long
+#define TYPE long long
+#elif defined TYPE_NOSPACE_signed_char
+#define TYPE signed char
+#else
+#define TYPE TYPE_NOSPACE
+#endif
+
TYPE
func (void)
{
--
2.35.3
next prev parent reply other threads:[~2022-10-18 13:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 13:33 [PATCH 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
2022-10-18 13:33 ` [PATCH 1/4] [gdb/testsuite] Fix gdb.server/file-transfer.exp with local-remote-host.exp Tom de Vries
2022-10-18 13:33 ` Tom de Vries [this message]
2022-10-18 13:33 ` [PATCH 3/4] [gdb/testsuite] Fix gdb.server/no-thread-db.exp " Tom de Vries
2022-10-18 13:33 ` [PATCH 4/4] [gdb/testsuite] Handle header files " Tom de Vries
2022-10-18 13:36 ` [pushed 0/4] [gdb/testsuite] Test-case fixes with local-remote-board Tom de Vries
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=20221018133328.7574-3-tdevries@suse.de \
--to=tdevries@suse.de \
--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).