diff options
author | Doug Evans <dje@google.com> | 2012-11-05 15:50:22 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2012-11-05 15:50:22 +0000 |
commit | 80626a55b99a0cb91546f334fc683f7a9f351101 (patch) | |
tree | 6d9523f58902890a52d03d368fa501527aadb488 /gdb/contrib | |
parent | 0cb79d6955c226a3639ae92f771509754ed3276d (diff) | |
download | gdb-80626a55b99a0cb91546f334fc683f7a9f351101.zip gdb-80626a55b99a0cb91546f334fc683f7a9f351101.tar.gz gdb-80626a55b99a0cb91546f334fc683f7a9f351101.tar.bz2 |
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.
Diffstat (limited to 'gdb/contrib')
-rwxr-xr-x | gdb/contrib/cc-with-tweaks.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh index bdbdf7d..ccc9c5a 100755 --- a/gdb/contrib/cc-with-tweaks.sh +++ b/gdb/contrib/cc-with-tweaks.sh @@ -61,8 +61,10 @@ then fi OBJCOPY=${OBJCOPY:-objcopy} +READELF=${READELF:-readelf} DWZ=${DWZ:-dwz} +DWP=${DWP:-dwp} have_link=unknown next_is_output_file=no @@ -71,12 +73,14 @@ output_file=a.out want_index=false want_dwz=false want_multi=false +want_dwp=false while [ $# -gt 0 ]; do case "$1" in -z) want_dwz=true ;; -i) want_index=true ;; -m) want_multi=true ;; + -p) want_dwp=true ;; *) break ;; esac shift @@ -159,5 +163,12 @@ elif [ "$want_multi" = true ]; then $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null 2>&1 fi +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} +fi + rm -f "$index_file" exit $rc |