我错误地运行了 kd 并得到了一些让我感兴趣的输出,这是对我模块中的一行代码的引用,我在任何线程的调用堆栈上都看不到。这些行不是方法的开始,所以我不认为引用是对函数指针的引用,但可能是异常存储在内存中的结果???当然,这恰好是我正在寻找的......
更新:
异常的堆栈跟踪是:
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
并进入我们的代码(创建一个新的 Form 派生类)
dds 输出:
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
这似乎表明 Initialize 正在被调用,即使它不在此异常或任何线程的堆栈跟踪中。正如建议的那样,这可能都是 pdbs 和 dll 之间的不匹配,但我们最终使用正确的类和方法似乎是一个巧合