From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 556A53858403 for ; Tue, 18 Oct 2022 13:33:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 556A53858403 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8E05033E59 for ; Tue, 18 Oct 2022 13:33:29 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7AD44139D2 for ; Tue, 18 Oct 2022 13:33:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mPHvHCmrTmNPHwAAMHmgww (envelope-from ) for ; Tue, 18 Oct 2022 13:33:29 +0000 From: Tom de Vries 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 Message-Id: <20221018133328.7574-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221018133328.7574-1-tdevries@suse.de> References: <20221018133328.7574-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2022 13:34:40 -0000 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 . */ +#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 . */ +#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