blob: f8468cf713cb596bfa803d769daa280ec9b66bdf [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<title> Managing conditional breakpoints </title>
</head>
<body>
<h1> Managing conditional breakpoints </h1>
<p>
An enabling condition can be applied to a line breakpoint such that the
breakpoint suspends execution of a thread in one of these cases: </p>
<ul>
<li>when the enabling condition is true</li>
<li>when the enabling condition changes</li>
</ul>
<p> To set a condition on a breakpoint: </p>
<ol>
<li>
Find the breakpoint to which an enabling condition is to be applied (in
the Breakpoints view or in the editor marker bar).
</li>
<li>
From the breakpoint's pop-up menu, select <strong>Breakpoint
Properties...</strong>.&nbsp; The Breakpoint properties dialog will open.
</li>
<li> In the properties dialog, check the <strong>Enable Condition</strong> checkbox.&nbsp; </li>
<li> In the <strong>Condition</strong> field enter the expression for
the breakpoint condition. </li>
<li> Do one of the following:
<ul>
<li>If you want the breakpoint to stop every time the condition evaluates
to <em>true</em>, select the <strong>condition is 'true' </strong>option.&nbsp;
The expression provided must be a boolean expression.</li>
<li>If you want the breakpoint to stop only when the result of the
condition changes, select the <strong>value of condition changes </strong>option.</li>
</ul>
</li>
<li> Click <strong>OK</strong> to close the dialog and commit the changes. While
the breakpoint is enabled, thread execution suspends before that line of code
is executed if the breakpoint condition evaluates to <em>true</em>.&nbsp;
</li>
</ol>
<p>
A conditional breakpoint has a question mark overlay on the breakpoint icon.</p>
<p> <img border="0" src="../images/ngrelc.png" alt="Related concepts" >
<br>
<a href="../concepts/concepts-10.htm">Debugger</a><br>
<a href="../concepts/concepts-5.htm">Java perspectives</a><br>
<a href="../concepts/concepts-7.htm">Java editor</a><br>
</p>
<p> <img border="0" src="../images/ngrelt.png" alt="Related tasks" >
<br>
<a href="../tasks/tasks-144.htm">Adding breakpoints</a><br>
<a href="../tasks/tasks-146.htm">Applying hit counts</a><br>
<a href="../tasks/tasks-147.htm">Catching Java exceptions</a><br>
<a href="../tasks/tasks-144a.htm">Removing breakpoints</a><br>
<a href="../tasks/tasks-145.htm">Setting method breakpoints</a><br>
<a href="../tasks/tasks-136.htm">Stepping through the execution of a program</a>
</p>
<p> <img border="0" src="../images/ngrelr.png" alt="Related reference" ><br>
<a href="../reference/views/breakpoints/ref-breakpoints_view.htm">Breakpoints view</a>
</p>
</body>
</html>