public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: SASHA NICOLAS DA ROCHA PINHEIRO <darochapinhe@wisc.edu>,
	"elfutils-devel@sourceware.org" <elfutils-devel@sourceware.org>
Subject: Re: Compilation Unit name
Date: Thu, 16 Mar 2017 22:06:00 -0000	[thread overview]
Message-ID: <705c6c77-fd79-004a-c744-7b534f38e4ed@redhat.com> (raw)
In-Reply-To: <BN3PR0601MB134557C258B4A3CCF22ABACDA6260@BN3PR0601MB1345.namprd06.prod.outlook.com>

On 03/16/2017 03:03 PM, SASHA NICOLAS DA ROCHA PINHEIRO wrote:
>     /* Iterate over the compilation-unit headers. */
>     size_t cu_header_size;
>     for(Dwarf_Off cu_off = 0, next_cu_off;
>         dwarf_nextcu(dbg, cu_off, &next_cu_off, &cu_header_size,
>             NULL, NULL, NULL) == 0;
>         cu_off = next_cu_off)
>     {
>         cerr << "Error message:" << dwarf_errmsg(-1) << endl;
>         Dwarf_Die cu_die, *cu_die_p;
>         cu_die_p = dwarf_offdie(dbg, next_cu_off /*cu_die_off*/, &cu_die);

I don't understand why you're using next_cu_off here.

The die offset is cu_off + cu_header_size.

Also, when you get around to it, note there's a different
dwarf_offdie_types when you're parsing .debug_types.

  reply	other threads:[~2017-03-16 22:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 22:04 SASHA NICOLAS DA ROCHA PINHEIRO
2017-03-16 22:06 ` Josh Stone [this message]
     [not found]   ` <BN3PR0601MB13452A525FF7EB29DC862A90A6260@BN3PR0601MB1345.namprd06.prod.outlook.com>
2017-03-17  0:29     ` Josh Stone
2017-03-17 17:18       ` SASHA NICOLAS DA ROCHA PINHEIRO
2017-03-17 17:37         ` Josh Stone
2017-03-17 16:07   ` SASHA NICOLAS DA ROCHA PINHEIRO

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=705c6c77-fd79-004a-c744-7b534f38e4ed@redhat.com \
    --to=jistone@redhat.com \
    --cc=darochapinhe@wisc.edu \
    --cc=elfutils-devel@sourceware.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).