我如何在.NET中的线程转储? (一拉JVM线程转储)

编程入门 行业动态 更新时间:2024-10-14 06:22:54
本文介绍了我如何在.NET中的线程转储? (一拉JVM线程转储)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我没有发现任何方式倾倒在堆栈上.NET中的所有线程。既不被发送到处理也不编程方式访问所有线程的信号。我只能得到通过Thread.CurrentThread访问到当前线程。

I have found no way of dumping the stack on all threads in .NET. Neither a signal to be send to the process nor programatic access to all the threads. I can only get access to the current thread via Thread.CurrentThread.

什么花样?

推荐答案

如果你想获得一个堆栈转储,而进程已经运行(一拉jstack),那里描述的here :

If you're trying to get a stack dump while the process is already running (a la jstack), there are two methods as described here:

有一个鲜为人知但有效的工具,称为Managed堆栈管理器的。虽然有基本的图形用户界面,它可以有效地将一个.NET相当于jstack,如果你要添加的路径;那么它的打字只是一个问题:

There is a little-known but effective tool called the Managed Stack Explorer. Although it features a basic GUI, it can effectively be a .NET equivalent of jstack if you add to the path; then it’s just a question of typing:

mse /s /p <pid>

  • 下载并安装相应的调试工具的Windows版本的体系结构(x86 / 64 /安腾)
  • 如果您需要有关Windows函数调用的信息(例如,你想跟踪到内核调用),下载并安装相应的符号。这不是严格必要的,如果你只是想你自己的code线程转储。
  • 如果您需要行号或其他详细信息,请务必将您的程序集PDB文件所在的调试器可以找到它们(通常你只要把他们旁边,你的实际程序集)。
  • 在开始 - >程序 - > Windows调试工具[64] - > WinDbg的
  • 使用菜单将调试器附加到正在运行的进程
  • 加载SOS扩展名.loadby索斯mscorwks为.NET 2.0(.load SOS对.NET 1.0 / 1.1)
  • 使用以一个线程转储!eestack
  • 在分离使用.detach
  • 我只是发现有必要采取生产线程转储,这为我工作。希望它可以帮助: - )

    I just found it necessary to take a production thread dump and this worked for me. Hope it helps :-)

    更多推荐

    我如何在.NET中的线程转储? (一拉JVM线程转储)

    本文发布于:2023-11-13 02:26:31,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1583165.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:线程   一拉   如何在   JVM   NET

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!