The flow of a program can be controlled with breakpoints. You can set unconditional and conditional breakpoints. An unconditional breakpoint stops the program at a specific statement. A conditional breakpoint stops the program when a specific condition at a specific statement is met.
There are two types of breakpoints: job and thread. Each thread in a threaded application may have it’s own thread breakpoint at the same position at the same time. Both ob and thread breakpoints can be unconditional or conditional. In general, there is one set of debug commands and Function keys for job breakpoints and another for thread breakpoints. For the rest of this section on breakpoints, the word breakpoint refers to both job and thread, unless specifically mentioned otherwise.
When the program stops, the Display Module Source display appears. Use this display to evaluate variables, set more breakpoints, and run any of the source debugger commands. The appropriate module is shown with the source positioned to the line where the condition occurred. The cursor will be positioned on the line where the breakpoint occurred if the cursor was in the text area of the display the last time the source was displayed. Otherwise, it is positioned on the debug command line.
If you change the view of the module after setting breakpoints, then the line numbers of the breakpoints are mapped to the new view by the source debugger.
You can set and remove unconditional and conditional breakpoints by using:
You can also add breakpoints with the BREAK or TBREAK debug commands. You can remove one, or all breakpoints from a program by using the Clear Program debug command.
To set a breakpoint on the first statement of a multi-statement macro, the cursor should be on the line containing the macro invocation, not the macro expansion.
This example shows you how to set and remove an unconditional breakpoint using F6 (Add/Clear breakpoint), and add a conditional breakpoint using F13 (Work with module breakpoints).
If you want to set the breakpoint in the module shown, continue with step 3. If you want to set a breakpoint in a different module, type display module name on the debug command line where name is the name of the module that you want to display.
If there is no breakpoint on the line you specify, an unconditional breakpoint is set on that line.
Note:If there is a breakpoint on the line you specify, it is removed (even if it is a conditional breakpoint). This function key acts as a toggle key. The clear command can be used to remove a breakpoint. For example, clear 50 removes the breakpoint at line 50.
A conditional breakpoint is set on line 35. The expression is evaluated before the statement is run. If the result is true (in the example, if i is equal to 21), the program stops, and the Display Module Source display is shown. If the result is false, the program continues to run. If you do not want to switch panels, you can set the same breakpoint from the Display Module Source command line by typing:break 35 when i==21
You can set a conditional breakpoint to a statement. For example, if you have a compiler listing that contains line numbers and statement numbers, you can use the statement syntax to set a breakpoint on a specific statement when there are several statements on a single line.Line Stmt Source
Break myfunction/25 sets a breakpoint on the statement j=0 assuming this is in myfunction. If you then enter Break 33, a breakpoint is set at statement 24, i=j.
An existing breakpoint is always replaced by a new breakpoint entered at the same location.
IBM-ILE Related Interview Questions
|IBM - RPG Interview Questions||IBM DB2 Interview Questions|
|DB2 Using SQL Interview Questions||IBM Mainframe Interview Questions|
|IBM AIX 7 Administration Interview Questions||AS400 Interview Questions|
|Automatic Storage Management (ASM) Interview Questions||Mainframe DB2 Interview Questions|
|Rpgle Interview Questions|
Introduction To The Ile C/c++ Compiler
Creating A Program
Working With Exports From Service Programs
Example - Creating A Sample Ile C Application
Running A Program
Debugging A Program
Using Stream And Record I/o Functions With Iseries Data
Using Ile C/c++ Stream Functions With The Iseries Integrated File System
Using Externally Described Files In Your Programs
Using Database Files And Distributed Data Management Files In Your Programs
Using Device Files In Your Programs
Handling Exceptions In Your Program
Using Iseries Pointers In Your Program
Using Packed Decimal Data In Your C Programs
Internationalizing Your Program
International Locale Support
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.