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/