From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 67A103858297; Fri, 14 Oct 2022 19:23:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67A103858297 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665775396; bh=9Ejv5fL7H1zEP3L4dHKEchxWB9LjW4xpIxQtOmGZxqU=; h=From:To:Subject:Date:From; b=OoWclptxQ/cJO0s7sz8zwIeRYJBpj42giiR+avxbRoeIUknpRwmuL9Sl/oW3DY2oz UHdHEMJDwiUW4B+JAq+3SW3EC6VzE+zOZfwOF47Qj2bEkFughXgZRHtED68+ouy4YS 8cEz7csomZdjKNyRao2BzEZwaBBVSjMnnrFbPwx8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/contrib] Handle STRIP_ARGS_{STRIP,KEEP}_DEBUG in cc-with-tweaks.sh X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 8e94bb3e3a478544c0d8abfad8404af015f7130b X-Git-Newrev: fb799bba55aea6b769584bf6b17d7040343024e7 Message-Id: <20221014192316.67A103858297@sourceware.org> Date: Fri, 14 Oct 2022 19:23:16 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dfb799bba55ae= a6b769584bf6b17d7040343024e7 commit fb799bba55aea6b769584bf6b17d7040343024e7 Author: Tom de Vries Date: Fri Oct 14 21:22:57 2022 +0200 [gdb/contrib] Handle STRIP_ARGS_{STRIP,KEEP}_DEBUG in cc-with-tweaks.sh =20 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=3D--strip-all $ make check RUNTESTFLAGS=3D"gdb.base/jit-reader.exp \ --target_board cc-with-gnu-debuglink" ... =20 For completeness sake and to avoid confusion about which of the two use= d strip invocations the passed args apply to, likewise add STRIP_ARGS_KEEP_DEBU= G, defaulting to --only-keep-debug. =20 Script checked with shellcheck, no new warnings added. =20 Tested on x86_64-linux. Diff: --- 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=3D${READELF:-readelf} DWZ=3D${DWZ:-dwz} DWP=3D${DWP:-dwp} =20 +# shellcheck disable=3DSC2206 # Allow word splitting. +STRIP_ARGS_STRIP_DEBUG=3D(${STRIP_ARGS_STRIP_DEBUG:---strip-debug}) +# shellcheck disable=3DSC2206 # Allow word splitting. +STRIP_ARGS_KEEP_DEBUG=3D(${STRIP_ARGS_KEEP_DEBUG:---only-keep-debug}) + have_link=3Dunknown next_is_output_file=3Dno output_file=3Da.out @@ -267,11 +272,11 @@ if [ "$want_gnu_debuglink" =3D true ]; then debug_file=3D"$tmpdir"/$(basename "$output_file").debug =20 # Create stripped and debug versions of output_file. - strip --strip-debug "${output_file}" \ + strip "${STRIP_ARGS_STRIP_DEBUG[@]}" "${output_file}" \ -o "${stripped_file}" rc=3D$? [ $rc !=3D 0 ] && exit $rc - strip --only-keep-debug "${output_file}" \ + strip "${STRIP_ARGS_KEEP_DEBUG[@]}" "${output_file}" \ -o "${debug_file}" rc=3D$? [ $rc !=3D 0 ] && exit $rc