Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Java Development User Guide
Previous Page Home Next Page

Breakpoint Enable Condition

Select the Enable Condition option to enable the ability to provide a custom condition for the breakpoint.

Each breakpoint can have a unique condition that determines when the breakpoint will be hit.

A condition for a breakpoint can be any logical expression that evaluates to either true or false. The expression is evaluated in the scope of the breakpoint location, meaning you cannot make reference to a class, etc., outside the scope of the breakpoint location when composing your expression.

Consider the following example:

public class Person {

	String name = "";
	int age = 0;

	public Person(String name, int age) {
		this.name = name;
		this.age = age;		//breakpoint here
  }
};

If we take the above example, place a breakpoint where indicated and go to the breakpoint properties we can add our condition. In this case we are limited only to the members of the class the breakpoint is contained in and those provided by Object.

For example a valid condition could be:

	age == 56 

meaning the breakpoint would only suspend when age was equal to 56.

Conditions can be added to breakpoints with the Breakpoints Properties... shown below.

Breakpoint condition option

 

Related concepts

Breakpoints

Related tasks

Adding breakpoints
Removing breakpoints
Launching a Java program
Running and debugging

Related reference

Enabled Option
Hit Count
Suspend Policy
Method Entry
Method Exit

 


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire