This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Stack traces and sections
- From: Piotr Wyderski <piotr dot wyderski at gmail dot com>
- To: cygwin-developers at cygwin dot com
- Date: Mon, 2 Feb 2009 16:24:11 +0100
- Subject: Stack traces and sections
I would like to add stack traces to my program. I've already implemented
a stack walker, but there is an open problem with symbol name/line lookup.
The compiler (GCC 4.4-trunk) emits DWARF2-compatible debug information,
but I don't know how to reach the appropriate sections (especially
".debug_info")
within the executable. The PE header walker is able to dump PE sections, but
they have strange, numeric names, e.g.:
sec[0]: name = .text
sec[1]: name = .data
sec[2]: name = .rdata
sec[3]: name = .bss
sec[4]: name = .idata
sec[5]: name = /4
sec[6]: name = /19
sec[7]: name = /35
sec[8]: name = /47
sec[9]: name = /61
sec[10]: name = /73
sec[11]: name = /86
sec[12]: name = /97
sec[13]: name = /108
On the other hand, the DWARF sections are available in the file -- a hexdump
viewer can locate them, as well as objdump. Could somebody please tell me
what should I do in order to get to the DWARF sections from this point?
Any documentation will be appreciated.
Best regards,
Piotr Wyderski