如何告诉远程调试器在某个时刻实际挂起?
我正在使用 IntelliJ Idea 调试器,并且我有一些 3rd 方应用程序及其源代码(应该不重要,但它是 hyperic)。我需要查看某些方法何时被执行并跟踪执行过程。我已使用远程应用程序调试成功连接到该应用程序,但不知道下一步该做什么。 O_o
可以挂起应用程序,但如何附加源并告诉它何时挂起(方法调用/代码行/等)?
编辑:或者我可以使用eclipse(如果它工作的话使用什么并不重要)。
EDIT2:这不是我的项目/模块/其他内容之一。
I'm using IntelliJ Idea debugger and I have some 3rd party app with its sources (shouldn't matter, but it's hyperic). I need to see when some methods are being executed and trace the execution process. I've successfully connected to the app using remote application debug but can't figure what to do next. O_o
It is possible to suspend the app, but how to attach sources and tell it when exactly to suspend (method call/line of code/etc)?
EDIT: Alternatively I could use eclipse (doesn't matter what to use if it's working).
EDIT2: It's not one of my projects/modules/whatever.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在编辑器中打开源代码并设置断点。
调试器应该足够聪明,能够弄清楚您想要实现的目标。
[编辑] 创建一个包含源代码和所有 JAR 的小项目。这应该可以正确编译并允许您设置断点。
在 Eclipse 中,您可以将源附加到 JAR。这样,您就可以设置断点。
Open the source code in an editor and set a break point.
The debugger should be smart enough to figure out what you want to achieve.
[EDIT] Create a small project which contains the sources and all the JARs. That should compile without error and allow you set breakpoints.
In Eclipse, you can attach sources to JARs. That way, you can set breakpoints.
要调试远程应用程序,您需要 Eclipse(无论什么 IDE)项目中的源代码。然后只需设置断点并使用适当的端口启动远程调试器。
To debug the remote application you need it's sources in your eclipse (whatever IDE) project. And then just set breakpoints and launch remote debugger with appropriate port.
源代码是否可能与正在执行的代码不同步?我以前也遇到过这种情况,因此根据远程计算机的代码版本,我设置的断点实际上位于不可执行的行(空格、注释)上。
我唯一一次看到类似的情况是当远程计算机运行多个 JVM 并且我不小心连接到错误的端口(因此连接到错误的 JVM)时。
调试时代表断点的红点应该会略有变化,调试时它是什么样子的?例如,如果该行不可执行,我认为点顶部会有一个 X。
Is it possible that the source code is out of sync with the code being executed? I've had this happen before so that the breakpoint I set was actually on a non-executable line (whitespace, comment) according to the remote machine's version of code.
The only other time I've seen something like that was when the remote machine was running several JVMs and I accidentally connected to the wrong port (and thus the wrong JVM).
When you are debugging the red dot that represents the breakpoint should change slightly, what does it look like while you are debugging? For example, if the line is non-executable I think there will be an X on top of the dot.