From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: FYI: fix big-endian bug with DWARF_VALUE_STACK
Date: Wed, 24 Feb 2010 14:12:00 -0000 [thread overview]
Message-ID: <201002241411.o1OEBrHC011378@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <m34ol7zok6.fsf@fleche.redhat.com> from "Tom Tromey" at Feb 23, 2010 01:26:17 PM
Tom Tromey wrote:
> >>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:
> Ulrich> The original code looks broken to me too. But even the new code
> Ulrich> doesn't seem quite right: if the requested piece size p->size
> Ulrich> is larger than addr_size, the remaining bytes of the output value
> Ulrich> are left undefined (well, probably zeroed -- but that still doesn't
> Ulrich> look correct on a big-endian machine ...).
>
> I asked about a similar case on dwarf-discuss, namely what if you have:
>
> DW_OP_implicit_value[len=5] DW_OP_piece[len=10]
>
> The answer I got was something along the lines of "that is undefined,
> don't do that".
This seems somewhat different in that the DW_OP_implicit_value explicitly
provides data of a certain length. On the other hand, DW_OP_stack_value
refers to the value on top of the stack, which -as I understand it- is a
numerical value, not a sequence of bytes of defined length.
So it would seem to me that you should be able to request that this value
be represented in any arbitrary length ...
However, maybe I'm missing something here, in particular as I haven't been
able to find a formal specification of DW_OP_stack_value -- I assume this
is in the current DWARF4 draft? Is this available somewhere?
> Tom> @@ -476,19 +474,17 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
>
> Ulrich> Similiary here; why does this not simply use value_from_longest?
>
> It didn't occur to me; but AFAIK, nothing prohibits a DWARF expression
> from using DW_OP_stack_value to fill in a structure or union, and
> value_from_longest won't work in that case.
OK, good point, so you'd have to use store_unsigned_integer directly.
Still, the reference to ctx->addr_size seems odd to me ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2010-02-24 14:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 16:08 Tom Tromey
2010-02-23 16:16 ` Tom Tromey
2010-02-23 19:53 ` Ulrich Weigand
2010-02-23 20:26 ` Tom Tromey
2010-02-24 14:12 ` Ulrich Weigand [this message]
2010-02-24 14:20 ` Mark Wielaard
2010-02-24 16:10 ` Ulrich Weigand
2010-02-24 16:30 ` Tom Tromey
2010-02-25 20:44 ` Ulrich Weigand
2010-02-25 21:03 ` Tom Tromey
2010-02-26 12:50 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201002241411.o1OEBrHC011378@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox