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 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 From: Tom de Vries 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-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, 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: Wed, 12 Oct 2022 08:56:41 -0000 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