public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [PATCH] libdw: Add dwarf_peel_type. Use it in dwarf_aggregate_size.
Date: Wed, 05 Nov 2014 14:29:40 +0100	[thread overview]
Message-ID: <1415194180.18323.72.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: 1414669664.18323.33.camel@bordewijk.wildebeest.org

[-- Attachment #1: Type: text/plain, Size: 1895 bytes --]

On Thu, 2014-10-30 at 12:47 +0100, Mark Wielaard wrote:
> What would be the correct way to describe that future versions might add
> those to the white list of tags to be peeled? My goal really is to have
> a type peel function that user code can depend on if they need to do
> something like find the underlying return type in the backends or like
> the dwarf_aggregate_size function. So that when DWARFv5 comes out, or
> some new GNU qualifier tag is added, all the user has to do is upgrade
> to a newer elfutils that knows about those.

So how about this description for libdw.h?

+/* For type aliases and qualifier type DIEs follow the DW_AT_type
+   attribute (recursively) and return the underlying type Dwarf_Die.
+   Returns 0 when RESULT contains a Dwarf_Die (possibly equal to the
+   given DIE) that isn't a type alias or qualifier type.  Returns 1
+   when RESULT contains a type alias or qualifier Dwarf_Die that
+   couldn't be peeled further (it doesn't have a DW_TAG_type
+   attribute).  Returns -1 when an error occured.
+
+   The current DWARF specification defines one type alias tag
+   (DW_TAG_typedef) and three qualifier type tags (DW_TAG_const_type,
+   DW_TAG_volatile_type, DW_TAG_restrict_type).  A future version of
+   this function might peel other alias or qualifier type tags if a
+   future DWARF version or GNU extension defines other type aliases or
+   qualifier type tags that don't modify or change the structural
+   layout of the underlying type.  */
+extern int dwarf_peel_type (Dwarf_Die *die, Dwarf_Die *result)
+    __nonnull_attribute__ (2);

That is the only change compared to the original patch. The
implementation and test cases are the same.

Is it clear what the intent of the function is? And when we do extend
the tags that get peeled, do we need to update the function symbol
version?

Thanks,

Mark

             reply	other threads:[~2014-11-05 13:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 13:29 Mark Wielaard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-08 13:18 Mark Wielaard
2014-11-05 16:02 Petr Machata
2014-10-30 11:47 Mark Wielaard
2014-10-10 21:45 Roland McGrath
2014-10-10 21:30 Josh Stone
2014-10-10 18:42 Roland McGrath
2014-10-06 20:29 Mark Wielaard

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=1415194180.18323.72.camel@bordewijk.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /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).