aboutsummaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-02-12 04:43:03 +0100
committerTom de Vries <tdevries@suse.de>2021-02-12 04:43:03 +0100
commitd60f79984aecd7f72de6fdf2015100a7516c9ee2 (patch)
treec8f89c0d52ca23e981f3abd6791e5293a5d2220a /binutils/dwarf.c
parenta5a310d6169ff2c47175294c901f3706f62692a8 (diff)
downloadgdb-d60f79984aecd7f72de6fdf2015100a7516c9ee2.zip
gdb-d60f79984aecd7f72de6fdf2015100a7516c9ee2.tar.gz
gdb-d60f79984aecd7f72de6fdf2015100a7516c9ee2.tar.bz2
[binutils] Print DWO ID
With exec: ... $ gcc -gsplit-dwarf ~/hello.c -gdwarf-5 ... a dwarf-5 DW_UT_skeleton CU is generated, but the corresponding DWO ID is not printed by readelf -wi. Add this, such that we have: .... Compilation Unit @ offset 0xc7: Length: 0x31 (32-bit) Version: 5 Unit Type: DW_UT_skeleton (4) Abbrev Offset: 0x64 Pointer Size: 8 + DWO ID: 0x4756ae3ac4348f21 <0><db>: Abbrev Number: 1 (DW_TAG_skeleton_unit) ... binutils/ChangeLog: 2021-02-12 Tom de Vries <tdevries@suse.de> * dwarf.c (process_debug_info): Print DWO ID.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 3cbd197..c96613f 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -3692,11 +3692,13 @@ process_debug_info (struct dwarf_section * section,
if (compunit.cu_version < 5)
SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end);
+ bfd_boolean do_dwo_id = FALSE;
+ uint64_t dwo_id;
if (compunit.cu_unit_type == DW_UT_split_compile
|| compunit.cu_unit_type == DW_UT_skeleton)
{
- uint64_t dwo_id;
SAFE_BYTE_GET_AND_INC (dwo_id, hdrptr, 8, end);
+ do_dwo_id = TRUE;
}
/* PR 17512: file: 001-108546-0.001:0.1. */
@@ -3769,6 +3771,8 @@ process_debug_info (struct dwarf_section * section,
printf (_(" Type Offset: 0x%s\n"),
dwarf_vmatoa ("x", type_offset));
}
+ if (do_dwo_id)
+ printf (_(" DWO ID: 0x%s\n"), dwarf_vmatoa ("x", dwo_id));
if (this_set != NULL)
{
dwarf_vma *offsets = this_set->section_offsets;