Quick Tips for Using RD Power Debugging Perspective
Date Posted: February 02, 2012 08:17 AM

Every programmer who debugs a program using the green-screen Start Debug (STRDBG) command knows the most frequently used commands—that is, EVAL, WATCH, and BREAK (and their two character counterparts EV, WA and BR, respectively.) Unfortunately, I've learned in my travels that many of us don't take advantage of all the available features in the old reliable green-screen debugger, even though they've been supported for years. With so many more features available in feature rich RD Power, it's important to not fall into this same trap.

One feature in STRDBG that developers don't seem to take advantage of is a conditional breakpoint such as "break 309 when hours = 40". Another one that I believe is even lesser known is identifying where the current point of control is. The question here is how do you know exactly where the next line of execution will be after you've paged up or down multiple times? Probably the most common response I hear is, "Well, just press F10 to step one instruction and the debugger will jump back to the current line." While that is true, you've also just executed the next instruction, which could significantly impact the program's execution or environment. For example, what happens if that next instruction happens to be a delete or update statement? The correct response would be to press F5. This will reposition the cursor and screen at the current line of execution. With that said, let's explore some features of the Rational Developer for Power Systems Software (RD Power) debug perspective that you may not be using today.

In STRDBG, stepping through a program is accomplished using F10. When control encounters an instruction to invoke another program or procedure, you can choose to step over it or step into it by pressing F22. RD Power takes these basic functions and expands upon them. A quick look at the toolbar shows these functions:

 RDP_debugging-698772-Fig1

Hovering over these different icons reveals what its function. Starting with the green arrow, the tool tips displayed are Resume (F8), Terminate (Ctrl + F2), Animated Step Into (2000 ms), Step Into (F5), Step Over (F6) and Step Return (F7). The two that I believe most developers do not use regularly are animated step and step return. How many times do you incessantly press F5 or F6 just to get to a certain point in your program? Also, wouldn't it be great to have RD Power automatically step through your code while you just sat back, relax, and watch the variables change in your variables or monitors view all by themselves? This is exactly what animated step into does for you. Clicking on the down arrow brings up this menu:

RDP_debugging-698772-Fig2

Clicking on Preferences brings up this window:

RDP_debugging-698772-Fig3

These speeds dictate how quickly the auto-pilot feature should be executed. Notice you can also click the menu to speed up or slow down the stepping speed by the value specified in the preferences.

Step return (F7) is a feature that immediately returns you from a stepped-into program. Simply put, if you select Step into (F5), you can immediately return from the module you just stepped out of by selecting step return. This saves you from having to step through every instruction in the stepped-into module.

The variables view shows every variable that is active in the program. Quick FYI: a double-edged sword exists here because when this view is open the system needs to continuously refresh all the values that are displayed. If you are debugging on a remote system using VPN on a slow connection, you should consider closing this view to reduce the Internet traffic passed back and forth. When this view is open and you are viewing dozens or hundreds of variables, you can position the view at a particular variable by pressing CTRL-F.

Here is the normal variables view:

RDP_debugging-698772-Fig4

Here is what appears when CTRL-F is pressed:

RDP_debugging-698772-Fig5

The variables view has some interesting options in the pull-down menu: 

RDP_debugging-698772-Fig6

The Vertical and Horizontal options instruct RD Power where to display in the details pane the values of individual variables as you click them. The details pane will be shown either to the right of the variables or below them depending on your choice. The Variables View Only removes the details pane entirely. Choosing Show Columns will either remove or display the Excel-like columns for the variable names and values. When the columns are not shown, the variables are displayed as "CCUSNO = 0095782", for example. Notice, too, that many of the other views also have a pull-down menu that lets you customize the arrangement of data in that particular view. With the details pane displayed, clicking on a field will display its current value. Right-clicking in the details pane will display another menu as shown:

RDP_debugging-698772-Fig7

In the above screen shot you'll notice that only a portion of the field is displayed followed by an ellipsis. This is done when the length of the variable exceeds the defined maximum length to be displayed. Clicking on Max Length will present another window where you can tell RD Power how many characters to display: 

RDP_debugging-698772-Fig8

As you can see, there is a lot to learn well beyond basic application program debugging. One of my new favorite features of RD Power debugging is also the most recent enhancement in Version 8.03.01, which I just installed. This new feature lets you start the debug server (if it isn't already running) immediately after you've selected a program to debug (see below). In the past you had to cancel your debugging request and manually start the debug server either through RD Power's remote servers or the green-screen command STRDBGSVR.

RDP_debugging-698772-Fig9

This feature was requested from RD Power users in the community via Requests for Enhancements (RFEs). To see a complete list of features that were added to the latest version, visit the article "What's New in Rational Developer for Power 8.0.3" by IBM's David Dykstal, an architect for RD Power.

I'll wrap this tip up by encouraging you to start or continue using RD Power. If you identify an issue with it or have a suggestion for improvements, do contact IBM. The Power community only stands to benefit when the collective knowledge is available to everyone involved.


Want to use this article? Click here for options!
Want to subscribe? Click here!
There are no comments to display. Be the first to add your thoughts!
You must log on before posting a comment.

Are you a new visitor? Register Here
 

around the forums

Retrieving messages
Forum Name: CL
17 May 2012 11:15 AM | Replies: 0
POI .xlsx spreadsheets - freeze pane
Forum Name: RPG
17 May 2012 09:31 AM | Replies: 1
DBCS Open Data Field type O
Forum Name: SQL, Query and Database
17 May 2012 06:42 AM | Replies: 0

ProVIP Sponsors

BCD

Join Our Community!

Subscribe today to iPro Developer! iPro Developer is packed with technical know-how for developers of IBM i, iSeries, AS400 and System i. Sign up now to get your full subscriber benefits including:

  • Code available for download
  • Full access to the online article archive (including all System iNEWS ProVIP content)
  • Downloadable ebook with past 6 months of articles
  • Discounts on eLearning classes, self-paced training, in-person events, and more!
iPro Developer Newsletters
  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips