# Wrapper around gcc to tweak the output in various ways when running
# the testsuite.
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# CC_FOR_TARGET="/bin/sh $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS gcc" \
# CXX_FOR_TARGET="/bin/sh $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS g++"
#
+# For documentation on Fission and dwp files:
+# http://gcc.gnu.org/wiki/DebugFission
+# http://gcc.gnu.org/wiki/DebugFissionDWP
# For documentation on index files: info -f gdb.info -n "Index Files"
# For information about 'dwz', see the announcement:
# http://gcc.gnu.org/ml/gcc/2012-04/msg00686.html
# -z compress using dwz
# -m compress using dwz -m
# -i make an index
+# -p create .dwp files (Fission), you need to also use gcc option -gsplit-dwarf
# If nothing is given, no changes are made
myname=cc-with-tweaks.sh
if [ "$want_dwp" = true ]; then
dwo_files=$($READELF -wi "${output_file}" | grep _dwo_name | \
sed -e 's/^.*: //' | sort | uniq)
- $DWP -o "${output_file}.dwp" ${dwo_files} > /dev/null
- rm -f ${dwo_files}
+ rc=0
+ if [ -n "$dwo_files" ]; then
+ $DWP -o "${output_file}.dwp" ${dwo_files} > /dev/null
+ rc=$?
+ [ $rc != 0 ] && exit $rc
+ rm -f ${dwo_files}
+ fi
fi
rm -f "$index_file"