Add support of DW_OP_GNU_variable_value to DWARF assembler
authorKevin Buettner <kevinb@redhat.com>
Mon, 30 Jul 2018 23:15:34 +0000 (16:15 -0700)
committerKevin Buettner <kevinb@redhat.com>
Sat, 18 Aug 2018 19:59:15 +0000 (12:59 -0700)
gdb/testsuite/ChangeLog:

* lib/dwarf.exp: Add support for DW_OP_GNU_variable_value.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/dwarf.exp

index 705e5f07b906a2e398c205a786ef715dce280917..848cb65f36954540f7bd47801bb56ed1d9fd40da 100644 (file)
@@ -1,3 +1,7 @@
+2018-08-18  Kevin Buettner  <kevinb@redhat.com>
+
+       * lib/dwarf.exp: Add support for DW_OP_GNU_variable_value.
+
 2018-08-17  Alan Hayward  <alan.hayward@arm.com>
 
        PR gdb/18931
index 82ec29b57dcba8b3dff00a65600044a2ffc3441c..0c3f50a038887fcfe474611da8cb8e2700e762b3 100644 (file)
@@ -962,6 +962,20 @@ namespace eval Dwarf {
                    _op .sleb128 [lindex $line 2]
                }
 
+               DW_OP_GNU_variable_value {
+                   if {[llength $line] != 2} {
+                       error "usage: $opcode LABEL"
+                   }
+
+                   # Here label is a section offset.
+                   set label [lindex $line 1]
+                   if { $_cu_version == 2 } {
+                       _op .${_cu_addr_size}byte $label
+                   } else {
+                       _op .${_cu_offset_size}byte $label
+                   }
+               }
+
                DW_OP_deref_size {
                    if {[llength $line] != 2} {
                        error "usage: DW_OP_deref_size SIZE"