From: Jim Blandy <jimb@redhat.com>
To: Daniel Berlin <dberlin@dberlin.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA]: LOC_COMPUTED + abstracted dwarf2 evaluator, again
Date: Tue, 09 Jul 2002 15:47:00 -0000 [thread overview]
Message-ID: <npfzys35l8.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0207091701280.21763-100000@dberlin.org>
Daniel Berlin <dberlin@dberlin.org> writes:
> > > + if (ctx->in_reg)
> > > + {
> > > + store_typed_address (VALUE_CONTENTS_RAW (retval),
> > > + SYMBOL_TYPE (var), dwarf_expr_fetch (ctx, 0));
> > > + VALUE_LVAL (retval) = not_lval;
> > > + }
> > > + else
> > > + {
> > > + result = dwarf_expr_fetch (ctx, 0);
> > > + VALUE_LAZY (retval) = 1;
> > > + VALUE_ADDRESS (retval) = result;
> > > + }
> >
> > This looks wrong. If evaluating the Dwarf location expression yields
> > an `in_reg' result, shouldn't the value be an lval_register, with its
> > the address set to the register number?
>
> This doesn't work, in reality.
>
> IIRC, you run into problems dereferencing the value, because it
> thinks it *only* lives in a register (IE it's not really a memory
> location), regardless of what you tell it.
>
> I may be misremembering the exact reason why, but I know things don't work
> if you do this, even though it would seem to make sense (I had originally
> written it to do what you suggest).
The `in_reg' case needs to call value_from_register, not explicitly
set the value's `lval' and `address' fields, as I implied. Calling
value_from_register will take care of finding registers that have been
spilled to the stack.
next prev parent reply other threads:[~2002-07-09 22:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-08 11:02 Daniel Berlin
2002-07-08 14:30 ` Jim Blandy
2002-07-08 16:44 ` Daniel Berlin
2002-07-08 19:03 ` Jim Blandy
2002-07-09 14:03 ` Jim Blandy
2002-07-09 14:08 ` Daniel Berlin
2002-07-09 15:47 ` Jim Blandy [this message]
2002-07-09 16:00 ` Daniel Berlin
2003-01-30 23:59 ` Daniel Jacobowitz
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=npfzys35l8.fsf@zwingli.cygnus.com \
--to=jimb@redhat.com \
--cc=dberlin@dberlin.org \
--cc=gdb-patches@sources.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