From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qKj2F1uBRmObSwoAWB0awg (envelope-from ) for ; Wed, 12 Oct 2022 04:56:59 -0400 Received: by simark.ca (Postfix, from userid 112) id 5FD6F1E112; Wed, 12 Oct 2022 04:56:59 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=f9Bg+8ow; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 17E441E0CB for ; Wed, 12 Oct 2022 04:56:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BB5A3385140A for ; Wed, 12 Oct 2022 08:56:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB5A3385140A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665565018; bh=o2+DiMPrPz1SsCOCNEwkMIJHgWql/YLFE2TOXBOqd/w=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=f9Bg+8owIsNciycwM9dKmfJMvfM+5yqOMtLJ2hy9o4y14PqkzNNeHp878EEcDok59 liGTqOPeytOjienuCsn3NCgcRAgmh/xj9EgCnPvGJ6HCq4KKsvh79A/sGJUJswbgOz hZHHrprK+qkxRdyohtzvSWheBNClK7Wx/a5ZvhU4= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id E5B4038582BC for ; Wed, 12 Oct 2022 08:56:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E5B4038582BC 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 2AE0821994 for ; Wed, 12 Oct 2022 08:56:39 +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 0E73213ACD for ; Wed, 12 Oct 2022 08:56:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AZVEAkeBRmPAaAAAMHmgww (envelope-from ) for ; Wed, 12 Oct 2022 08:56:39 +0000 Date: Wed, 12 Oct 2022 10:56:37 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/contrib] Handle STRIP_ARGS_{STRIP,KEEP}_DEBUG in cc-with-tweaks.sh Message-ID: <20221012085635.GA22142@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, Handle new environment variable STRIP_ARGS_STRIP_DEBUG, defaulting to --strip-debug in gdb/contrib/cc-with-tweaks.sh, such that we can easily reproduce the PR29277 assert using: ... $ export STRIP_ARGS_STRIP_DEBUG=--strip-all $ make check RUNTESTFLAGS="gdb.base/jit-reader.exp \ --target_board cc-with-gnu-debuglink" ... For completeness sake and to avoid confusion about which of the two used strip invocations the passed args apply to, likewise add STRIP_ARGS_KEEP_DEBUG, defaulting to --only-keep-debug. Script checked with shellcheck, no new warnings added. Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/contrib] Handle STRIP_ARGS_{STRIP,KEEP}_DEBUG in cc-with-tweaks.sh --- gdb/contrib/cc-with-tweaks.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh index c6f0f62cd06..0ad0091d47a 100755 --- a/gdb/contrib/cc-with-tweaks.sh +++ b/gdb/contrib/cc-with-tweaks.sh @@ -74,6 +74,11 @@ READELF=${READELF:-readelf} DWZ=${DWZ:-dwz} DWP=${DWP:-dwp} +# shellcheck disable=SC2206 # Allow word splitting. +STRIP_ARGS_STRIP_DEBUG=(${STRIP_ARGS_STRIP_DEBUG:---strip-debug}) +# shellcheck disable=SC2206 # Allow word splitting. +STRIP_ARGS_KEEP_DEBUG=(${STRIP_ARGS_KEEP_DEBUG:---only-keep-debug}) + have_link=unknown next_is_output_file=no output_file=a.out @@ -267,11 +272,11 @@ if [ "$want_gnu_debuglink" = true ]; then debug_file="$tmpdir"/$(basename "$output_file").debug # Create stripped and debug versions of output_file. - strip --strip-debug "${output_file}" \ + strip "${STRIP_ARGS_STRIP_DEBUG[@]}" "${output_file}" \ -o "${stripped_file}" rc=$? [ $rc != 0 ] && exit $rc - strip --only-keep-debug "${output_file}" \ + strip "${STRIP_ARGS_KEEP_DEBUG[@]}" "${output_file}" \ -o "${debug_file}" rc=$? [ $rc != 0 ] && exit $rc