This is the mail archive of the
mailing list for the binutils project.
pulling DWARF info from GDB
- From: K Jski <bielsk1 at vt dot edu>
- To: Binutils <binutils at sourceware dot org>
- Cc: Antonio Barbalace <antoniob at vt dot edu>
- Date: Wed, 17 Jun 2015 15:55:25 -0400
- Subject: pulling DWARF info from GDB
- Authentication-results: sourceware.org; auth=none
I'm working on a research project involving inquiring a binary about
its DWARF info in order to get a better idea of whats on the stack at
runtime when a function is being executed.
The end goal is to re-write the current stack frame on the different
computer and continue execution, and when the function finishes, to
then return and populate the next stack frame (the parent function)
onto the target systems stack and again resume execution.
Doing (readelf -wia) on the compiled binary (with the -g and -rdynamic
option when compiling) can reveal the information definitely relevant
to me especially
sections. This gives the compile_unit (I actually dont know what this
means or its significance) the DW_TAG_subprogram (functions in the
program), DW_TAG_formal_parameters (function params of a given func),
and DW_TAG_variable (a function's local vars)
The source base of gdb is pretty big, I've narrowed it down to the
dwarf2____.c files in binutils/gdb
and also took a look at binutils/gold/dwarf_reader.cc for help.
Could someone explain what objects/containers/things hold this info
and what functions populate these structures with the DWARF info? This
would save me a lot of trouble of writing my own parser,
Graduate Student @ Virginia Tech.