* [PATCH][gdb/contrib] Handle STRIP_ARGS_{STRIP,KEEP}_DEBUG in cc-with-tweaks.sh
@ 2022-10-12 8:56 Tom de Vries
2022-10-14 17:50 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2022-10-12 8:56 UTC (permalink / raw)
To: 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-14 17:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 8:56 [PATCH][gdb/contrib] Handle STRIP_ARGS_{STRIP,KEEP}_DEBUG in cc-with-tweaks.sh Tom de Vries
2022-10-14 17:50 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).