goldshtn / msos

Command-line environment a-la WinDbg for executing SOS commands without having SOS available.
Other
96 stars 21 forks source link

Can I use msos to get the thread dump for the threads #70

Closed madhub closed 7 years ago

madhub commented 7 years ago

Hi I like the java tools which allows to dump thread stack for all the thread running in a java process. example jstack -l or jcmd 37320 Thread.print. Can I use the same using msos.exe .

Madhu

Pavel-Durov commented 7 years ago

what about
!StackTree Display a stack tree of all the target's threads.

Example: msos --pid 10580 -c "!StackTree"

It displays a tree that aggregates all call stacks for all threads in the target, such that multiple threads that have the same call stack (or a part thereof) are displayed only once.

goldshtn commented 7 years ago

Indeed, !StackTree is an option. But generally speaking msos is a bit of an overkill for this. If you just want a stack dump of all the managed threads, I'd write a 15-line program that enumerates ClrRuntime.Threads and prints the ClrThread.StackTrace for each of them.