Is there a way to get the stacktraces for all threads in c#, like java.lang.Thread.getAllStackTraces()?

后端 未结 5 639
遥遥无期
遥遥无期 2020-12-08 10:20

In java it is possible to get a snapshot of the stacktraces of all running threads. This is done with java.lang.Thread.getAllStackTraces() (it returns Map

5条回答
  •  情话喂你
    2020-12-08 10:35

    You can loop on System.Diagnostics.Process.GetCurrentProcess().Threads and for each Thread create a StackTrace object with the .ctor that takes a Thread as its param.

提交回复
热议问题