In my opinion, one of the most exciting developments in debugger technologies is Service Entry Points (SEPs). SEPs make it easy to debug a program without regard to where it runs. With SEPs, debugging a batch job, server job, or trigger is just as easy as debugging an interactive application.
My favorite debugging tool is the System i5 Debugger. I prefer it over both the green-screen (STRDBG) debugger and the one included with WDSC/RDi. I recently learned that the System i5 Debugger supports SEPs! In this article, I show you how to use them.
The System i5 debugger is a GUI tool for debugging programs that run on the IBM i platform. It supports debugging OPM RPG, OPM CL, OPM Cobol, ILE RPG, ILE CL, ILE Cobol, ILE C, ILE C++, Java, and PASE C/C++.
The System i5 Debugger is included as part of the Toolbox for Java (57xx-JC1) licensed program, which is included with the IBM i operating system, so you won't have to shell out any extra money for it. Contrast this with the Interactive Source Debugger (STRISDB)which supports relatively few languages and requires you to purchase ATDSor the RDi debugger, which requires you to pay for RDi.
Since RDi's debugger has a GUI, as does the System i5 debugger, it's similar to the System i5 Debugger in many ways. Both support most of the same features and are written in Java. However, the System i5 debugger is cross-platform, unlike the RDi one, which runs only under Windows. The System i5 Debugger also requires less memory and is simpler to use than the RDi debugger. Even with these advantages, I still used RDi's tool until recently because I didn't realize that the System i5 debugger could use SEPs!
In "STRDBG Can Be GUI!" (February 24, 2005, article ID 20545), I discussed how to get started with the System i5 Debugger. As that article is nearly four years old, some parts of it might be out of date. IBM documents the System i5 Debugger in the Information Center under Programming|Development Tools|System i5 Debugger.
Furthermore, I recently discovered that the System i5 Debugger can be launched from within IBM i Navigator. To start it from Navigator, click your computer's name, then Databases. Select the database you use on your system, then click Run an SQL Script. From the Run SQL Scripts window, click Run|Debugger.
SEPs provide a way of setting a breakpoint in debug so that any time your user ID(or another user ID that you designate) runs a given program, it triggers the breakpoint and opens the program in the debugger. Regardless of whether the program is run interactively or in a batch job or a server job, anytime the program is run by that user, it opens in debug automatically.
To learn more about SEPs, and how to use them with STRDBG or the RDi debugger, please see "An Easier Way to Debug Batch Jobs" (January 25, 2007, article ID 53910).
Using SEPs in the green-screen debugger is very awkward, as it does not start the debugger for you, but instead just sends you the job name, user ID, and job number. You still have to run the Start Service Job (STRSRVJOB) command manually to debug the job.
By contrast, in the RDi debugger, you simply tell the system which program to debug with a SEP. That's all you have to do, and as soon as the program is run, it automatically pops up in the RDi debug perspective and gives you a chance to set breakpoints or step through the code or do whatever the circumstance dictates. This functionality makes SEP very easy to use from the RDi debugger.
The System i5 Debugger's support for SEPs is somewhere in between the green-screen method and the RDi method. It's not quite as easy or elegant as RDi, yet it's nowhere near as awkward as the green-screen tool.
To try SEPs from the System i5 Debugger, do the following:
Here's a screenshot that shows what it looks like when you change a breakpoint's properties to use SEPs:
Here's a screenshot that shows what it looks like when the SEP breakpoint has fired in the System i5 Debugger:
