From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Daniel Berlin <dan@cgsoftware.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Add support for tracking/evaluating dwarf2 location expressions
Date: Tue, 22 May 2001 12:46:00 -0000 [thread overview]
Message-ID: <npae452mkb.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <87heye17ck.fsf@dynamic-addr-83-177.resnet.rochester.edu>
Daniel Berlin <dan@cgsoftware.com> writes:
> However, IMHO, the location expression language that dwarf2 uses is
> self-contained, and suited for GDB's needs. Perfectly in fact. It
> provides no more or less than necessary to describe our locations,
> except where it saved a little space in real use (see below) and
> it's trivial to convert other expression languages into it. and The
> location list is simply a list of ranges and location expressions,
> which is what we would have come up with anyway, judging from GDB structures.
>
> In fact, I'd wager if we tried, we'd come up with something almost
> exactly like d2 location expressions:
>
> We would want some kind of simple, stack based language.
> Normal binary and unary arithmetic operations, and normal stack
> operations (rotate, pop, drop, etc).
> Past these, we'd want a way of:
> dereferencing the value on top of the stack as if it was a memory address.
> A way to load constant values onto the stack
> A way to load register values onto the stack
> An efficient encoding, able to handle differing sizes for data types
> on different platforms.
Yes, you're right --- what we'd come up with would be very similar to
Dwarf 2 location expressions.
> Why bother not just using something we already have a standard for,
> if it's going to 99.9% the same?
There's nothing technically wrong with using Dwarf 2 location
expressions and location lists internally in GDB. We could do a
perfectly correct implementation that would work fine. When I say
`self-contained', I'm not talking about the implementation; I'm more
concerned with modularity, and who has control of the definition.
I'm not sure how to put this convincingly. Let me try to draw an
analogy with another problematic area. GDB stores the machine's
registers as a big block of bytes. The layout of GDB's register file
is the same as the layout of the 'G' packet. While there's nothing
technically wrong with this, it's ended up being a technical
nightmare, because whenever we want to do something reasonable with
GDB's internal register file, we have to worry about the remote
protocol.
Using a common structure there simplified the remote protocol code,
but it also introduced a binding (in the mechanical sense, of things
rubbing against each other in a way that prevents the machine from
operating smoothly) between the remote protocol and GDB's internals
that has been a pain in the neck.
I don't want to introduce this sort of binding between GDB's debug
readers and its expression evaluator, by requiring that they use the
same representation for location expressions.
I admit that this is a very touchy-feely argument. If the other
maintainers don't share my sense of unease with using Dwarf 2 location
expressions directly in GDB, then I'll drop the objection.
next prev parent reply other threads:[~2001-05-22 12:46 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-30 11:11 Daniel Berlin
2001-03-30 15:36 ` Andrew Cagney
2001-03-30 18:53 ` Daniel Berlin
2001-04-06 11:53 ` Andrew Cagney
2001-04-06 12:10 ` Daniel Berlin
2001-04-06 12:36 ` Kevin Buettner
2001-04-06 23:18 ` [PATCH] Add support for tracking/evaluating dwarf2 locationexpressions Daniel Berlin
2001-05-21 14:46 ` [PATCH] Add support for tracking/evaluating dwarf2 location expressions Jim Blandy
2001-05-21 18:49 ` Daniel Berlin
2001-05-22 12:46 ` Jim Blandy [this message]
2001-05-22 13:51 ` Daniel Berlin
2001-05-22 23:14 ` Jim Blandy
2001-05-23 8:51 ` Daniel Berlin
2001-05-23 11:53 ` Daniel Berlin
2001-05-23 21:53 ` Jim Blandy
2001-05-23 22:56 ` Daniel Berlin
2001-06-06 9:07 ` Andrew Cagney
2001-06-06 9:46 ` Daniel Berlin
2001-06-07 7:29 ` Andrew Cagney
2001-03-30 13:49 David Taylor
2001-03-30 14:42 ` Daniel Berlin
2001-03-30 15:14 ` Andrew Cagney
2001-03-30 18:44 ` Daniel Berlin
2001-03-30 15:23 ` Elena Zannoni
2001-03-30 15:24 ` Andrew Cagney
2001-03-30 18:46 ` Daniel Berlin
2001-04-06 12:02 ` Andrew Cagney
2001-04-06 12:40 ` Daniel Berlin
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=npae452mkb.fsf@zwingli.cygnus.com \
--to=jimb@zwingli.cygnus.com \
--cc=dan@cgsoftware.com \
--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