From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id B31013838015 for ; Mon, 2 Aug 2021 13:32:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B31013838015 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 E4DB921B56 for ; Mon, 2 Aug 2021 13:32:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627911160; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=l/MG1UyFmeinzqV9nmutGf2BvaWIFa+XoNUxRXASK0o=; b=zTgScs9eUMlnZzuBXeYu41ZG3h/Ue5lP3va10innDiFZFbr6BeKnZ1f6PKMRhaXm3oXtjz 44xEIKPuAysWsV6l0pu2Vsx77KEsPHRhHPXJ8njkslLoXGm3l0vl4iYCYv4excXVEkpAMJ yTAJ2L2k0+vlNy/qA7rQR3ZtitVP94g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627911160; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=l/MG1UyFmeinzqV9nmutGf2BvaWIFa+XoNUxRXASK0o=; b=waJKcXRVmkWXOcW8Kbv5gttJwOhjRPAeaGgDLVXqpx97uvv/UtqhSi9BDZtvbNspfqsbqu PZ0vksGZiL0OIgCg== 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 D25D913983 for ; Mon, 2 Aug 2021 13:32:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id dc1CMvjzB2ELZwAAGKfGzw (envelope-from ) for ; Mon, 02 Aug 2021 13:32:40 +0000 Date: Mon, 2 Aug 2021 15:32:39 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/fission-relative-dwo.exp with cc-with-gdb-index Message-ID: <20210802133237.GA8551@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 02 Aug 2021 13:32:42 -0000 Hi, When running with target board cc-with-gdb-index, we run into: ... gdb compile failed, warning: Could not find DWO CU \ fission-relative-dwo.dwo(0x1234) referenced by CU at offset 0xc7 \ [in module outputs/gdb.dwarf2/fission-relative-dwo/.tmp/fission-relative-dwo] UNTESTED: gdb.dwarf2/fission-relative-dwo.exp: fission-relative-dwo.exp ERROR: failed to compile fission-relative-dwo ... The problem is that: - the .dwo file is found relative to the executable, and - cc-with-tweaks.sh moves the executable to a temp dir, but not the .dwo file. Fix this by copying the .dwo file alongside the executable in the temp dir. Verified changes using shellcheck. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.dwarf2/fission-relative-dwo.exp with cc-with-gdb-index gdb/ChangeLog: 2021-08-02 Tom de Vries * contrib/cc-with-tweaks.sh: Copy .dwo files alongside executable. --- gdb/contrib/cc-with-tweaks.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh index 8653dfb260e..0d244dbdcb7 100755 --- a/gdb/contrib/cc-with-tweaks.sh +++ b/gdb/contrib/cc-with-tweaks.sh @@ -179,6 +179,19 @@ fi if [ "$want_index" = true ]; then get_tmpdir mv "$output_file" "$tmpdir" + output_dir=$(dirname "$output_file") + + # Copy .dwo file alongside, to fix gdb.dwarf2/fission-relative-dwo.exp. + # Use copy instead of move to not break + # rtf=gdb.dwarf2/fission-absolute-dwo.exp. + dwo_pattern="$output_dir/*.dwo" + for f in $dwo_pattern; do + if [ "$f" = "$dwo_pattern" ]; then + break + fi + cp "$f" "$tmpdir" + done + tmpfile="$tmpdir/$(basename $output_file)" # Filter out these messages which would stop dejagnu testcase run: # echo "$myname: No index was created for $file" 1>&2 @@ -187,6 +200,7 @@ if [ "$want_index" = true ]; then | grep -v "^${GDB_ADD_INDEX##*/}: " >&2 rc=${PIPESTATUS[0]} mv "$tmpfile" "$output_file" + rm -f "$tmpdir"/*.dwo [ $rc != 0 ] && exit $rc fi