From: Daniel Berlin <dan@dberlin.org>
To: gdb@sources.redhat.com
Cc: ac131313@cygnus.com
Subject: Re: dwarf3 and location expressions et. al
Date: Fri, 22 Mar 2002 15:28:00 -0000 [thread overview]
Message-ID: <1016839714.15707.50.camel@localhost.localdomain> (raw)
> I'm wondering if the thing to do is to map (baton, frame) onto a
> ``struct expression'' rather than directly onto a ``struct value''. I'm
> wondering of the CFI stuff should also do this.
CFI definitely can't be supported with the current expression ops.
> Once you have an expression for a variable, it should be possible to use
> existing infrastructure to evaluate or encode it.
Not without adding a few opcodes, and trying to figure out a nice mapping.
I tried this once, and it didn't work out so well.
It also adds another layer.
Since the expressions are built on the fly, we'll end up reading a location expression ,
then converting it, then evaluating it.
Rather than just reading it and evaluating it.
In addition, expression evaluation is language specific.
DWARF2 locations are not.
> This also has the advantage of keeping expresion evaluation in one place
> - if the expression evaluation is ever made asynchronous then there is
> only one evaluator to fix for instance.
You've looked at this from the wrong level.
Expressions in GDB are analogous to language-dependent trees in gcc.
DWARF2 locations are analagous to a mid-level RTL (IE pretend GCC's
RTL was language and machine independent. We'll have a mid-level RTL soon).
The language-dependent trees have type information, and all kinds of language
specific semantics.
mid-RTL has no types, and can be evaluated without any regard to the language
involved.
Same with gdb expressions (language dependent semantics, language specific ops,
type information) vs dwarf2 locations (language independent, no type info).
You don't want to mix layers like you are suggesting.
It leads to evil.
In effect, converting dwarf2 locations to struct expression's and evaluating
would be like converting RTL back to C and compiling it.
reply other threads:[~2002-03-22 23:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1016839714.15707.50.camel@localhost.localdomain \
--to=dan@dberlin.org \
--cc=ac131313@cygnus.com \
--cc=gdb@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