Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put a breakpoint on every line in Eclipse?

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

The reason I ask is because I am analyzing a proxy program written in Java, which waits and listens for connections. I'm trying to follow how it works, but I can't figure out where the code starts from when a connection arrives.

How can I trigger a breakpoint no matter where the code starts from, in other words, breakpoint every line?

like image 315
CodyBugstein Avatar asked May 15 '14 09:05

CodyBugstein


People also ask

How do I add a breakpoint to all methods in Eclipse?

Select all the methods using ctrl . Right click and select Toggle Method Breakpoint .

How do you put a breakpoint in all methods?

Press F3 and then press F9 to add a breakpoint.

How do I set breakpoint conditions in Eclipse?

Right-click the breakpoint icon ( ) or watchpoint icon ( ) in the marker bar, and then select Breakpoint Properties. This opens a Properties dialog box. To add a hit count, select Hit count, click and select the required operator, and then enter the required value.

Does a breakpoint stop all threads?

By default only the thread that hits the breakpoint stops. However, you can modify the behavior by changing the breakpopint properties. Save this answer.


1 Answers

I can't think of a reason you'd want a breakpoint on every line. It would be equivalent to simply putting a breakpoint at the first line of main(), then stepping through your program with step into -- not something a sane person would normally want to do with a large program.

I would suggest:

  1. Delete or disable any breakpoints you have already
  2. Start your proxy in debug mode; allow it to initialise. It is now listening.
  3. Hit the "pause" button in the debug controls. You might have to select the right thread to pause -- experiment.
  4. Look at the stack display, this will show you where it's paused. It will probably be paused in a library class - follow the stack up to your own code.

If you like, you can now connect to your proxy with a client, and use the debug step controls to watch how the code handles it. One problem with this is that things time out while you're looking at steps, so it can be useful to set longer timeouts where possible.

like image 145
slim Avatar answered Sep 27 '22 22:09

slim