Game Development Reference
In-Depth Information
0004:00000000 00000168H .idata$2
DATA
0004:00000168 00000014H .idata$3
DATA
0005:00000000 00000370H .rsrc$01
DATA
Address
Publics by Value
Rva+Base
Lib:Object
0001:00000b80 ??0GameApp@@QAE@XZ 00401b80 f GameApp.obj
0001:00000ca0 ??_EGameApp@@UAEPAXI@Z 00401ca0 f i GameApp.obj
0001:00000ca0 ??_GGameApp@@UAEPAXI@Z 00401ca0 f i GameApp.obj
0001:00000d10 ??1GameApp@@UAE@XZ 00401d10 f GameApp.obj
0001:00000e20 ?OnClose@GameApp@@UAEXXZ 00401e20 f GameApp.obj
0001:00000ec0 ?OnRun@GameApp@@UAE_NXZ 00401ec0 f GameApp.obj
0001:00001a10 ??0CFileStatus@@QAE@XZ 00402a10 f i GameApp.obj
0001:00001d00 ?OnIdle@GameApp@@UAEHJ@Z 00402d00 f GameApp.obj
0001:00001e30 ?Update@GameApp@@UAEXK@Z 00402e30 f GameApp.obj
The file maps the entire contents of the process as it is loaded into memory. The first
section describes global data. The second section, which is much more interesting
and useful, describes the memory addresses of methods and functions in your game.
Notice first that the symbol names are munged. These are the actual names of the
methods after the C++ symbol manager incorporates the class names and variable
types into the names. The number that appears right after the name is the actual
memory address of the entry point of the code. For example, the last function in
the MAP file is ?Update@GameApp@@UAEXK@Z and is loaded into memory address
0 × 00402e30. You can use that information to track down crashes.
Have you ever seen a crash that reports the register contents? Usually you
'
ll see the
entire set of registers: EAX, EBX, and so on. You
ll also see EIP, the extended instruction
pointer. You may have thought that this dialog box was nothing more than an annoy-
ance
'
a slap in the face that your program is flawed. Used with the MAP file, you can at
least find the name of the function that caused the crash. Here
'
s how to do it:
1. Assume the crash dialog reported an EIP of 0x00402d20.
2. Looking at the MAP file above, you
ll see that GameApp::OnIdle has an entry
point of 0 × 00402d00 and GameApp::Update has an entry point of
0 × 00402e30.
3. The crash thus happened somewhere inside GameApp::OnIdle , since it is
located in between those two entry points.
'
A debugger uses a much more complete symbol table. For example, Visual Studio
stores these symbols in a PDB file, or program database file. That ' s one of the reasons
it
'
s so huge
because it stores symbolic information of every identifier in your
 
Search WWH ::




Custom Search