Game Development Reference
In-Depth Information
'
s also a really useful command that will let you step out of a
current function (Shift-F11) without having to watch each line execute.
n Setting the instruction pointer: This takes a little care to use properly, since
you can mess up the stack. I like to use it to skip over function calls or skip back
to a previous line of code so that I can watch it execute again.
respectively). There
As we run through some debugging techniques I
'
ll refer to these windows and
actions. If you don
t know how to do them in your debugger, now is a good time to
read the docs and figure it out.
'
Installing Windows Symbol Files
If you ' ve ever had a program crash deep in some Windows API call, your call stack
might look like this:
ntdll.dll!77f60b6f()
ntdll.dll!77fb4dbd()
ntdll.dll!77f79b78()
ntdll.dll!77fb4dbd()
Useless, right? Yes, that call stack is useless, but only because you didn
t install the
Windows symbol files. Even though I write letters to Bill Gates every day, Microsoft
still hasn
'
t published the source code for pretty much anything they ever wrote. Yet
they have, in their infinite wisdom, graciously supplied the next best thing.
You can install the debug symbols for your operating system, and that indecipherable
call stack will turn into something you and I can read. Here ' s the same debug stack
after the debug symbols have been installed:
'
ntdll.dll!_RtlDispatchException@8() + 0x6
ntdll.dll!_KiUserExceptionDispatcher@8() + 0xe
00031328()
ntdll.dll!ExecuteHandler@20() + 0x24
ntdll.dll!_KiUserExceptionDispatcher@8() + 0xe
000316f4()
ntdll.dll!ExecuteHandler@20() + 0x24
ntdll.dll!_KiUserExceptionDispatcher@8() + 0xe
00031ac0()
You might not know exactly what that call stack represents, but now you have a
function name to help you, so you can search the Web or MSDN for help, whereas
before you installed the debug symbols, you had nothing but a number.
 
 
Search WWH ::




Custom Search