This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Thu, 19 Jan 2017 19:21:36 +0100
- Subject: Re: [PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value
- Authentication-results: sourceware.org; auth=none
- References: <m3o9zcgjys.fsf@oc1027705133.ibm.com> <20170119174339.GP28060@E107787-LIN>
On Thu, Jan 19 2017, Yao Qi wrote:
> 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}
Right, or in this particular case you could say
DW_OP_implicit_value 0x01010101
instead, because the number is endianness-symmetric ;-)
>
> 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}
You probably mean "{^0x[[:xdigit:]]{1,2}$} {_op .byte $value}"? Sure,
will do. The idea behind the existing logic is that the resulting
immediate value always has half as many bytes as there are hex digits.
But for single byte integers I agree that this is a bit picky and the
simplification is useful. I would not extend this to multi-byte
integers, though, such as allowing 0x123456 or such.
> 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.
Sounds good!
> I get some troubles on using Dwarf::assemble for two cus. I'll let
> you know once I resolve the issues there.
OK, let's see how that goes.
--
Andreas