public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Luke Diamand <luke@diamand.org>
To: elfutils-devel@sourceware.org
Cc: Roland McGrath <roland@hack.frob.com>
Subject: dwfl_link_map_report() on a core file with sysroot? Opens the wrong solibs?
Date: Thu, 13 Dec 2018 20:27:00 -0000	[thread overview]
Message-ID: <CAE5ih7_VNLQ4C8GKgt4vZL0CGeCyoxOqsbkfYZhV4QNii2C6Pw@mail.gmail.com> (raw)

I'm trying to get callstacks out of a core file using libdwfl where
the ELF files live in a sysroot (and are from a different
architecture, ARM).

I'm possibly doing something stupid as I find that
dwfl_link_map_report() opens /lib/libpthread.so on the *host* rather
than the libpthread.so from my sysroot. It obviously doesn't then get
very far.

I called elf_begin(), dwfl_begin() and then dwfl_core_file_report(),
passing in the path to the executable (in the sysroot).

There's a comment in link_map.c around line 390 which says:

// XXX hook for sysroot

So inspired by this, I hacked in some code to open files relative to
my sysroot and it all started working.

Am I just missing some obvious setup, or is this just missing sysroot support?

Thanks!
Luke

             reply	other threads:[~2018-12-13 20:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 20:27 Luke Diamand [this message]
     [not found] ` <CAORpzuOC4yGnrbtYjD=kxhJ-ytfJ0tQ3+iDq1NPZ9g8jenVi0g@mail.gmail.com>
2018-12-14 13:44   ` Luke Diamand
2019-01-06 21:04     ` Mark Wielaard
2019-01-06 22:04       ` Luke Diamand

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=CAE5ih7_VNLQ4C8GKgt4vZL0CGeCyoxOqsbkfYZhV4QNii2C6Pw@mail.gmail.com \
    --to=luke@diamand.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=roland@hack.frob.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).