What does the windbg command "kd" do?

Posted by Oskar on Stack Overflow See other posts from Stack Overflow or by Oskar
Published on 2009-05-06T14:46:02Z Indexed on 2010/03/19 21:41 UTC
Read the original article Hit count: 274

Filed under:
|

I ran kd by mistake and got some output that inteerested me, a reference to a line of code in my module that I can't see on the call stack of any thread. The lines weren't the beginnning of the method so I don't think the reference is to a function pointer, but possibly the result of an exception being stored in memory??? Of course, that happens to be what I'm looking for...

Update:

The stack trace of the exception is:

0:000> kb
   *** Stack trace for last set context - .thread/.cxr resets it
ChildEBP RetAddr  Args to Child              
0174f168 734ea84f 2cb9e950 00000000 2cb9e950 kernel32!LoadTimeZoneInformation+0x2b
0174f1c4 734ead92 00000022 00000001 000685d0 msvbvm60!    RUN_INSTMGR::ExecuteInitTerm+0x178
0174f1f8 734ea9ee 00000000 0000002f 2dbc2abc msvbvm60!    RUN_INSTMGR::CreateObjInstanceWithParts+0x1e4
0174f278 7350414e 2cb9e96c 00000000 0174f2f0 msvbvm60!    RUN_INSTMGR::CreateObjInstance+0x14d
0174f2e4 734fa071 00000000 2cb9e96c 0174f2fc msvbvm60!RcmConstructObjectInstance+0x75
0174f31c 00976ef1 2cb9e950 00591bc0 0174fddc msvbvm60!__vbaNew+0x21

and into our code (create a new Form derived class)

the dds output:

0:000> dds esp-0x40 esp+0x100
0174f05c  00000000
0174f060  00000000
0174f064  00000000
0174f068  00000000
0174f06c  00000000
0174f070  00000000
0174f074  00000000
0174f078  00000000
0174f07c  00000000
0174f080  00000000
0174f084  00000000
0174f088  00000000
0174f08c  00000000
0174f090  00000000
0174f094  00000000
0174f098  00000000
0174f09c  007f4f9b ourDll!formDerivedClass::Form_Initialize+0x10b [C:\Buildbox\formDerivedClass.frm @ 1452]

etc

which seems to indicate that Initialize is being called even though it isn't on the stack trace of either this exception or any of the threads. As suggested, it might all be a mismatch between pdbs and dlls, but it seems a coincidence that we end up in the right classes and methods

© Stack Overflow or respective owner

Related posts about WinDbg

Related posts about exception