From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id X6IbMP7IPWFEeQAAWB0awg (envelope-from ) for ; Sun, 12 Sep 2021 05:31:42 -0400 Received: by simark.ca (Postfix, from userid 112) id A20E11EDDB; Sun, 12 Sep 2021 05:31:42 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 647D31EDDB for ; Sun, 12 Sep 2021 05:31:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 369283858015 for ; Sun, 12 Sep 2021 09:31:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 369283858015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631439099; bh=YZvMjtx3fyFzkIPCbo51JULlMlsUAJtZtvKpgJ2jJ5E=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gQwCCsD8q9b2TAKL38ktE/CCMBSP8SMAhGyrssvl9Hw/ZT7zO1p057zBE+6zxex// DfhZGn7CsghyDmc17/BcHuTvT6E1OTnfohDzc4MDO69WNQ5zLzRJ3eofBfY2Mj2jo6 wkE35P96IR8OFSZ8eAkxbs6ckn42UTlGlTfiYUTI= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id ECB893858408 for ; Sun, 12 Sep 2021 09:31:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ECB893858408 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 1CAE921B20 for ; Sun, 12 Sep 2021 09:31:19 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id EDA53132FD for ; Sun, 12 Sep 2021 09:31:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id mqBJOObIPWErXAAAGKfGzw (envelope-from ) for ; Sun, 12 Sep 2021 09:31:18 +0000 Date: Sun, 12 Sep 2021 11:31:17 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Set sysroot earlier in local-board.exp Message-ID: <20210912093115.GA8966@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.base/batch-exit-status.exp for native, it passes. But with target board cc-with-debug-names, we run into (added missing double quotes for clarity): ... builtin_spawn $build/gdb/testsuite/../../gdb/gdb -nw -nx \ -data-directory $build/gdb/testsuite/../data-directory \ -iex "set height 0" -iex "set width 0" -ex "set sysroot" -batch ""^M : No such file or directory.^M PASS: gdb.base/batch-exit-status.exp: \ : No such file or directory\.: [lindex $result 2] == 0 FAIL: gdb.base/batch-exit-status.exp: \ : No such file or directory\.: [lindex $result 3] == $expect_status ... The difference between the passing and failing case is that with native we have (leaving out set height/width for brevity): ... $ gdb -batch ""; echo $? : No such file or directory. 1 ... and with target board cc-with-debug-names: ... $ gdb -ex "set sysroot" -batch ""; echo $? : No such file or directory. 0 ... The difference is expected. GDB returns the exit status of the last executed command. In the former case that's 'file ""', which fails. In the latter case, that's 'set sysroot', which succeeds. Fix this by setting sysroot using -iex instead of -ex in local-board.exp, such that we have the expected: ... $ gdb -iex "set sysroot" -batch ""; echo $? : No such file or directory. 1 ... Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Set sysroot earlier in local-board.exp --- gdb/testsuite/boards/local-board.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/boards/local-board.exp b/gdb/testsuite/boards/local-board.exp index 6d78fa666eb..6523312b0cd 100644 --- a/gdb/testsuite/boards/local-board.exp +++ b/gdb/testsuite/boards/local-board.exp @@ -24,4 +24,4 @@ set baseboard [lindex [split $board "/"] 0] set board_info($baseboard,isremote) 0 # Set sysroot to avoid sending files via the remote protocol. -set GDBFLAGS "${GDBFLAGS} -ex \"set sysroot\"" +set GDBFLAGS "${GDBFLAGS} -iex \"set sysroot\""