[PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value

Yao Qi qiyaoltc@gmail.com
Thu Jan 19 17:44:00 GMT 2017


On 17-01-12 20:24:27, Andreas Arnez wrote:
> diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
> index 9f5fa6c..6bd563a 100644
> --- a/gdb/testsuite/lib/dwarf.exp
> +++ b/gdb/testsuite/lib/dwarf.exp
> @@ -906,6 +906,25 @@ namespace eval Dwarf {
>  		    _op .2byte [lindex $line 1]
>  		}
>  
> +		DW_OP_implicit_value {
> +		    set l1 [new_label "value_start"]
> +		    set l2 [new_label "value_end"]
> +		    _op .uleb128 "$l2 - $l1"
> +		    define_label $l1
> +		    foreach value [lrange $line 1 end] {
> +			switch -regexp -- $value {
> +			    {^0x[[:xdigit:]]{2}$} {_op .byte $value}

Nit: we could also match one digit to simplify the usage.  With your
patch, we need to use it like this,


+		    {DW_AT_location {
+			DW_OP_implicit_value 0x01 0x01 0x01 0x01
+		    } SPECIAL_expr}

but if we add "{^0x[[:xdigit:]]{2}$} {_op .byte $value}", the use
above can be simplified,

+                   {DW_AT_location {
+                       DW_OP_implicit_value 0x1 0x1 0x1 0x1
+                   } SPECIAL_expr}

> +			    {^0x[[:xdigit:]]{4}$} {_op .2byte $value}
> +			    {^0x[[:xdigit:]]{8}$} {_op .4byte $value}
> +			    {^0x[[:xdigit:]]{16}$} {_op .8byte $value}
> +			    default {
> +				error "bad value '$value' in DW_OP_implicit_value"
> +			    }
> +			}
> +		    }
> +		    define_label $l2
> +		}
> +

During the review, I am trying to use DW_OP_implicit_value in
gdb.dwarf2/implptr-64bit.exp, because I think we should use this new
added DW_OP as much as we can in existing test case.  I get some troubles
on using Dwarf::assemble for two cus.  I'll let you know once I resolve
the issues there.

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list