Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: FYI: fix big-endian bug with DWARF_VALUE_STACK
Date: Tue, 23 Feb 2010 20:26:00 -0000	[thread overview]
Message-ID: <m34ol7zok6.fsf@fleche.redhat.com> (raw)
In-Reply-To: <201002231953.o1NJrk3x018019@d12av02.megacenter.de.ibm.com> 	(Ulrich Weigand's message of "Tue, 23 Feb 2010 20:53:46 +0100 (CET)")

>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:

Tom> +	    store_unsigned_integer (contents + offset, n,
Tom> +				    gdbarch_byte_order (c->arch),
Tom> +				    p->v.expr.value);

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".

The archives seem to be closed to the public, but if you are a
subscriber you can see:

    http://lists.dwarfstd.org/htdig.cgi/dwarf-discuss-dwarfstd.org/2009-June/000760.html

I think the same has to apply to your example.

Ulrich> Why would that code look at gdbarch_addr_bit at all?  I think this
Ulrich> should simply do something like:

Ulrich> 	    store_unsigned_integer (contents + offset, p->size,
Ulrich> 				    gdbarch_byte_order (c->arch),

Yeah ... I took another look and I still don't understand that use in
read_pieced_value.  Maybe a complaint is in order here.

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.

Tom


  reply	other threads:[~2010-02-23 20:26 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 [this message]
2010-02-24 14:12     ` Ulrich Weigand
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=m34ol7zok6.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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