This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Extracting disassembled code for selected source lines from debug info
- From: Ulf Magnusson <ulfalizer at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 18 Feb 2013 08:16:48 +0100
- Subject: Extracting disassembled code for selected source lines from debug info
Hi,
I'm thinking of writing a Vim plugin for rapid inspection of compiled
code. It would let you select lines of source code and view the
corresponding disassembled code from the object file.
To implement the plugin, source files could be mapped to object files
e.g. by searching for foo.o when the source file is foo.c in the
simplest case. The tricky part is getting the disassembled code for
the selected lines from the object file. objdump with --line-numbers
would be doable, but would require a bit of parsing, and would not be
robust if the output format of objdump might change.
Any suggestions for other libraries or tools that I could use?
(I realize there's caveats related to inlining and the like. You would
have to keep that in mind when using the plugin.)
Thanks,
Ulf