public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Conrad Rad <cse.cem@gmail.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: dwarf_aggregate_size() seems to fall over on pointer types
Date: Wed, 01 Oct 2014 13:15:51 -0400	[thread overview]
Message-ID: <CAG6CVpW-0N9-b+xEax5cuowKTxAKwDntyUB-haaZPmpM3q28FA@mail.gmail.com> (raw)

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

Hi all,

First, I'm not super familiar with DWARF, and perhaps this is a bug in
the DWARF information emitted by Clang (3.4). It's definitely a
difference between GCC and Clang DWARF output.

I've been fiddling with a pahole-alike tool[0] that sits directly on
elfutils (as opposed to libdwarves, which hasn't been updated for some
time and doesn't handle some of the tags Clang emits). I've observed
that dwarf_aggregate_size() doesn't seem to like types that are
pointers or arrays of pointers[1].

I've compiled a small example program, repro, and output[2]:
http://pastie.org/9610702

dwarf_aggregate_size() has no trouble with most member types, or even
pointer types on the output from GCC. However, it returns an error on
Clang's output.

Perhaps Clang is just eliding pointer size information, assuming
consumers will consult the Elf machine class and infer?

Am I missing something? Is this a Clang bug or an elfutils bug?

Thanks much,
Conrad

[0]: https://github.com/cemeyer/structhole/
[1]: https://github.com/cemeyer/structhole/issues/1
[2]: http://pastie.org/9610702

             reply	other threads:[~2014-10-01 17:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 17:15 Conrad Rad [this message]
2014-10-01 17:46 Josh Stone
2014-10-01 18:33 Mark Wielaard
2014-10-01 18:34 Conrad Rad
2014-10-01 18:47 Josh Stone
2014-10-01 19:10 Conrad Rad
2014-10-01 19:23 Conrad Rad
2014-10-01 19:26 Conrad Rad
2014-10-01 20:33 Roland McGrath
2014-10-02 12:05 Mark Wielaard
2014-10-02 12:50 Conrad Rad
2014-10-02 20:56 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=CAG6CVpW-0N9-b+xEax5cuowKTxAKwDntyUB-haaZPmpM3q28FA@mail.gmail.com \
    --to=cse.cem@gmail.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).