DebugBreak相当于Java? [英] DebugBreak equivalent in Java?

查看:124
本文介绍了DebugBreak相当于Java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在Win32中有<$ c $($)

我在寻找一种从Java代码中进入调试器的方法,而不需要在IDE中设置断点。 c> DebugBreak(),在C#中有 DebugBreak()等效于C# a>,但是我在Java中找不到任何东西。



我正在努力做什么:说我有一个等待30秒超时,但在正常情况下该等待应该始终为< 1s。我想使用 ByteMan 或类似的东西先等待1秒超时,如果等待超时,则进入调试器。

解决方案

这个问题的海报已经完成了我正在寻找的内容:生产JVM的安全调试



它再现了<$ c的最佳功能$ c> DebugBreak ,只有在断点被击中后,才可以将IDE附加到程序。


I'm looking for a way to break into the debugger from Java code, without setting a breakpoint in the IDE.

In Win32 there was DebugBreak(), in C# there's DebugBreak() Equivalent in C#, but I can't find anything in Java.

What I'm trying to do: say I have a wait with a 30s timeout, but in normal conditions that wait should always be <1s. I'd like to use ByteMan or something similar to wait with 1s timeout first, and break into the debugger if that wait timed out.

解决方案

The poster of this question has done exactly what I was looking for: Secure Debugging for Production JVMs

It reproduces the best feature of DebugBreak, that is you can attach the IDE to your program only after the "breakpoint" is hit.

这篇关于DebugBreak相当于Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆