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.
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
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