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

219 lines
11 KiB
HTML

<?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 breakpoints to programs" />
<meta name="abstract" content="You can use the Add Breakpoint (ADDBKP) command to add breakpoints to the program you want debugged." />
<meta name="description" content="You can use the Add Breakpoint (ADDBKP) command to add breakpoints to the program you want debugged." />
<meta name="DC.subject" content="breakpoint, resuming program processing, see='breakpoint program'.breakpoint, see='trace'.breakpoint, RSMBKP (Resume Breakpoint) command, Resume Breakpoint (RSMBKP) command, command, CL, RSMBKP (Resume Breakpoint), Resume Breakpoint (RSMBKP), resuming, batch job, breakpoint program, example, adding, breakpoint to program, ADDBKP (Add Breakpoint) command, Add Breakpoint (ADDBKP) command, display" />
<meta name="keywords" content="breakpoint, resuming program processing, see='breakpoint program'.breakpoint, see='trace'.breakpoint, RSMBKP (Resume Breakpoint) command, Resume Breakpoint (RSMBKP) command, command, CL, RSMBKP (Resume Breakpoint), Resume Breakpoint (RSMBKP), resuming, batch job, breakpoint program, example, adding, breakpoint to program, ADDBKP (Add Breakpoint) command, Add Breakpoint (ADDBKP) command, display" />
<meta name="DC.Relation" scheme="URI" content="brkpt.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/rsmbkp.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/addbkp.htm" />
<meta name="DC.Relation" scheme="URI" content="../clfinder/finder.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="adbkp" />
<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 breakpoints to programs</title>
</head>
<body id="adbkp"><a name="adbkp"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Add breakpoints to programs</h1>
<div><p>You can use the <span class="cmdname">Add Breakpoint (ADDBKP)</span> command
to add breakpoints to the program you want debugged. </p>
<div class="section"> <p>You can specify up to 10 statement identifiers on the one <span class="cmdname">Add
Breakpoint (ADDBKP)</span> command. The program variables specified on
an <span class="cmdname">Add Breakpoint (ADDBKP)</span> command apply only to the breakpoints
specified on that command. Up to 10 variables can be specified in one <span class="cmdname">Add
Breakpoint (ADDBKP)</span> command.</p>
<p>You can also specify the name
of the program to which the breakpoint is to be added. If you do not specify
the name of the program that you want the breakpoint added to, the breakpoint
is added to the default program specified on the STRDBG, CHGDBG, or ADDPGM
command.</p>
<p>To add a breakpoint to a program, specify a statement identifier,
which can be:</p>
<ul><li>A statement label</li>
<li>A statement number</li>
<li>A machine interface (MI) instruction number</li>
</ul>
<p>When you add a breakpoint to a program, you can also specify program
variables whose values or partial values you want to display when the breakpoint
is reached. These variables can be shown in character or hexadecimal format.</p>
<p>Program
processing stops at a breakpoint <em>before</em> the instruction is processed.
For an interactive job, the system displays what breakpoint the program has
stopped at and, if requested, the values of the program variables.</p>
<p>In
high-level language programs, different statements and labels may be mapped
to the same internal instruction. This happens when there are several inoperable
statements (such as DO and ENDDO) following one another in a program. You
can use the IRP list to determine which statements or labels are mapped to
the same instruction.</p>
<p>The result of different statements being mapped
to the same instruction is that a breakpoint being added may redefine a previous
breakpoint that was added for a different statement. When this occurs, a new
breakpoint replaces the previously added breakpoint, that is, the previous
breakpoint is removed and the new breakpoint is added. After this information
is displayed, you can do any of the following: </p>
<ul><li>End the most recent request by pressing F3.</li>
<li>Continue program processing by pressing Enter.</li>
<li>Go to the command entry display at the next request level by pressing
F10. From this display, you can: <ul><li>Enter any CL command that can be used in an interactive debug environment.
You may display or change the values of variables in your program, add or
remove programs from debug mode, or perform other debug commands.</li>
<li>Continue processing the program by entering the <span class="cmdname">Resume Breakpoint
(RSMBKP</span>) command.</li>
<li>Return to the breakpoint display by pressing F3.</li>
<li>Return to the command entry display at the previous request level by entering
the <span class="cmdname">End Request (ENDRQS)</span> command.</li>
</ul>
</li>
</ul>
<p>For a batch job, a breakpoint program can be called when a breakpoint
is reached. You must create this breakpoint program to handle the breakpoint
information. The breakpoint information is passed to the breakpoint program.
The breakpoint program is another program such as a CL program that can contain
the same commands (requests for function) that you would have entered interactively
for an interactive job. For example, the program can display and change variables
or add and remove breakpoints. Any function valid in a batch job can be requested.
When the breakpoint program completes processing, the program being debugged
continues.</p>
<p>A message is recorded in the job log for every breakpoint
for the debug job.</p>
<p>The following <span class="cmdname">Add Breakpoint (ADDBKP)</span> commands
add breakpoints to the program CUS310. CUS310 is the default program, so it
does not have to be specified. The value of the variable &amp;ARBAL is shown
when the second breakpoint is reached. </p>
<pre>ADDBKP STMT(900)
ADDBKP STMT(2200) PGMVAR('&amp;ARBAL')</pre>
<div class="note"><span class="notetitle">Note:</span> A CL variable must be entered with surrounding apostrophes.</div>
<p>The
source for CUS310 looks like this: </p>
<pre>5728PW1 R01M00 880101 SEU SOURCE LISTING
SOURCE FILE . . . . . . . QGPL/QCLSRC
MEMBER . . . . . . . . . CUS310
SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+...
6 ...+... 7 ...+... 8 ...
100 PGM PARM(&amp;NBRITEMS &amp;ITEMPRC &amp;PARBAL &amp;PTOTBAL)
200 DCL VAR(&amp;PARBAL) TYPE(*DEC) LEN(15 5) /*
INPUT AREA INV BALANCE */
300 DCL VAR(&amp;PTOTBAL) TYPE(*DEC) LEN(15 5) /*
INPUT TOTAL INV BALANCE*/
400 DCL VAR(&amp;NBRITEMS) TYPE(*DEC) LEN(15 5) /*
NUMBER OF ITEMS */
500 DCL VAR(&amp;ITEMPRC) TYPE(*DEC) LEN(15 5) /*
PRICE OF THE ITEM */
600 DCL VAR(&amp;ARBAL) TYPE(*DEC) LEN(5 2) /*
AREA INVENTORY BALANCE */
700 DCL VAR(&amp;TOTBAL) TYPE(*DEC) LEN(5 2) /*
TOTAL INVENTORY BALANCE*/
800 DCL VAR(&amp;TOTITEM) TYPE(*DEC) LEN(5 2) /*
TOTAL PRICE OF ITEMS */
900 CHGVAR VAR(&amp;ARBAL) VALUE(&amp;PARBAL)
1000 CHGVAR VAR(&amp;TOTBAL) VALUE(&amp;PTOTBAL)
1100 IF COND(&amp;NBRITEMS *EQ 0) THEN(DO)
1200 SNDPGMMSG MSG('The number of items is zero. This item +
1300 should be ordered.') TOMSGQ(INVLIB/INVQUEUE)
1400 GOTO CMDLBL(EXIT)
1500 ENDDO
1600 CHGVAR VAR(&amp;TOTITEM) VALUE(&amp;NBRITEMS * &amp;ITEMPRC)
1700 IF COND(&amp;NBRITEMS *GT 50) THEN(DO)
1800 SNDPGMMSG MSG('Too much inventory for this item.') +
1900 TOMSGQ(INVLIB/INVQUEUE)
2000 ENDDO
2100 CHGVAR VAR(&amp;ARBAL) VALUE(&amp;ARBAL + &amp;TOTITEM)
2200 IF COND(&amp;ARBAL *GT 1000) THEN(DO)
2300 SNDPGMMSG MSG('The area has too much money in +
2400 inventory.') TOMSGQ(INVLIB/INVQUEUE)
2500 ENDDO
2600 CHGVAR VAR(&amp;TOTBAL) VALUE(&amp;TOTBAL + &amp;TOTITEM)
2700 EXIT: ENDPGM</pre>
<p>The following is displayed as a result of reaching the first
breakpoint: </p>
<pre class="screen"> Display Breakpoint
Statement/Instruction . . . . . . . . . : 900 /0009
Program . . . . . . . . . . . . . . . . : CUS310
Recursion level . . . . . . . . . . . . : 1
Press Enter to continue.
F3=Exit program F10=Command entry
</pre>
<p>The following is displayed as a result of reaching the second
breakpoint:</p>
<pre class="screen"> Display Breakpoint
Statement/Instruction . . . . . . . . . : 2200 /0022
Program . . . . . . . . . . . . . . . . : CUS310
Recursion level . . . . . . . . . . . . : 1
Start position . . . . . . . . . . . . : 1
Format . . . . . . . . . . . . . . . . : *CHAR
Length . . . . . . . . . . . . . . . . : *DCL
Variable . . . . . . . . . . . . . . . : &amp;ARBAL
Type . . . . . . . . . . . . . . . . : PACKED
Length . . . . . . . . . . . . . . . : 5 2
'610.00'
Press Enter to continue.
F3=Exit program F10=Command entry
</pre>
<p>The variable &amp;ARBAL is shown. (Note that the value of &amp;ARBAL
will vary depending on the parameter values passed to the program.) You can
press F10 to display the command entry display so that you could change the
value of the variable &amp;ARBAL to alter your program's processing.
You use the <span class="cmdname">Change Program Variable (CHGPGMVAR)</span> command
to change the value of a variable.</p>
</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="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/rsmbkp.htm">Resume Breakpoint (RSMBKP) command</a></div>
<div><a href="../cl/addbkp.htm">Add Breakpoint (ADDBKP) command</a></div>
<div><a href="../clfinder/finder.htm">CL command finder</a></div>
</div>
</div>
</body>
</html>