[2/3] Add support of DW_OP_GNU_variable_value to DWARF assembler

Message ID 20180802211949.6dbd4e00@pinnacle.lan
State New
Headers show
Series
  • Add support for DW_OP_GNU_variable_value
Related show

Commit Message

Kevin Buettner Aug. 3, 2018, 4:19 a.m.
gdb/testsuite/ChangeLog:
    
    	* lib/dwarf.exp: Add support for DW_OP_GNU_variable_value.
---
 gdb/testsuite/lib/dwarf.exp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Tom Tromey Aug. 3, 2018, 6:37 p.m. | #1
>>>>> "Kevin" == Kevin Buettner <kevinb@redhat.com> writes:


Kevin> gdb/testsuite/ChangeLog:
Kevin>     	* lib/dwarf.exp: Add support for DW_OP_GNU_variable_value.

This is ok.  Thank you.

Tom
Kevin Buettner Aug. 18, 2018, 8:32 p.m. | #2
On Fri, 03 Aug 2018 12:37:14 -0600
Tom Tromey <tom@tromey.com> wrote:

> >>>>> "Kevin" == Kevin Buettner <kevinb@redhat.com> writes:  

> 

> Kevin> gdb/testsuite/ChangeLog:

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

> 

> This is ok.  Thank you.

> 

> Tom


Pushed.

Patch

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 82ec29b..0c3f50a 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -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"