如何使用windbg告诉UnsafeNativeMethods.DispatchMessageA调用了什么?

时间:2009-09-16 17:22:59

标签: .net unmanaged windbg

我已经找到了这个线程的死锁,不再发送消息了,但是如何更进一步,找出线程目前正在做什么?我正在使用windbg和随机漫步使用!到目前为止还没有给我进行调整

非常感谢

奥斯卡

0:057> !clrstack
OS Thread Id: 0x17f8 (57)
ESP       EIP     
1393f1ac 2070a64a [NDirectMethodFrameStandalone: 1393f1ac] System.Windows.Forms.UnsafeNativeMethods.DispatchMessageA(MSG ByRef)
1393f1bc 04851c91 System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32, Int32, Int32)
1393f258 04851276 System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
1393f2a0 048507e3 System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
1393f2d0 0485062f System.Windows.Forms.Application.Run()

2 个答案:

答案 0 :(得分:1)

!dumpstack 

诀窍,非常详细的堆栈跟踪进入非托管DLL

答案 1 :(得分:0)

kn100 将为您提供本机堆栈,但看起来它正在调用DispatchMessage,这意味着它可能卡在目标窗口的窗口处理程序中(即“OnSize”事件或代码中的内容)

破解MSG结构,以便您可以看到窗口及其尝试发送的消息,然后在代码中找到相应的事件处理程序。