This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regarding Map Files


"Sachin O. Agrawal" <sachin_agrawal@persistent.co.in> writes:

> > > Actually my intention is to find the functions and approximate
> > > range of line numbers in sources given an address.
> > 
> > Look at addr2line.
> 
> This works only when debugging info is available.

My understanding is that you want to get the stack backtrace from
units in the field, which you then analyze yourself.  So just build
the executable with full debugging information, and then strip the
version that you send out.  When you get a stack backtrace from the
field, use the executable you saved which has the full debugging
information.

If that is unacceptable for some reason, then you can indeed use the
map file to map addresses to functions.  Personally, I think the
format is pretty obvious, but then I'm obviously biased.  Each output
section is listed starting in column 0, with name, VMA, and size.
Each input section is listed starting in column 1 with section name,
VMA, size, and input file name.  Each global symbol is listed with
nothing in the first column, then the VMA and the symbol name.

Just pick some address, and find it in the map file.  You'll see the
file and section it came from, and the global symbols from that file
with their address.

If you still don't get it, ask a specific question rather than a
general one.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]