Re: Reading DWARF debug information from a PE executable

Nick Clifton <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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 ([email protected]) since libdwarf is part of that
project.  Or you could try the binutils mailing list ([email protected]) 
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.