Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a method breakpoint to all methods of a class in EclipseIDE

Tags:

eclipse

In Eclipse, is there a way you can set Method Breakpoints on all the methods of the class without going to individual methods? The motivation behind is that, any time a method gets hit, it would go to that method in debug mode.

like image 434
Luke Avatar asked Apr 21 '10 18:04

Luke


People also ask

Can I set breakpoints to all methods in a class at once in Visual Studio?

In short, you can bring up the "New Breakpoint" dialog by pressing Ctrl+K, B and type in ClassName::* to the function field. In Visual Studio 2017 you need to include the namespace in the field, as in NamespaceName::ClassName::* . You can then disable some of them in the breakpoints window.

How do I set breakpoint conditions in Eclipse?

First, set a breakpoint at a given location. Then, use the context menu on the breakpoint in the left editor margin or in the Breakpoints view in the Debug perspective, and select the breakpoint’s properties. In the dialog box, check Enable Condition, and enter an arbitrary Java condition, such as list.


2 Answers

The fastest way is to go to the "Outline" view and select all of the methods you want, right-click and click "Toggle Method Breakpoint"

like image 115
sanderty Avatar answered Sep 17 '22 14:09

sanderty


No direct way that I know of.
But if you add AspectJ (that is aspect-oriented extension), you could write an "advice" that you would set on each method of a Class when entering them on runtime.

alt text

You could then set a breakpoint in that advice code.

like image 21
2 revs Avatar answered Sep 20 '22 14:09

2 revs