public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Roland McGrath <roland@hack.frob.com>
Cc: Richard Henderson <rth@redhat.com>,
	Jason Merrill <jason@redhat.com>,
	       Cary Coutant <ccoutant@google.com>,
	gcc-patches@gcc.gnu.org,
	       Jan Kratochvil <jkratoch@redhat.com>,
	Tom Tromey <tromey@redhat.com>,
	       Mark Wielaard <mjw@redhat.com>
Subject: Re: [RFC PATCH] Typed DWARF stack
Date: Mon, 28 Mar 2011 09:25:00 -0000	[thread overview]
Message-ID: <20110328092045.GH18914@tyan-ft48-01.lab.bos.redhat.com> (raw)
In-Reply-To: <20110325164440.A09BC2C15B@topped-with-meat.com>

On Fri, Mar 25, 2011 at 09:44:40AM -0700, Roland McGrath wrote:
> It's been a while since I read Cary's proposal, and I am no longer
> likely to do much work of my own in this area.  So I'll just respond at
> the high level.
> 
> I like very much the essential notion of the stack being of typed
> entities with no specification of how the consumer actually implements
> it.  In particular, this also brings implicit-pointer into the fold as a
> new type of a stack element, i.e. "imaginary pointer".  Obviously only
> the operations that amount to addition/subtraction with an integer
> actually make sense on such a stack element.  This makes the second
> operand of DW_OP(GNU_)implicit_pointer superfluous (and hence the common
> case of zero a byte smaller), since nonzero cases can just be followed
> by an appropriate DW_OP_plus_uconst or suchlike.

For DW_OP_GNU_implicit_pointer it is too late to remove the parameter now,
because e.g. GCC 4.6 has been shipped with it and several tools have support
for it already.
What we still could do is reword it based on the typed stack, say that
DW_OP_*implicit_pointer pushes an entry of a special type on the stack
and what operations are allowed with that type (from arithmetics
I think only addition of integral stack value to it (leading again to
implicit pointer type) or subtraction of two implicit pointers for the same
DIE, leading to an integral difference.  With that rewording,
DW_OP_GNU_implicit_pointer could be no longer a terminal, but could appear
within the DWARF expressions.
DW_OP_implicit_pointer can of course be designed without the operand.

> As to encoding, I have a fancy idea that I discussed off the cuff at the
> Summit with Jakub and Richard, and still quite like, though I haven't
> fleshed it out any more than I did then.  I hope to inspire someone else
> to actually want to implement it.  It's rather more ambitious than the
> things that Jakub will just add while the rest of us sleep, so I
> wouldn't suggest that such DW_OP_GNU_* extensions be delayed for this
> plan.  But perhaps it can become coherent enough and get done enough to
> seriously propose it for DWARF 5.

I view such encoding changes primarily as compression and thus IMHO
we don't need to delay any changes waiting for the compression technique
specification.  We have DW_OP_call{2,4} right now as a simple compression
technique and can (and should) improve that, but in the mean time we can
just add new ops as we'd normally do.

> As I say, I'm not really working on this stuff any more except maybe for
> (as yet wholly absent) spare time.  But, food for thought.

IMHO the typed stack as Cary proposed is usable as is, and as additional
bonus it is extensible, e.g. by saying that the referenced DIE doesn't
have to be just DW_TAG_base_type, but also this and that (where the
referenced DIE tags could newly be either current tags where we would give
it a particular meaning, or it could be some newly added tag, perhaps just
for that purpose) we could extend it easily.

	Jakub

  reply	other threads:[~2011-03-28  9:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 11:33 Jakub Jelinek
2011-03-25 16:48 ` Roland McGrath
2011-03-28  9:25   ` Jakub Jelinek [this message]
2011-03-25 17:51 ` Cary Coutant
2011-04-16  9:28 ` [PATCH] " Jakub Jelinek
2011-04-29 21:01   ` Jason Merrill
2011-05-03 13:34   ` H.J. Lu
2011-05-08 18:57     ` H.J. Lu
2011-05-04 18:22 ` [RFC PATCH] " Tom Tromey
2011-05-04 18:30   ` Cary Coutant
2011-05-04 18:37   ` Jakub Jelinek
2011-05-04 20:27     ` Tom Tromey
2011-05-12 21:16       ` Tom Tromey
2011-05-12 21:37         ` Tom Tromey
2011-06-09 15:47 ` Typed DWARF stack and convert to untyped Jakub Jelinek
2011-06-09 18:34   ` Jakub Jelinek
2011-06-13 15:34   ` Tom Tromey

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=20110328092045.GH18914@tyan-ft48-01.lab.bos.redhat.com \
    --to=jakub@redhat.com \
    --cc=ccoutant@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=jkratoch@redhat.com \
    --cc=mjw@redhat.com \
    --cc=roland@hack.frob.com \
    --cc=rth@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).