Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Artem Razin <artem.razin@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Reading DWARF debug information from a PE executable
Date: Thu, 18 Apr 2019 09:17:00 -0000	[thread overview]
Message-ID: <aca58c1d-db5a-6c3e-b29b-ed5cba3e8a1d@redhat.com> (raw)
In-Reply-To: <CACS3OuTF87Mg9VkxfE8NsnTU2dcyV1EptjDmVnEj3EJ11boXxA@mail.gmail.com>

Hi Artem,

> This is my first question here and I hope it is suitable for this list.

Actually you might find it more helpful ask this question on the elfutils
mailing list (elfutils-devel@sourceware.org) since libdwarf is part of that
project.  Or you could try the binutils mailing list (binutils@sourceware.org) 
as the facilities that you are asking for are available in the BFD library, 
which is part of the binutils project.


> I've tried to adopt libdwarf but it seems to be able to read files in
> ELF format only. At the same time mingw places debug information to
> several PE sections.

One possible solution - albeit rather of a hack - is to extract the debug
sections from the PE file and then insert them into an ELF file and the
use libdwarf to examine them.

> Or probably there are other ways to work with DWARF in case of PE executables...

Check out the BFD library from the binutils project.  It has the ability
to read PE format files, and to traverse the debug information in them.
For example the objdump utility from the binutils project supports a -w
command line option to display debug information which works even on PE
format files.

Cheers
  Nick



  reply	other threads:[~2019-04-18  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 16:21 Artem Razin
2019-04-18  9:17 ` Nick Clifton [this message]
2019-04-18  9:48   ` Mark Wielaard
2019-04-18 11:19     ` Nick Clifton
2019-04-18 10:12 ` Jan Kratochvil

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=aca58c1d-db5a-6c3e-b29b-ed5cba3e8a1d@redhat.com \
    --to=nickc@redhat.com \
    --cc=artem.razin@gmail.com \
    --cc=gdb@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