public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Mark DW_OP_GNU_variable_value-referenced DIEs with die_no_multifile
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

With the varval test-case, we run into:
...
$ gdb -q -batch varval -ex start -ex "print constval"
Temporary breakpoint 1 at 0x4004ab

Temporary breakpoint 1, 0x00000000004004ab in main ()
Bad DW_OP_GNU_variable_value DIE.
...

In the original exec we have a DIE with DW_OP_GNU_variable_value ref to
DIE 0x112:
...
 <1><112>: Abbrev Number: 8 (DW_TAG_variable)
    <113>   DW_AT_name        : var_c
    <119>   DW_AT_type        : <0xd4>
    <11d>   DW_AT_external    : 1
    <11e>   DW_AT_const_value : 53
 ...
 <2><1f7>: Abbrev Number: 25 (DW_TAG_variable)
    <1f8>   DW_AT_name        : constval
    <201>   DW_AT_type        : <0xd4>
    <205>   DW_AT_location    : 6 byte block: fd 12 1 0 0 9f \
            (DW_OP_GNU_variable_value: <0x112>; DW_OP_stack_value)
...

But after dwz -m we have moved var_c to the multifile:
...
 <1><86>: Abbrev Number: 1 (DW_TAG_variable)
    <87>   DW_AT_name        : var_c
    <8d>   DW_AT_type        : <0x7a>
    <8e>   DW_AT_external    : 1
    <8f>   DW_AT_const_value : 53
...
while constval has not, and now it has an invalid DW_OP_GNU_variable_value
ref:
...
 <2><159>: Abbrev Number: 18 (DW_TAG_variable)
    <15a>   DW_AT_name        : constval
    <163>   DW_AT_type        : <alt 0x7a>
    <167>   DW_AT_location    : 6 byte block: fd 4 0 0 0 9f \
            (DW_OP_GNU_variable_value: <0x4>; DW_OP_stack_value)
...

Given that the DW_OP_GNU_variable_value is similar to DW_FORM_ref_addr, and
does normally not point into other files ( the exception being some old ada
compiler, see http://eagercon.com/dwarf/issues/010322-2.htm ), there's no way
to reach the multifile from the original file.

Fix this by forbidding DW_OP_GNU_variable_value-referenced DIEs to move to
the multifile.

Committed to trunk.

Thanks,
- Tom

Mark DW_OP_GNU_variable_value-referenced DIEs with die_no_multifile

2019-07-18  Tom de Vries  <tdevries@suse.de>

	PR dwz/24823
	* Makefile (varval): New target.
	(TEST_EXECS): Add varval.
	* dwz.c (read_exprloc): Mark DW_OP_GNU_variable_value-referenced DIEs
	with die_no_multifile.
	* testsuite/dwz.tests/dwz-tests.exp: Require varval for pr24823.sh.
	* testsuite/dwz.tests/pr24823.sh: New test.
	* testsuite/dwz.tests/varval.S: New test source.
	* testsuite/dwz.tests/varval.c: Same.

---
 Makefile                          |   7 +-
 dwz.c                             |   1 +
 testsuite/dwz.tests/dwz-tests.exp |   3 +
 testsuite/dwz.tests/pr24823.sh    |  16 ++
 testsuite/dwz.tests/varval.S      | 514 ++++++++++++++++++++++++++++++++++++++
 testsuite/dwz.tests/varval.c      |  33 +++
 6 files changed, 573 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f1214ba..7e281e5 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ PWD:=$(shell pwd -P)
 TEST_SRC = $(srcdir)/testsuite/dwz.tests
 TEST_EXECS = hello dw2-restrict py-section-script dwz-for-test min two-typedef \
 	dw2-skip-prologue start implptr-64bit-d2o4a8r8t0 hello-gold-gdb-index \
-	start-gold hello-gnu-pubnames
+	start-gold hello-gnu-pubnames varval
 
 hello:
 	$(CC) $(TEST_SRC)/hello.c -o $@ -g
@@ -75,6 +75,11 @@ hello-gold-gdb-index:
 	$(CC) $(TEST_SRC)/hello.c -g -fuse-ld=gold -Wl,--gdb-index -o $@ \
 	    || touch $@
 
+varval:
+	$(CC) $(TEST_SRC)/varval.c $(TEST_SRC)/varval.S -g -o $@ \
+	    || touch $@
+
+
 # On some systems we need to set and export DEJAGNU to suppress
 # WARNING: Couldn't find the global config file.
 DEJAGNU ?= /dev/null
diff --git a/dwz.c b/dwz.c
index e5de164..577ea2c 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1596,6 +1596,7 @@ read_exprloc (DSO *dso, dw_die_ref die, unsigned char *ptr, size_t len,
 		     dso->filename, get_DW_OP_str (op));
 	      return 1;
 	    }
+	  ref->die_no_multifile = 1;
 	  if (unlikely (low_mem))
 	    {
 	      ref->die_referenced = 1;
diff --git a/testsuite/dwz.tests/dwz-tests.exp b/testsuite/dwz.tests/dwz-tests.exp
index 24d5772..8058729 100644
--- a/testsuite/dwz.tests/dwz-tests.exp
+++ b/testsuite/dwz.tests/dwz-tests.exp
@@ -55,6 +55,9 @@ foreach test $tests {
     if { $basename == "pr24771.sh" } {
 	lappend required_execs "hello-gnu-pubnames"
     }
+    if { $basename == "pr24823.sh" } {
+	lappend required_execs "varval"
+    }
     if { ![istarget x86_64-*-*] } {
 	if { $basename == "pr24468.sh" } {
 	    unsupported "$test"
diff --git a/testsuite/dwz.tests/pr24823.sh b/testsuite/dwz.tests/pr24823.sh
new file mode 100644
index 0000000..f6e5f90
--- /dev/null
+++ b/testsuite/dwz.tests/pr24823.sh
@@ -0,0 +1,16 @@
+exec=$execs/varval
+
+cp $exec 1
+cp 1 2
+
+dwz -m 3 1 2
+
+if [ -f 3 ]; then
+    readelf -wi 3 > READELF.3
+    if grep -q var_c READELF.3; status=$?; then
+	true
+    fi
+    [ $status -ne 0 ]
+fi
+
+rm -f 1 2 3 READELF.3
diff --git a/testsuite/dwz.tests/varval.S b/testsuite/dwz.tests/varval.S
new file mode 100644
index 0000000..be62e8b
--- /dev/null
+++ b/testsuite/dwz.tests/varval.S
@@ -0,0 +1,514 @@
+# Generated using gdb/testsuite/gdb.dwarf2/varval.exp from repo
+# git://sourceware.org/git/binutils-gdb.git.
+        .section .debug_info
+.Lcu1_begin:
+        .4byte        .Lcu1_end - .Lcu1_start
+.Lcu1_start:
+        .2byte        4                 /* Version */
+        .4byte        .Labbrev1_begin   /* Abbrevs */
+        .byte        8                  /* Pointer size */
+        .uleb128        2               /* Abbrev (DW_TAG_compile_unit) */
+        .sleb128        0x0004
+.Llabel1:
+        .uleb128        3               /* Abbrev (DW_TAG_base_type) */
+        .uleb128        4
+        .sleb128        0x5
+        .ascii        "int\0"
+.Llabel2:
+        .uleb128        4               /* Abbrev (DW_TAG_pointer_type) */
+        .4byte        .Llabel1 - .Lcu1_begin
+.Llabel4:
+        .uleb128        5               /* Abbrev (DW_TAG_variable) */
+        .ascii        "var_a\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .byte        1
+        .uleb128        .Lexpr_end16 - .Lexpr_start15/* expression */
+.Lexpr_start15:
+        .byte        0x03               /* DW_OP_addr */
+        .8byte        var_a
+.Lexpr_end16:
+.Llabel12:
+        .uleb128        6               /* Abbrev (DW_TAG_variable) */
+        .4byte        .Llabel1 - .Lcu1_begin
+        .byte        1
+.Llabel5:
+        .uleb128        7               /* Abbrev (DW_TAG_variable) */
+        .ascii        "var_b\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .byte        1
+        .uleb128        .Lexpr_end18 - .Lexpr_start17/* expression */
+.Lexpr_start17:
+        .byte        0x03               /* DW_OP_addr */
+        .8byte        var_b
+.Lexpr_end18:
+.Llabel6:
+        .uleb128        8               /* Abbrev (DW_TAG_variable) */
+        .ascii        "var_c\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .byte        1
+        .sleb128        53
+.Llabel7:
+        .uleb128        9               /* Abbrev (DW_TAG_variable) */
+        .ascii        "var_p\0"
+        .4byte        .Llabel2 - .Lcu1_begin
+        .byte        1
+        .uleb128        .Lexpr_end20 - .Lexpr_start19/* expression */
+.Lexpr_start19:
+        .byte        0x03               /* DW_OP_addr */
+        .8byte        var_p
+.Lexpr_end20:
+.Llabel3:
+        .uleb128        10              /* Abbrev (DW_TAG_structure_type) */
+        .sleb128        8*4
+        .uleb128        11              /* Abbrev (DW_TAG_member) */
+        .ascii        "a\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        0*4
+        .uleb128        12              /* Abbrev (DW_TAG_member) */
+        .ascii        "b\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        1*4
+        .uleb128        13              /* Abbrev (DW_TAG_member) */
+        .ascii        "c\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        2*4
+        .uleb128        14              /* Abbrev (DW_TAG_member) */
+        .ascii        "d\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        3*4
+        .uleb128        15              /* Abbrev (DW_TAG_member) */
+        .ascii        "e\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        4*4
+        .uleb128        16              /* Abbrev (DW_TAG_member) */
+        .ascii        "f\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        5*4
+        .uleb128        17              /* Abbrev (DW_TAG_member) */
+        .ascii        "g\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        6*4
+        .uleb128        18              /* Abbrev (DW_TAG_member) */
+        .ascii        "h\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        7*4
+        .byte        0x0                /* Terminate children */
+.Llabel10:
+        .uleb128        19              /* Abbrev (DW_TAG_variable) */
+        .ascii        "var_s\0"
+        .4byte        .Llabel3 - .Lcu1_begin
+        .byte        1
+        .uleb128        .Lexpr_end22 - .Lexpr_start21/* expression */
+.Lexpr_start21:
+        .byte        0x03               /* DW_OP_addr */
+        .8byte        var_s
+.Lexpr_end22:
+.Llabel11:
+        .uleb128        20              /* Abbrev (DW_TAG_variable) */
+        .ascii        "var_untyped\0"
+        .byte        1
+        .uleb128        .Lexpr_end24 - .Lexpr_start23/* expression */
+.Lexpr_start23:
+        .byte        0x03               /* DW_OP_addr */
+        .8byte        var_b
+.Lexpr_end24:
+        .uleb128        21              /* Abbrev (DW_TAG_subprogram) */
+        .ascii        "main\0"
+        .8byte        main_label - 4
+        .8byte        main_label - 4 + 11
+        .4byte        .Llabel1 - .Lcu1_begin
+        .byte        1
+.Llabel9:
+        .uleb128        22              /* Abbrev (DW_TAG_variable) */
+        .ascii        "varval\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        .Lexpr_end26 - .Lexpr_start25/* expression */
+.Lexpr_start25:
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel4
+        .byte        0x9f               /* DW_OP_stack_value */
+.Lexpr_end26:
+.Llabel14:
+        .uleb128        23              /* Abbrev (DW_TAG_variable) */
+        .ascii        "varval2\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        .Lexpr_end28 - .Lexpr_start27/* expression */
+.Lexpr_start27:
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel12
+        .byte        0x9f               /* DW_OP_stack_value */
+.Lexpr_end28:
+.Llabel13:
+        .uleb128        24              /* Abbrev (DW_TAG_variable) */
+        .4byte        .Llabel12 - .Lcu1_begin
+        .uleb128        .Lexpr_end30 - .Lexpr_start29/* expression */
+.Lexpr_start29:
+        .byte        0x03               /* DW_OP_addr */
+        .8byte        var_a
+.Lexpr_end30:
+        .uleb128        25              /* Abbrev (DW_TAG_variable) */
+        .ascii        "constval\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        .Lexpr_end32 - .Lexpr_start31/* expression */
+.Lexpr_start31:
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel6
+        .byte        0x9f               /* DW_OP_stack_value */
+.Lexpr_end32:
+        .uleb128        26              /* Abbrev (DW_TAG_variable) */
+        .ascii        "mixedval\0"
+        .4byte        .Llabel1 - .Lcu1_begin
+        .uleb128        .Lexpr_end34 - .Lexpr_start33/* expression */
+.Lexpr_start33:
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel6
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel5
+        .byte        0x1b               /* DW_OP_div */
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel9
+        .byte        0x22               /* DW_OP_plus */
+        .byte        0x12               /* DW_OP_dup */
+        .byte        0x22               /* DW_OP_plus */
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel9
+        .byte        0x1c               /* DW_OP_minus */
+        .byte        0x9f               /* DW_OP_stack_value */
+.Lexpr_end34:
+        .uleb128        27              /* Abbrev (DW_TAG_variable) */
+        .ascii        "pointerval\0"
+        .4byte        .Llabel2 - .Lcu1_begin
+        .uleb128        .Lexpr_end36 - .Lexpr_start35/* expression */
+.Lexpr_start35:
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel7
+        .byte        0x9f               /* DW_OP_stack_value */
+.Lexpr_end36:
+        .uleb128        28              /* Abbrev (DW_TAG_variable) */
+        .ascii        "structval\0"
+        .4byte        .Llabel3 - .Lcu1_begin
+        .uleb128        .Lexpr_end38 - .Lexpr_start37/* expression */
+.Lexpr_start37:
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel10
+        .byte        0x9f               /* DW_OP_stack_value */
+.Lexpr_end38:
+        .uleb128        29              /* Abbrev (DW_TAG_variable) */
+        .ascii        "untypedval\0"
+        .uleb128        .Lexpr_end40 - .Lexpr_start39/* expression */
+.Lexpr_start39:
+        .byte        0xfd               /* DW_OP_GNU_variable_value */
+        .4byte        .Llabel11
+        .byte        0x9f               /* DW_OP_stack_value */
+.Lexpr_end40:
+        .byte        0x0                /* Terminate children */
+        .byte        0x0                /* Terminate children */
+.Lcu1_end:
+        .section .debug_abbrev
+.Labbrev1_begin:
+        .uleb128        2               /* Abbrev start */
+        .uleb128        0x11            /* DW_TAG_compile_unit */
+        .byte        1                  /* has_children */
+        .uleb128        0x13            /* DW_AT_language */
+        .uleb128        0x0d            /* DW_FORM_sdata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        3               /* Abbrev start */
+        .uleb128        0x24            /* DW_TAG_base_type */
+        .byte        0                  /* has_children */
+        .uleb128        0x0b            /* DW_AT_byte_size */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .uleb128        0x3e            /* DW_AT_encoding */
+        .uleb128        0x0d            /* DW_FORM_sdata */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        4               /* Abbrev start */
+        .uleb128        0x0f            /* DW_TAG_pointer_type */
+        .byte        0                  /* has_children */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        5               /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        6               /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        7               /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        8               /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .uleb128        0x1c            /* DW_AT_const_value */
+        .uleb128        0x0d            /* DW_FORM_sdata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        9               /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        10              /* Abbrev start */
+        .uleb128        0x13            /* DW_TAG_structure_type */
+        .byte        1                  /* has_children */
+        .uleb128        0x0b            /* DW_AT_byte_size */
+        .uleb128        0x0d            /* DW_FORM_sdata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        11              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        12              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        13              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        14              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        15              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        16              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        17              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        18              /* Abbrev start */
+        .uleb128        0x0d            /* DW_TAG_member */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x38            /* DW_AT_data_member_location */
+        .uleb128        0x0f            /* DW_FORM_udata */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        19              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        20              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        21              /* Abbrev start */
+        .uleb128        0x2e            /* DW_TAG_subprogram */
+        .byte        1                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x11            /* DW_AT_low_pc */
+        .uleb128        0x01            /* DW_FORM_addr */
+        .uleb128        0x12            /* DW_AT_high_pc */
+        .uleb128        0x01            /* DW_FORM_addr */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x3f            /* DW_AT_external */
+        .uleb128        0x0c            /* DW_FORM_flag */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        22              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        23              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        24              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x31            /* DW_AT_abstract_origin */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        25              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        26              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        27              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        28              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x49            /* DW_AT_type */
+        .uleb128        0x13            /* DW_FORM_ref4 */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .uleb128        29              /* Abbrev start */
+        .uleb128        0x34            /* DW_TAG_variable */
+        .byte        0                  /* has_children */
+        .uleb128        0x03            /* DW_AT_name */
+        .uleb128        0x08            /* DW_FORM_string */
+        .uleb128        0x02            /* DW_AT_location */
+        .uleb128        0x09            /* SPECIAL_expr */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
+        .byte        0x0                /* Terminator */
diff --git a/testsuite/dwz.tests/varval.c b/testsuite/dwz.tests/varval.c
new file mode 100644
index 0000000..f76bfa8
--- /dev/null
+++ b/testsuite/dwz.tests/varval.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   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 was copied from the git://sourceware.org/git/binutils-gdb.git
+   repository, file gdb/testsuite/gdb.dwarf2/varval.c.  */
+
+/* Test program for DW_OP_GNU_variable_value.  */
+
+int var_a = 8;
+int var_b = 3;
+int *var_p = &var_b;
+struct { int a, b, c, d, e, f, g, h; } var_s = { 101, 102, 103, 104, 105, 106, 107, 108 };
+
+int
+main (void)
+{
+  asm ("main_label: .globl main_label");
+  return 0;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-19 12:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Mark DW_OP_GNU_variable_value-referenced DIEs with die_no_multifile Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).