Moving instruction pointer when debugging Java in Eclipse

Is it possible to transfer the command pointer directly to a string of my choice (within the current method) when debugging a Java program in Eclipse (Galileo)?

Directly drag the instruction pointer to the desired line in the method in Visual Studio, but I see no way to do this in Eclipse (and I can not find anything about it in the documents or in google).

+47
java debugging eclipse
Oct. 30 '09 at 17:58
source share
8 answers

It's impossible.

If you just want to execute some code in the current place, you can use the Expressions view and enter your code as an expression. Methods invoked by expression evaluation will execute in the current debugging context.

+15
Oct 30 '09 at 18:23
source share

It is possible ...

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.user/tips/jdt_tips.html

Drop the frame. When you go through your code, you can sometimes go too far or go through the line that you would like to enter. Instead of restarting the debugging session, you can use Drop for the Radial action to quickly return to the beginning of the method. Select the stack frame corresponding to the Java method that you want to restart, and select "Drop to Frame" from the "Debug" toolbar or stack frame context menu. The current instruction pointer will reset for the first executable statement in the method. This works for a non-top stack frame.

Please note: Drop to frame is only available when debugging with 1.4 or higher virtual machine or J9 virtual machine. There are situations where the JVM may not be able to pull the desired frames from the stack. For example, it is usually impossible to go down to the bottom frame of the stack or any frame below your own method.

+27
Mar 11 2018-12-12T00:
source share

I like ankon answer best, but another option (which will only work for your specific instance - if so) is to stop at the breakpoint on your if and change the variable (s) evaluated in the conditional expression so that it returns false (from the Variables view, right-click on the variable and click on "Change value ...")

0
Oct 30 '09 at 19:01
source share

I thought it was quite possible in older versions of eclipse, I thought I had a memory for it, but I think I just implanted that memory when I was working in Visual Studio. From what I'm reading, it may appear in jvm, and not in the eclipse itself, there are pages where he suggested that jvm cannot handle it.

In my opinion, Eclipse is many times better than VS, I have worked a lot in both, and since I discovered Eclipse, it always hurt me when I had to work in VS. But without this feature, it definitely hurts now, hehe.

0
Aug 24
source share

You can go directly to any method call inside the current debugged method. Select the method call below the current instruction pointer and use the "Step to Selection " from the context menu.

0
Oct 26 '12 at 18:05
source share

unfortunately, it is impossible to take a step forward with the instruction pointer (program counter), so you need to enter your own "debug" variables instead, which you can test for - say, you want to take a step around a loop that takes too long, then add a variable and check its increased value, and then encapsulate the loop in the if variable with this variable. I know this is ugly, but it's all done - or you could just evolve in C ++ :-)

0
Jun 24 '15 at 7:28
source share

Place the cursor on the line of your choice and either press ctrl-R (Run To Line), or right-click and select Run To Line from the context menu.

-2
Oct 30 '09 at 18:02
source share

Just right click on the desired line and select run to line.That is ...

-2
Sep 15 '15 at 12:34
source share



All Articles