* Reading DWARF debug information from a PE executable
@ 2019-04-17 16:21 Artem Razin
2019-04-18 9:17 ` Nick Clifton
2019-04-18 10:12 ` Jan Kratochvil
0 siblings, 2 replies; 5+ messages in thread
From: Artem Razin @ 2019-04-17 16:21 UTC (permalink / raw)
To: gdb
Hi,
This is my first question here and I hope it is suitable for this list.
I need (Windows/C++) to read DWARF debug information from a PE
executable. For example, mingw places debug information in this
format.
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.
Is there any way to pass raw data from these sections to libdwarf to
read debug information?
Or probably there are other ways to work with DWARF in case of PE executables...
Thank you!
--
Best regards,
Artem A. Razin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Reading DWARF debug information from a PE executable
2019-04-17 16:21 Reading DWARF debug information from a PE executable Artem Razin
@ 2019-04-18 9:17 ` Nick Clifton
2019-04-18 9:48 ` Mark Wielaard
2019-04-18 10:12 ` Jan Kratochvil
1 sibling, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2019-04-18 9:17 UTC (permalink / raw)
To: Artem Razin; +Cc: gdb
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Reading DWARF debug information from a PE executable
2019-04-18 9:17 ` Nick Clifton
@ 2019-04-18 9:48 ` Mark Wielaard
2019-04-18 11:19 ` Nick Clifton
0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2019-04-18 9:48 UTC (permalink / raw)
To: Nick Clifton, Artem Razin; +Cc: gdb
On Thu, 2019-04-18 at 10:17 +0100, Nick Clifton wrote:
> 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.
elfutils contains libdw, a library for reading DWARF data and some ELF
and (linux) process introspection functions. libdwarf is its own
project for low level DWARF data:
https://sourceforge.net/projects/libdwarf/
Cheers,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Reading DWARF debug information from a PE executable
2019-04-17 16:21 Reading DWARF debug information from a PE executable Artem Razin
2019-04-18 9:17 ` Nick Clifton
@ 2019-04-18 10:12 ` Jan Kratochvil
1 sibling, 0 replies; 5+ messages in thread
From: Jan Kratochvil @ 2019-04-18 10:12 UTC (permalink / raw)
To: Artem Razin; +Cc: gdb
On Wed, 17 Apr 2019 18:20:58 +0200, Artem Razin wrote:
> Or probably there are other ways to work with DWARF in case of PE
> executables...
liblldb parses DWARF in PE for you with its SB* public C++ and Python API.
(lldb) target create "2.exe"
Current executable set to '2.exe' (x86_64).
(lldb) b main
Breakpoint 1: where = 2.exe`main + 13 at 2.c:4:10, address = 0x000000000040156d
(lldb) p s
(s) $0 = (i = 0)
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-04-18 11:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 16:21 Reading DWARF debug information from a PE executable Artem Razin
2019-04-18 9:17 ` Nick Clifton
2019-04-18 9:48 ` Mark Wielaard
2019-04-18 11:19 ` Nick Clifton
2019-04-18 10:12 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox