Professional Documents
Culture Documents
1
IBM i Debugger
Overview
Service Entry Points
Debugger Functions
Attach to an IBM i Job
Launch Configurations and Settings
2
Integrated Debugger - Overview
RPG, COBOL, CL, C, and C++
IBM i - ILE and non ILE, incl. free-form RPG
DB2 and SQL stored procedures
Source and Listing view
Batch, interactive, and Multi-Threaded Applications
Client/Server Applications
Distributed Applications
3
Debugger Functions - Overview
Manage program execution
– Step/Run commands
– Multiple breakpoint types
4
Start/Stop Debug Server
- From RSE, right click a subsystem (Objects, Commands, Jobs, or IFS Files).
- Select Remote Servers > Debug > Start to start and Stop to stop.
- Or, from 5250 session, issue command STRDBGSVR to start and ENDDBGSVR to
stop.
- Once per i system
- Default port 3825
- WRKSRVTBLE add or change the entry QDBGSVR2
5
Where does the Application run?
Debug As…
Batch Submitted to batch
Interactive 5250 emulation, STRRSESVR
Multi-threaded Creates BCI job
Job Specified job
6
Debug Perspective
Outline view
7
Debug perspective
8
Secure connection for debug session
9
IBM i Debugger
Overview
Service Entry Points
Debugger Functions
Attach to an IBM i Job
Launch Configurations and Settings
10
Service Entry Points
11
Service Entry Points (continued)
Great for:
– WebFaced applications
– Web applications
– Toolbox calls
– Any ILE program you want to debug
12
Setting Service Entry Points
13
Service Entry Points view
Service Entry Points view is automatically displayed when Service Entry Point set.
Otherwise display from
Window > Show view > Other > IBM i > IBM i Service Entry Points
List of all Service Entry Points set from the RSE
Pop-up menu to work with Service Entry Points
14
Service Entry Points -Refresh
15
Service Entry Points - Modify
When Service Entry Point is
set, its user profile property
(user whose job is going to hit
the Service Entry Point) is set
to the user ID used to logon to
RSE connection.
If you want to debug a job
running under user profile
other than this RSE logon ID,
you can modify the SEP to set
to the proper user profile.
16
IBM i Debugger
Overview
Service Entry Points
Debugger Functions
Attach to an IBM i Job
Launch Configurations and Settings
17
Debug Perspective
Resume, Suspend, Terminate, Step Into,
Step Over, Step Return
Variables
Breakpoints
Call Monitored variables
Stack Programs under debug
Current
Break Line
Point Outline
Add Properties:
Window ->
Show View ->
Other ->
General
18
Program Execution
Step Into
– Debug the next call level
Step Over
– Run the next call level and stop at the next statement
Step Return (for ILE on V5R3 or higher)
– Run until you are back in the previous call level and stop at the next statement
Resume
– Run until an event is encountered
Run To Location
– Run and stop at the current cursor position or until an event is encountered
Suspend
– Halt program at point of execution
Terminate
– End the debug session
19
Setting Breakpoints
Ways to set a Line Breakpoint:
20
Conditional Line Breakpoint
Set Frequency
Value to start
Value to stop
Breaks to skip
Set Expression
Conditions must be true
for break to happen
21
Watch Breakpoint
Number of bytes
to watch set to 0 for
defined length of variable
22
Monitors View
23
Monitor Expression Dialog
1. Select variable
2. Click plus sign for dialog
3. Variable pre-filled
4. Can add dimension
24
Variables view
In V5R3 or later, local variables support is available for ILE RPG and ILE COBOL, for C
and C++ also in earlier releases.
Variables view automatically displays all variables of current scope.
25
Display Memory Content
26
Programs view
Pop-up menu to
remove programs
from debug
Expand program
entry and double
click to display
source
27
IBM i Debugger
Overview
Service Entry Points
Debugger Functions
Attach to an IBM i Job
Launch Configurations and Settings
28
Attach to an IBM i Job
Job subsystem
29
Attach to an IBM i Job
30
Attach to an IBM i Job
Click Step or Resume button, and then switch to emulation to start your application.
Note: Terminating the debug session does not terminate the interactive program
31
IBM i Debugger
Overview
Service Entry Points
Debugger Functions
Debugging interactive Applications
Launch Configurations and Settings
32
Launch Configuration – How to Start
Command to start
application required for
service programs
33
Source Locator Scenario
PGM A PGM A
source object
Debug
Debug source locator
34
Launch Configuration – source location
35
Launch Configuration – Source tab
36
Debug Preferences
37