开发者

How do I tell a remote debugger to actually suspend at some point?

开发者 https://www.devze.com 2023-03-19 10:18 出处:网络
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 proc

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 project开发者_如何学Cs/modules/whatever.


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号