binutils-gdb/gdb/contrib/cc-with-tweaks.sh

199 lines
5.3 KiB
Bash
Raw Normal View History

cc-with-tweaks.sh: Use gdb-add-index.sh With DWARF-5 .debug_names, the commands to add the index to the symbol file are more complicated, as now also .debug_str needs to be modified. Currently, contrib/cc-with-tweaks.sh calls objcopy to handle the '-i' option instead of using contrib/gdb-add-index.sh which basically does the same. To help with .debug_names, this commit makes contrib/cc-with-tweaks.sh reuse contrib/gdb-add-index.sh instead. A problem this ran into is whether contrib/cc-with-tweaks.sh should fail or not when no index is produced. Currently, contrib/cc-with-tweaks.sh is more quiet (=successful) than contrib/gdb-add-index.sh and so with no further changes testsuite runs with an index would "regress". This commit tries to keep the behavior unchanged. Some cases still error with: Ada is not currently supported by the index But some cases (such as some trivial gdb.dwarf2/ testcases with no DWARF data to index) produce no index while the testcases still PASS now instead of: -PASS: gdb.arch/i386-bp_permanent.exp: stack pointer value matches +gdb compile failed, gdb-add-index.sh: No index was created for gdb/testsuite.unix.-m64/outputs/gdb.arch/i386-bp_permanent/i386-bp_permanent +gdb-add-index.sh: [Was there no debuginfo? Was there already an index?] +UNTESTED: gdb.arch/i386-bp_permanent.exp: failed to compile gdb/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * contrib/cc-with-tweaks.sh: Change interpreter to bash, incl. initial comment. (GDB_ADD_INDEX): New variable. <$want_index>: Call $GDB_ADD_INDEX.
2017-12-08 23:44:10 +01:00
#!/usr/bin/env bash
# Wrapper around gcc to tweak the output in various ways when running
# the testsuite.
2010-10-05 06:28:15 +02:00
# Copyright (C) 2010-2018 Free Software Foundation, Inc.
2010-10-05 06:28:15 +02:00
# 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
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This program requires gdb and objcopy in addition to gcc.
# The default values are gdb from the build tree and objcopy from $PATH.
# They may be overridden by setting environment variables GDB and OBJCOPY
# respectively. Note that GDB should contain the gdb binary as well as the
# -data-directory flag, e.g., "foo/gdb -data-directory foo/data-directory".
2010-10-05 06:28:15 +02:00
# We assume the current directory is either $obj/gdb or $obj/gdb/testsuite.
#
# Example usage:
#
# bash$ cd $objdir/gdb/testsuite
# bash$ runtest \
cc-with-tweaks.sh: Use gdb-add-index.sh With DWARF-5 .debug_names, the commands to add the index to the symbol file are more complicated, as now also .debug_str needs to be modified. Currently, contrib/cc-with-tweaks.sh calls objcopy to handle the '-i' option instead of using contrib/gdb-add-index.sh which basically does the same. To help with .debug_names, this commit makes contrib/cc-with-tweaks.sh reuse contrib/gdb-add-index.sh instead. A problem this ran into is whether contrib/cc-with-tweaks.sh should fail or not when no index is produced. Currently, contrib/cc-with-tweaks.sh is more quiet (=successful) than contrib/gdb-add-index.sh and so with no further changes testsuite runs with an index would "regress". This commit tries to keep the behavior unchanged. Some cases still error with: Ada is not currently supported by the index But some cases (such as some trivial gdb.dwarf2/ testcases with no DWARF data to index) produce no index while the testcases still PASS now instead of: -PASS: gdb.arch/i386-bp_permanent.exp: stack pointer value matches +gdb compile failed, gdb-add-index.sh: No index was created for gdb/testsuite.unix.-m64/outputs/gdb.arch/i386-bp_permanent/i386-bp_permanent +gdb-add-index.sh: [Was there no debuginfo? Was there already an index?] +UNTESTED: gdb.arch/i386-bp_permanent.exp: failed to compile gdb/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * contrib/cc-with-tweaks.sh: Change interpreter to bash, incl. initial comment. (GDB_ADD_INDEX): New variable. <$want_index>: Call $GDB_ADD_INDEX.
2017-12-08 23:44:10 +01:00
# CC_FOR_TARGET="/bin/bash $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS gcc" \
# CXX_FOR_TARGET="/bin/bash $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS g++"
2010-10-05 06:28:15 +02:00
#
# For documentation on Fission and dwp files:
# http://gcc.gnu.org/wiki/DebugFission
# http://gcc.gnu.org/wiki/DebugFissionDWP
2010-10-05 06:28:15 +02:00
# 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
# (More documentation is to come.)
2010-10-05 06:28:15 +02:00
# ARGS determine what is done. They can be:
# -Z invoke objcopy --compress-debug-sections
# -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
cc-with-tweaks.sh: Use gdb-add-index.sh With DWARF-5 .debug_names, the commands to add the index to the symbol file are more complicated, as now also .debug_str needs to be modified. Currently, contrib/cc-with-tweaks.sh calls objcopy to handle the '-i' option instead of using contrib/gdb-add-index.sh which basically does the same. To help with .debug_names, this commit makes contrib/cc-with-tweaks.sh reuse contrib/gdb-add-index.sh instead. A problem this ran into is whether contrib/cc-with-tweaks.sh should fail or not when no index is produced. Currently, contrib/cc-with-tweaks.sh is more quiet (=successful) than contrib/gdb-add-index.sh and so with no further changes testsuite runs with an index would "regress". This commit tries to keep the behavior unchanged. Some cases still error with: Ada is not currently supported by the index But some cases (such as some trivial gdb.dwarf2/ testcases with no DWARF data to index) produce no index while the testcases still PASS now instead of: -PASS: gdb.arch/i386-bp_permanent.exp: stack pointer value matches +gdb compile failed, gdb-add-index.sh: No index was created for gdb/testsuite.unix.-m64/outputs/gdb.arch/i386-bp_permanent/i386-bp_permanent +gdb-add-index.sh: [Was there no debuginfo? Was there already an index?] +UNTESTED: gdb.arch/i386-bp_permanent.exp: failed to compile gdb/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * contrib/cc-with-tweaks.sh: Change interpreter to bash, incl. initial comment. (GDB_ADD_INDEX): New variable. <$want_index>: Call $GDB_ADD_INDEX.
2017-12-08 23:44:10 +01:00
mydir=`dirname "$0"`
2010-10-05 06:28:15 +02:00
if [ -z "$GDB" ]
then
if [ -f ./gdb ]
then
GDB="./gdb -data-directory data-directory"
2010-10-05 06:28:15 +02:00
elif [ -f ../gdb ]
then
GDB="../gdb -data-directory ../data-directory"
elif [ -f ../../gdb ]
then
GDB="../../gdb -data-directory ../../data-directory"
2010-10-05 06:28:15 +02:00
else
echo "$myname: unable to find usable gdb" >&2
exit 1
fi
fi
OBJCOPY=${OBJCOPY:-objcopy}
Add support for DWP files. http://gcc.gnu.org/wiki/DebugFissionDWP * contrib/cc-with-tweaks.sh: Add -p parameter to invoke dwp. * dwarf2read.c: #include "elf-bfd.h". (struct dwarf2_per_objfile): New members dwp_checked, dwp_file. (dwop_section_names): Renamed from dwo_section names. All uses updated. Add entries for .debug_cu_index, .debug_tu_index. (struct dwo_file): Rename dwo_name to name, dwo_bfd to dbfd. All uses updated. (struct dwp_sections): New type. (struct virtual_dwo_sections): New type. (struct dwp_hash_table): New type. (struct dwp_file): New type. (init_cutu_and_read_dies): Ensure DWO info/types section has been read in. Handle DWOs coming from DWP files. (lookup_dwo_file_slot): New function. (dwarf2_locate_dwo_sections): Move definition closer to use. (create_dwo_debug_info_hash_table_reader): Renamed from create_debug_info_hash_table_reader. All callers updated. (create_dwo_debug_info_hash_table): Renamed from create_debug_info_hash_table. All callers updated. (create_dwp_hash_table): New function. (locate_virtual_dwo_sections, create_dwo_in_dwp): New functions. (lookup_dwo_in_dwp): New function. (try_open_dwop_file): Renamed from try_open_dwo_file. New parameter is_dwp. All callers updated. (open_dwop_file): Renamed from open_dwo_file. All callers updated. (open_and_init_dwo_file): Renamed from init_dwo_file. All callers updated. (lookup_dwo_file): Delete. (dwarf2_locate_dwp_sections): New function. (hash_dwp_loaded_cutus, eq_dwp_loaded_cutus): New functions. (allocate_dwp_loaded_cutus_table): New function. (open_and_init_dwp_file): New function. (lookup_dwo_cutu): New function. (lookup_dwo_comp_unit, lookup_dwo_type_unit): Call it.
2012-11-05 16:50:22 +01:00
READELF=${READELF:-readelf}
2010-10-05 06:28:15 +02:00
DWZ=${DWZ:-dwz}
Add support for DWP files. http://gcc.gnu.org/wiki/DebugFissionDWP * contrib/cc-with-tweaks.sh: Add -p parameter to invoke dwp. * dwarf2read.c: #include "elf-bfd.h". (struct dwarf2_per_objfile): New members dwp_checked, dwp_file. (dwop_section_names): Renamed from dwo_section names. All uses updated. Add entries for .debug_cu_index, .debug_tu_index. (struct dwo_file): Rename dwo_name to name, dwo_bfd to dbfd. All uses updated. (struct dwp_sections): New type. (struct virtual_dwo_sections): New type. (struct dwp_hash_table): New type. (struct dwp_file): New type. (init_cutu_and_read_dies): Ensure DWO info/types section has been read in. Handle DWOs coming from DWP files. (lookup_dwo_file_slot): New function. (dwarf2_locate_dwo_sections): Move definition closer to use. (create_dwo_debug_info_hash_table_reader): Renamed from create_debug_info_hash_table_reader. All callers updated. (create_dwo_debug_info_hash_table): Renamed from create_debug_info_hash_table. All callers updated. (create_dwp_hash_table): New function. (locate_virtual_dwo_sections, create_dwo_in_dwp): New functions. (lookup_dwo_in_dwp): New function. (try_open_dwop_file): Renamed from try_open_dwo_file. New parameter is_dwp. All callers updated. (open_dwop_file): Renamed from open_dwo_file. All callers updated. (open_and_init_dwo_file): Renamed from init_dwo_file. All callers updated. (lookup_dwo_file): Delete. (dwarf2_locate_dwp_sections): New function. (hash_dwp_loaded_cutus, eq_dwp_loaded_cutus): New functions. (allocate_dwp_loaded_cutus_table): New function. (open_and_init_dwp_file): New function. (lookup_dwo_cutu): New function. (lookup_dwo_comp_unit, lookup_dwo_type_unit): Call it.
2012-11-05 16:50:22 +01:00
DWP=${DWP:-dwp}
2010-10-05 06:28:15 +02:00
have_link=unknown
next_is_output_file=no
output_file=a.out
2010-10-05 06:28:15 +02:00
want_index=false
want_dwz=false
want_multi=false
Add support for DWP files. http://gcc.gnu.org/wiki/DebugFissionDWP * contrib/cc-with-tweaks.sh: Add -p parameter to invoke dwp. * dwarf2read.c: #include "elf-bfd.h". (struct dwarf2_per_objfile): New members dwp_checked, dwp_file. (dwop_section_names): Renamed from dwo_section names. All uses updated. Add entries for .debug_cu_index, .debug_tu_index. (struct dwo_file): Rename dwo_name to name, dwo_bfd to dbfd. All uses updated. (struct dwp_sections): New type. (struct virtual_dwo_sections): New type. (struct dwp_hash_table): New type. (struct dwp_file): New type. (init_cutu_and_read_dies): Ensure DWO info/types section has been read in. Handle DWOs coming from DWP files. (lookup_dwo_file_slot): New function. (dwarf2_locate_dwo_sections): Move definition closer to use. (create_dwo_debug_info_hash_table_reader): Renamed from create_debug_info_hash_table_reader. All callers updated. (create_dwo_debug_info_hash_table): Renamed from create_debug_info_hash_table. All callers updated. (create_dwp_hash_table): New function. (locate_virtual_dwo_sections, create_dwo_in_dwp): New functions. (lookup_dwo_in_dwp): New function. (try_open_dwop_file): Renamed from try_open_dwo_file. New parameter is_dwp. All callers updated. (open_dwop_file): Renamed from open_dwo_file. All callers updated. (open_and_init_dwo_file): Renamed from init_dwo_file. All callers updated. (lookup_dwo_file): Delete. (dwarf2_locate_dwp_sections): New function. (hash_dwp_loaded_cutus, eq_dwp_loaded_cutus): New functions. (allocate_dwp_loaded_cutus_table): New function. (open_and_init_dwp_file): New function. (lookup_dwo_cutu): New function. (lookup_dwo_comp_unit, lookup_dwo_type_unit): Call it.
2012-11-05 16:50:22 +01:00
want_dwp=false
want_objcopy_compress=false
while [ $# -gt 0 ]; do
case "$1" in
-Z) want_objcopy_compress=true ;;
-z) want_dwz=true ;;
-i) want_index=true ;;
-m) want_multi=true ;;
Add support for DWP files. http://gcc.gnu.org/wiki/DebugFissionDWP * contrib/cc-with-tweaks.sh: Add -p parameter to invoke dwp. * dwarf2read.c: #include "elf-bfd.h". (struct dwarf2_per_objfile): New members dwp_checked, dwp_file. (dwop_section_names): Renamed from dwo_section names. All uses updated. Add entries for .debug_cu_index, .debug_tu_index. (struct dwo_file): Rename dwo_name to name, dwo_bfd to dbfd. All uses updated. (struct dwp_sections): New type. (struct virtual_dwo_sections): New type. (struct dwp_hash_table): New type. (struct dwp_file): New type. (init_cutu_and_read_dies): Ensure DWO info/types section has been read in. Handle DWOs coming from DWP files. (lookup_dwo_file_slot): New function. (dwarf2_locate_dwo_sections): Move definition closer to use. (create_dwo_debug_info_hash_table_reader): Renamed from create_debug_info_hash_table_reader. All callers updated. (create_dwo_debug_info_hash_table): Renamed from create_debug_info_hash_table. All callers updated. (create_dwp_hash_table): New function. (locate_virtual_dwo_sections, create_dwo_in_dwp): New functions. (lookup_dwo_in_dwp): New function. (try_open_dwop_file): Renamed from try_open_dwo_file. New parameter is_dwp. All callers updated. (open_dwop_file): Renamed from open_dwo_file. All callers updated. (open_and_init_dwo_file): Renamed from init_dwo_file. All callers updated. (lookup_dwo_file): Delete. (dwarf2_locate_dwp_sections): New function. (hash_dwp_loaded_cutus, eq_dwp_loaded_cutus): New functions. (allocate_dwp_loaded_cutus_table): New function. (open_and_init_dwp_file): New function. (lookup_dwo_cutu): New function. (lookup_dwo_comp_unit, lookup_dwo_type_unit): Call it.
2012-11-05 16:50:22 +01:00
-p) want_dwp=true ;;
*) break ;;
esac
shift
done
cc-with-tweaks.sh: Use gdb-add-index.sh With DWARF-5 .debug_names, the commands to add the index to the symbol file are more complicated, as now also .debug_str needs to be modified. Currently, contrib/cc-with-tweaks.sh calls objcopy to handle the '-i' option instead of using contrib/gdb-add-index.sh which basically does the same. To help with .debug_names, this commit makes contrib/cc-with-tweaks.sh reuse contrib/gdb-add-index.sh instead. A problem this ran into is whether contrib/cc-with-tweaks.sh should fail or not when no index is produced. Currently, contrib/cc-with-tweaks.sh is more quiet (=successful) than contrib/gdb-add-index.sh and so with no further changes testsuite runs with an index would "regress". This commit tries to keep the behavior unchanged. Some cases still error with: Ada is not currently supported by the index But some cases (such as some trivial gdb.dwarf2/ testcases with no DWARF data to index) produce no index while the testcases still PASS now instead of: -PASS: gdb.arch/i386-bp_permanent.exp: stack pointer value matches +gdb compile failed, gdb-add-index.sh: No index was created for gdb/testsuite.unix.-m64/outputs/gdb.arch/i386-bp_permanent/i386-bp_permanent +gdb-add-index.sh: [Was there no debuginfo? Was there already an index?] +UNTESTED: gdb.arch/i386-bp_permanent.exp: failed to compile gdb/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * contrib/cc-with-tweaks.sh: Change interpreter to bash, incl. initial comment. (GDB_ADD_INDEX): New variable. <$want_index>: Call $GDB_ADD_INDEX.
2017-12-08 23:44:10 +01:00
if [ "$want_index" = true ]
then
if [ -z "$GDB_ADD_INDEX" ]
then
if [ -f $mydir/gdb-add-index.sh ]
then
GDB_ADD_INDEX="$mydir/gdb-add-index.sh"
else
echo "$myname: unable to find usable contrib/gdb-add-index.sh" >&2
exit 1
fi
fi
fi
2010-10-05 06:28:15 +02:00
for arg in "$@"
do
if [ "$next_is_output_file" = "yes" ]
then
output_file="$arg"
next_is_output_file=no
continue
fi
# Poor man's gcc argument parser.
# We don't need to handle all arguments, we just need to know if we're
# doing a link and what the output file is.
# It's not perfect, but it seems to work well enough for the task at hand.
case "$arg" in
"-c") have_link=no ;;
"-E") have_link=no ;;
"-S") have_link=no ;;
"-o") next_is_output_file=yes ;;
esac
done
if [ "$next_is_output_file" = "yes" ]
then
echo "$myname: Unable to find output file" >&2
exit 1
fi
if [ "$have_link" = "no" ]
then
"$@"
exit $?
fi
index_file="${output_file}.gdb-index"
if [ "$want_index" = true ] && [ -f "$index_file" ]
2010-10-05 06:28:15 +02:00
then
echo "$myname: Index file $index_file exists, won't clobber." >&2
exit 1
fi
output_dir="${output_file%/*}"
[ "$output_dir" = "$output_file" ] && output_dir="."
"$@"
rc=$?
[ $rc != 0 ] && exit $rc
if [ ! -f "$output_file" ]
then
echo "$myname: Internal error: $output_file missing." >&2
exit 1
fi
if [ "$want_objcopy_compress" = true ]; then
$OBJCOPY --compress-debug-sections "$output_file"
rc=$?
[ $rc != 0 ] && exit $rc
fi
if [ "$want_index" = true ]; then
cc-with-tweaks.sh: Use gdb-add-index.sh With DWARF-5 .debug_names, the commands to add the index to the symbol file are more complicated, as now also .debug_str needs to be modified. Currently, contrib/cc-with-tweaks.sh calls objcopy to handle the '-i' option instead of using contrib/gdb-add-index.sh which basically does the same. To help with .debug_names, this commit makes contrib/cc-with-tweaks.sh reuse contrib/gdb-add-index.sh instead. A problem this ran into is whether contrib/cc-with-tweaks.sh should fail or not when no index is produced. Currently, contrib/cc-with-tweaks.sh is more quiet (=successful) than contrib/gdb-add-index.sh and so with no further changes testsuite runs with an index would "regress". This commit tries to keep the behavior unchanged. Some cases still error with: Ada is not currently supported by the index But some cases (such as some trivial gdb.dwarf2/ testcases with no DWARF data to index) produce no index while the testcases still PASS now instead of: -PASS: gdb.arch/i386-bp_permanent.exp: stack pointer value matches +gdb compile failed, gdb-add-index.sh: No index was created for gdb/testsuite.unix.-m64/outputs/gdb.arch/i386-bp_permanent/i386-bp_permanent +gdb-add-index.sh: [Was there no debuginfo? Was there already an index?] +UNTESTED: gdb.arch/i386-bp_permanent.exp: failed to compile gdb/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * contrib/cc-with-tweaks.sh: Change interpreter to bash, incl. initial comment. (GDB_ADD_INDEX): New variable. <$want_index>: Call $GDB_ADD_INDEX.
2017-12-08 23:44:10 +01:00
# Filter out these messages which would stop dejagnu testcase run:
# echo "$myname: No index was created for $file" 1>&2
# echo "$myname: [Was there no debuginfo? Was there already an index?]" 1>&2
GDB=$GDB $GDB_ADD_INDEX "$output_file" 2>&1|grep -v "^${GDB_ADD_INDEX##*/}: " >&2
rc=${PIPESTATUS[0]}
[ $rc != 0 ] && exit $rc
fi
if [ "$want_dwz" = true ]; then
$DWZ "$output_file" > /dev/null 2>&1
elif [ "$want_multi" = true ]; then
cp $output_file ${output_file}.alt
$DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null 2>&1
2010-10-05 06:28:15 +02:00
fi
Add support for DWP files. http://gcc.gnu.org/wiki/DebugFissionDWP * contrib/cc-with-tweaks.sh: Add -p parameter to invoke dwp. * dwarf2read.c: #include "elf-bfd.h". (struct dwarf2_per_objfile): New members dwp_checked, dwp_file. (dwop_section_names): Renamed from dwo_section names. All uses updated. Add entries for .debug_cu_index, .debug_tu_index. (struct dwo_file): Rename dwo_name to name, dwo_bfd to dbfd. All uses updated. (struct dwp_sections): New type. (struct virtual_dwo_sections): New type. (struct dwp_hash_table): New type. (struct dwp_file): New type. (init_cutu_and_read_dies): Ensure DWO info/types section has been read in. Handle DWOs coming from DWP files. (lookup_dwo_file_slot): New function. (dwarf2_locate_dwo_sections): Move definition closer to use. (create_dwo_debug_info_hash_table_reader): Renamed from create_debug_info_hash_table_reader. All callers updated. (create_dwo_debug_info_hash_table): Renamed from create_debug_info_hash_table. All callers updated. (create_dwp_hash_table): New function. (locate_virtual_dwo_sections, create_dwo_in_dwp): New functions. (lookup_dwo_in_dwp): New function. (try_open_dwop_file): Renamed from try_open_dwo_file. New parameter is_dwp. All callers updated. (open_dwop_file): Renamed from open_dwo_file. All callers updated. (open_and_init_dwo_file): Renamed from init_dwo_file. All callers updated. (lookup_dwo_file): Delete. (dwarf2_locate_dwp_sections): New function. (hash_dwp_loaded_cutus, eq_dwp_loaded_cutus): New functions. (allocate_dwp_loaded_cutus_table): New function. (open_and_init_dwp_file): New function. (lookup_dwo_cutu): New function. (lookup_dwo_comp_unit, lookup_dwo_type_unit): Call it.
2012-11-05 16:50:22 +01:00
if [ "$want_dwp" = true ]; then
dwo_files=$($READELF -wi "${output_file}" | grep _dwo_name | \
sed -e 's/^.*: //' | sort | uniq)
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
Add support for DWP files. http://gcc.gnu.org/wiki/DebugFissionDWP * contrib/cc-with-tweaks.sh: Add -p parameter to invoke dwp. * dwarf2read.c: #include "elf-bfd.h". (struct dwarf2_per_objfile): New members dwp_checked, dwp_file. (dwop_section_names): Renamed from dwo_section names. All uses updated. Add entries for .debug_cu_index, .debug_tu_index. (struct dwo_file): Rename dwo_name to name, dwo_bfd to dbfd. All uses updated. (struct dwp_sections): New type. (struct virtual_dwo_sections): New type. (struct dwp_hash_table): New type. (struct dwp_file): New type. (init_cutu_and_read_dies): Ensure DWO info/types section has been read in. Handle DWOs coming from DWP files. (lookup_dwo_file_slot): New function. (dwarf2_locate_dwo_sections): Move definition closer to use. (create_dwo_debug_info_hash_table_reader): Renamed from create_debug_info_hash_table_reader. All callers updated. (create_dwo_debug_info_hash_table): Renamed from create_debug_info_hash_table. All callers updated. (create_dwp_hash_table): New function. (locate_virtual_dwo_sections, create_dwo_in_dwp): New functions. (lookup_dwo_in_dwp): New function. (try_open_dwop_file): Renamed from try_open_dwo_file. New parameter is_dwp. All callers updated. (open_dwop_file): Renamed from open_dwo_file. All callers updated. (open_and_init_dwo_file): Renamed from init_dwo_file. All callers updated. (lookup_dwo_file): Delete. (dwarf2_locate_dwp_sections): New function. (hash_dwp_loaded_cutus, eq_dwp_loaded_cutus): New functions. (allocate_dwp_loaded_cutus_table): New function. (open_and_init_dwp_file): New function. (lookup_dwo_cutu): New function. (lookup_dwo_comp_unit, lookup_dwo_type_unit): Call it.
2012-11-05 16:50:22 +01:00
fi
2010-10-05 06:28:15 +02:00
rm -f "$index_file"
exit $rc