Suppose I have the following code. While debugging, I want Eclipse to stop when it has done 1 million iterations. How to do this? I cannot manually do 1 million times.
for(int i = 0; i < 10000000; i++) {
//some code
}
The thread-id specifier is one of the thread identifiers assigned by GDB, shown in the first column of the ' info threads ' display. If you do not specify ' thread thread-id ' when you set a breakpoint, the breakpoint applies to all threads of your program.
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. size()==0.
Check that your project is in the Source tab in Debug Configurations. If it's not then the breakpoints are ignored.
Select all the methods using ctrl . Right click and select Toggle Method Breakpoint .
You can put conditional break point in eclipse:
Put condition code
i == 1000000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With