jstack 相当于 C++
jstack 对我检查实时运行进程的堆栈跟踪非常有帮助。
C++ 中有没有任何工具可以完成这项任务。 我正在使用 Solaris/GCC 编译器。
实际上GDB/DBX可以做到这一点。 但我的进程有时会挂起,这种情况很少发生。 因此,当它挂起时,我想知道哪里出了问题。 只需在现场跟踪即可。
谢谢 库马尔
jstack is very helpful to me in checking stack traces of live running processes.
Is there any tool in C++ to do this task. I am working with Solaris/GCC compilers.
Actually GDB/DBX can do that. But my process is hanging some times that to very rarely. So when that is hanging I want to know where it is going wrong. Just track that in live.
Thanks
D. L. Kumar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
承租人...在Solaris上,无法使用gdb...我认为您正在寻找的是“pstack”
在我的 Solaris 8 系统上,它位于
并
显示了一个很好的相关工具列表,您可能会发现在诊断中非常有用。
Lessee... on solaris, can't use gdb... I think what you're looking for is 'pstack'
On my solaris 8 system it's located at
and
shows a nice list of related tools you may find very useful in diagnosis.
我相信 GDB 也有这种能力,请参阅 gdb 文档以获取相同的信息
I believe that GDB has that capability too, refer gdb documentation for the same
考虑到您在 Solaris 上运行,并且您不想使用 GDB,DTrace 似乎是明显的剩余解决方案。
但您是否可能因为错误的原因而拒绝 GDB? 您可以将 GDB 附加到现有的挂起进程。
Considering you are running on Solaris, and you don't want to use GDB, DTrace seems the obvious remaining solution.
But are you perhaps dismissing GDB for the wrong reasons? You can attach GDB to existing hanging processes.
几年前,我在 DDJ 上写了一篇关于在 Windows 和 Unix/Linux 中转储 C/C++ 堆栈的文章。 也许它对您有帮助:
请参阅http://www.ddj.com/architect/185300443
I wrote a article about dumping the stack in C/C++ with Windows and Unix/Linux at DDJ some years ago. Maybe it helps you:
See http://www.ddj.com/architect/185300443