Get CLR call stack in dump analysis

Just found how to get the call stack while analysis dump file.

Just confused the call stack is the same while running analyze -v, it's native call stack.

When I try !clrstack, it show the current thread is not managed thread, when I navigate to managed thread by ~threadId, it throw the exception either.

 

Now, I got the work around to get the CLR call stack:

~*e!clrstack

 

Check the threads

!threads

 

List the threads that have managed code:
!threads

Select current thread:
~[n]s, e.g. ~11s

Get the callstack in the active thread of a managed app:
!clrstack

The same for all threads:
~*e !clrstack

Get the whole stack of a managed app (current thread):
!dumpstack

Dump all the managed objects that are currently on the stack:
!dumpstackobjects

Dump all the managed objects that are currently in the heap:
!dumpheap -stat

Getting the value of a member variable
find the address of the container object using !dumpstackobjects, e.g.

0:008> !dumpstackobjects
Thread 8
ESP/REG    Object     Name
edx        0x44a7d98 System.Single[]
0x6bafaec 0x444c4c0 System.Threading.Thread
0x6bafaf4 0x444c4c0 System.Threading.Thread
0x6bafafc 0x444c46c Project1.ThreadManager
0x6bafb00 0x44a7d80 Project1.USBHardware/DownloadPointsToUsbParams
0x6bafd6c 0x444c4a4 System.Threading.ThreadStart

and then type

!dumpobj 0x444c46c

(for the ThreadManager object)

print the help for the sos extension
!clr10/sos.help   

Setting a managed breakpoint to a function call:
!bpmd <modulename> <functionname> 


!PrintException (sos2.0)

 

 

 

GO fighting windbg!

 

reference:

https://sites.google.com/site/jozsefbekes/Home/windows-programming/windbg

 

#    General starter: http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx
#    Good description: http://msdn.microsoft.com/msdnmag/issues/05/07/Debugging/ 
#    Managed: http://msdn.microsoft.com/msdnmag/issues/0 
#    Crash dump analyzis: http://www.dumpanalysis.org/blog/index.php/2006/10/30/crash-dump-analysis-patterns-part-1/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值