diff options
author | Tom de Vries <tdevries@suse.de> | 2019-12-08 11:25:28 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2019-12-08 11:25:28 +0100 |
commit | c14aab8cd3135a86915f4be4ea711b30de674bb3 (patch) | |
tree | dd3cc9ad55e697bd3ee983e75a156141db43235b /gdb | |
parent | dc6dc6688bb4a550fa4f5333a151390b53a14faa (diff) | |
download | gdb-c14aab8cd3135a86915f4be4ea711b30de674bb3.zip gdb-c14aab8cd3135a86915f4be4ea711b30de674bb3.tar.gz gdb-c14aab8cd3135a86915f4be4ea711b30de674bb3.tar.bz2 |
Fix inter-CU references using intra-CU form in imported-unit
When running the gdb testsuite with the cc-with-dwz board, I run into:
...
Running gdb/testsuite/gdb.dwarf2/imported-unit.exp ...
gdb compile failed, dwz: gdb.dwarf2/imported-unit/imported-unit: \
Couldn't find DIE referenced by DW_AT_abstract_origin
cc-with-tweaks.sh: dwz did not modify gdb.dwarf2/imported-unit/imported-unit.
...
The problem is that the DW_AT_abstract_origin reference here:
...
<0><d2>: Abbrev Number: 2 (DW_TAG_compile_unit)
<1><e6>: Abbrev Number: 4 (DW_TAG_subprogram)
<e7> DW_AT_abstract_origin: <0x142>
<eb> DW_AT_low_pc : 0x4004b2
<f3> DW_AT_high_pc : 0x4004c8
...
referring to a DIE in another compilation unit here:
...
<0><129>: Abbrev Number: 2 (DW_TAG_compile_unit)
<1><142>: Abbrev Number: 4 (DW_TAG_subprogram)
<143> DW_AT_name : main
<148> DW_AT_type : <0x13b>
<14c> DW_AT_external : 1
...
is encoded using intra-CU reference form DW_FORM_ref4 instead of intra-CU
reference DW_FORM_ref_addr:
...
4 DW_TAG_subprogram [has children]
DW_AT_abstract_origin DW_FORM_ref4
DW_AT_low_pc DW_FORM_addr
DW_AT_high_pc DW_FORM_addr
DW_AT value: 0 DW_FORM value: 0
...
Fix this in the DWARF assembler by making all inter-CU references use the '%'
label prefix.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-12-08 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/imported-unit.exp: Fix inter-CU references.
Change-Id: I690ff18c3943705ed478453531b176ff74700f3c
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/imported-unit.exp | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 17ae51a..64e7ad7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-12-08 Tom de Vries <tdevries@suse.de> + + * gdb.dwarf2/imported-unit.exp: Fix inter-CU references. + 2019-12-07 Keith Seitz <keiths@redhat.com> * gdb.base/corefile-buildid-shlib-shr.c: New file. diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit.exp b/gdb/testsuite/gdb.dwarf2/imported-unit.exp index 25d4487..bf53512 100644 --- a/gdb/testsuite/gdb.dwarf2/imported-unit.exp +++ b/gdb/testsuite/gdb.dwarf2/imported-unit.exp @@ -73,24 +73,24 @@ Dwarf::assemble $asm_file { {name "<artificial>"} } { imported_unit { - {import :$cu_label ref_addr} + {import %$cu_label} } subprogram { - {abstract_origin :$main_label} + {abstract_origin %$main_label} {low_pc $main_start addr} {high_pc "$main_start + $main_length" addr} } { subprogram { - {abstract_origin :$doit_label} + {abstract_origin %$doit_label} {low_pc $doit_start addr} {high_pc "$doit_start + $doit_length" addr} } { formal_parameter { - {abstract_origin :$doit_self_label} + {abstract_origin %$doit_self_label} } } DW_TAG_variable { - {abstract_origin :$foo_label} + {abstract_origin %$foo_label} {location 4 data1} } } |