[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.4.2 Map File Format

Map file has a very simple format. Currently the map file is created by piping output from the `nm' program through an AWK script, but you can write other tools that create `.map' files. That's why I'll describe the format of map file in details. Even more details you can gather from the source code, as always.

The map file is a plain text file. Lines that start with `#' or `;' are ignored. Otherwise each line starts with an letter that identifies which type of information is presented on that line. Here is a list of all identificators, what they mean, and what information is expected on that line.

O string
Memory Debugger [O]ptions. Example:

 
O aslbL

S hexnum string
[S]ource module start. The hexnum parameter defines the start address of the object module in hexadecimal; the string is just the source file name. Example:

 
S 10038 /home/andy/CS/memdbg/test.cpp

F hexnum string
[F]unction start. The hexnum parameter defines the hexadecimal function address; the string is the function name. Example:

 
F 10370 output(char const*,...)

L hexnum decnum
This denotes a [L]ine number. The hexnum parameter is the hexadecimal address of the line, the decnum is the line number (in decimal). Example:

 
L 10071 11

D hexnum-a hexnum-b A|F
This command is for advanced users only. It is not written by `memdbg.sh' script, and is inserted manually by you using an editor. The first hexadecimal number (hexnum-a) is the address of memory block, the second (hexnum-b) is the address inside your executable. The literal flag `A' or `F' means to invoke a debug breakpoint either during allocation of deallocation (freeing) of that block. On Intel x86 architecture this is the `int 3' instruction. This feature can be used to track very specific bugs. Example:

 
D 32b70 10370 A

The addresses for the `S', `F', and `L' keywords should be sorted in increasing order; i.e. the memory debugger supposes that all lines are pre-sorted by increasing value of their address. Otherwise you will get very strange line references (or hexadecimal addresses like at the end of previous section).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html