Put a breakpoint on every line in Eclipse?

Is there a way to put a breakpoint on every line in Eclipse?

I ask because I am analyzing a proxy program written in Java that is waiting and listening for connections. I'm trying to keep track of how this works, but I can't figure out where the code starts when the connection comes in.

How can I call a breakpoint no matter where the code starts, in other words, a breakpoint for each line?

+6
source share
6 answers

I can't think of the reason you need a breakpoint on each line. This would be equivalent to simply placing a breakpoint in the first line of main() and then going through your program with step into - not what a normal person would normally want to do with a large program.

I would suggest:

  • Delete or disable any remaining breakpoints
  • Launch your proxy server in debug mode; allow it to initialize. Now he is listening.
  • Click the pause button in the debug items. You may need to choose the right thread to pause - an experiment.
  • Look at the stack display, it will show you where it is paused. It will probably be suspended in the library class - follow the stack to your own code.

If you like it, now you can connect to your proxy with the client and use the debug controls to see how the code handles it. One of the problems is that the timeout is when viewing steps, so it may be useful to set longer timeouts where possible.

+7
source

I do not know if it is possible to add a breakpoint for each line at a time. However, you can debug line by line by clicking "Debug As", then using the following commands: [F6] "Step Over" and [F5] "Step Into".

+3
source

From the link to the StackOverFlow website

I don’t think you can choose a class for debugging, but you can go to the Outline view in eclipse, select all the methods in the class, right-click and select Toggle Method Breakpoint

How to set a breakpoint in the NOT a Line in Eclipse class?

+1
source

IMHO, the breakpoint on each line would be redundant, so I would put a breakpoint on the line that I know passed, and then went to the call stack to get the entry point, i.e. use the Debug view where the threads and the current stack are.

After you find this entry point, you can set a breakpoint and then execute the code using the usual debugger commands, such as “step in”, “step over”, etc.

Btw, AFAIK, setting a breakpoint on each line with multiple actions, is not even possible in eclipse because it does not make much sense. There may be a way to create a .bkpt file for each line in the code and import them, but I also don’t know how you will create such a file, and I don’t think Eclipse will be able to handle such a potentially huge number of breakpoints.

0
source

The yellow arrow that “falls” between two black dots, imagine that our program has a breakpoint on the line by which the method is called, and stopped there. By clicking this button, the debugger will go inside the method and stop on the first line, so we can debug inside the method. For example, where the breakpoint is shown in the following figure.

enter image description here

By clicking the button marked in red, the debugger will go inside the echaCuentas () method and stop at the first line of this method. The next button, the yellow arrow, jumping over the black dot, is the step-by-step execution of the program, but without getting into the method that you find. For example, in the previous figure, if you click this button, execution will follow the line System.out.println (), without stopping in the echaCuentas () method.

Finally, the last button is an arrow between two black dots, it advances the program until we exit the current method and go to the place where it was called.

0
source

A breakpoint on each line is not possible ... Place a breakpoint where you want in your code, or do it manually. Then release the application; he will stop at the breakpoint line;

0
source

All Articles