ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/addcbrkpt.htm

96 lines
6.1 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="task" />
<meta name="DC.Title" content="Add conditional breakpoints" />
<meta name="abstract" content="You can add a conditional breakpoint to a program that is being debugged using the Add Breakpoint (ADDBKP) command to specify the statement and condition." />
<meta name="description" content="You can add a conditional breakpoint to a program that is being debugged using the Add Breakpoint (ADDBKP) command to specify the statement and condition." />
<meta name="DC.subject" content="conditional breakpoint, adding, breakpoint, conditional, add, skip value, definition" />
<meta name="keywords" content="conditional breakpoint, adding, breakpoint, conditional, add, skip value, definition" />
<meta name="DC.Relation" scheme="URI" content="brkpt.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6opsinexp.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/addbkp.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/dspbkp.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="addcbrkpt" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Add conditional breakpoints</title>
</head>
<body id="addcbrkpt"><a name="addcbrkpt"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Add conditional breakpoints</h1>
<div><p>You can add a conditional breakpoint to a program that is being
debugged using the <span class="cmdname">Add Breakpoint (ADDBKP)</span> command to specify
the statement and condition. </p>
<div class="section"> <p>If the condition is met, the system stops the program processing
at the specified statement.</p>
<p>You may specify a skip value on the <span class="cmdname">Add
Breakpoint (ADDBKP)</span> command. A <strong>skip value</strong> is a number that
indicates how many times a statement should be processed before the system
stops the program. For example, to stop a program at statement 1200 after
the statement has been processed 100 times, enter the following command: </p>
<pre>ADDBKP STMT(1200) SKIP(100)</pre>
<p>If you specify multiple statements when the SKIP parameter
is specified, each statement has a separate count. The following command
causes your program to stop on statement 150 or 200, but only after the statement
has processed 400 times: </p>
<pre>ADDBKP STMT(150 200) SKIP(400)</pre>
<p>If statement 150 has processed 400 times but statement 200
has processed only 300 times, then the program does not stop on statement
200.</p>
<p>If a statement has not processed as many times as was specified
on the SKIP parameter, the <span class="cmdname">Display Breakpoint (DSPBKP)</span> command
can be used to show how many times the statement was processed. To reset the
SKIP count for a statement to zero, enter the breakpoint again for that statement.</p>
<p>You
can specify a more general breakpoint condition on the <span class="cmdname">Add Breakpoint
(ADDBKP)</span> command. This expression uses a program variable, an operator,
and another variable or constant as the operands. For example, to stop a
program at statement 1500 when variable &amp;X is greater than 1000, enter
the following command: </p>
<pre>ADDBKP STMT(1500) PGMVAR('&amp;X') BKPCOND(*PGMVAR1 *GT 1000)</pre>
<p>The BKPCOND parameter requires three values:</p>
<ul><li>In the example, the first value specifies the first variable specified
on the PGMVAR parameter. (To specify the third variable, you would use *PGMVAR3.)</li>
<li>The second value must be an operator.</li>
<li>The third value may be a constant or another variable. A constant may
be a number, character string, or bit string, and must be the same type as
the program variable specified in the first value.</li>
</ul>
<p>The SKIP and BKPCOND parameters can be used together to specify a
complex breakpoint condition. For example, to stop a program on statement
1000 after the statement has been processed 50 times <strong>and</strong> only when
the character string &amp;STR is <samp class="codeph">TRUE</samp>, enter the following
command:</p>
<pre>ADDBKP STMT(1000) PGMVAR('&amp;STR') SKIP(50)
BKPCOND(*PGMVAR1 *EQ 'TRUE ')</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="brkpt.htm" title="A breakpoint is a place in a program at which the system stops program processing and gives control to you at a display station (interactive mode) or to a program specified on the BKPPGM parameter in the Add Breakpoint (ADDBKP) command (batch mode).">Use breakpoints</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="rbam6opsinexp.htm" title="Operators are used in expressions to indicate an action to be performed on the operands in the expression or the relationship between the operands.">Operators in expressions</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/addbkp.htm">Add Breakpoint (ADDBKP) command</a></div>
<div><a href="../cl/dspbkp.htm">Display Breakpoint (DSPBKP) command</a></div>
</div>
</div>
</body>
</html>