views:

228

answers:

4

Is there a way to view the register contents in each stack frame in a crash dump? The registers window seems to contain the registers when the exception occurred but it would be useful to be able to see their contents in each stack frame.

+1  A: 

After doing some research and thinking about this a bit, I realized that it is probably not possible. A crash minidump saves certain areas of process memory (depending on the flags passed to the MiniDumpWriteDump() function) and enough state information to re-create the environment where the crash happened in a debugger. It does not have the processor state at each instruction or even at each stack frame, it only knows about the processor state when the exception occurred.

Ferruccio
A: 

I don't think you can get it either when debugging. The only value you can get from registers is their value at the current instruction.

Emmanuel Caradec
+1  A: 

Depending on the calling convention, you can get some of the registers which are saved on the stack. For example, in the cdecl calling convention, all of the registers except for EAX, ECX, and EDX are required to be saved, either by the caller or the callee. Those three registers are clobberable, so you generally won't be able to get their values from higher up in the call stack. If a function doesn't use a register that must be saved, then it won't save it, but since it doesn't use it, that register has the same value in the next higher stack frame.

Adam Rosenfield
A: 

In optimized builds, it's true that some information down the stack may get tossed, however, you can ask the debugger to try and show you the information for a given stack frame. First do "kn" to see the stack with frame numbers, then try ".frame /c [frame]" or ".frame /r [frame]".

Check out the help (".hh") for more information.

Dan T