This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
working with debug symbols
- From: Nikos Karampatziakis <just dot nikos at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 19 May 2010 01:48:07 -0400
- Subject: working with debug symbols
Hi everyone,
I am working on a project where, ideally, we would like to be able to
say for every byte in the .text section of an (ELF or PE) executable,
whether or not it is part of an instruction or not (i.e. whether it's
code or data). The executables will be compiled with gcc and debugging
information. At which granularity can we extract this information from
the debug symbols? I know it's possible to get back the addresses of
the function entry points. I assume we can also get the address of the
first instruction of most lines in a source file. I would appreciate
some pointers on how to do that. However, a way to tag each address as
code or data would be even better. Finally, will any of these break if
the debug symbols are stored outside the executable?
Thank you,
Nikos