Skip to main content

     
  TPF : Library : Newsletters

Visiting with VisualAge

Ellen Smyth, IBM TPF ID Core Team, and Bradd Kadlecik, IBM TPF Development

This is the second in a series of articles about VisualAge TPF for Windows NT. In this article, we discuss the TPF enhancements for VisualAge client as well as how to trace created ECBs and customize the debugger.

Enhancements for TPF PUT 11

In keeping with the plans of the TPF development lab to enhance TPF support for VisualAge client, we added the following three small programming enhancements (SPEs) for PUT 11:

  • Debug on system error (APAR PJ26660)
  • Universal data display (APAR PJ26581)
  • Trace on production (APAR PJ26666).

Debug on system error helps you to recover when you get a system error while you are running an application program; for example, when you are debugging a program (which implies that you have an active debugger session for the TPF Assembler Debugger for VisualAge Client or TPF C Debugger for VisualAge Client) and you get a system error. Before this APAR became available, the program you were debugging would have ended. If you have applied the debug on system error APAR and you get an error in your program, you now have the opportunity to correct the error and then continue running the program. This will save you time and aggravation—try it! We plan to provide you with more details about debug on system error in a future article.

The universal data display (UDD) is designed to make debugging easier for you. The assembler and C debuggers maintain separate views of storage. The UDD provides a consistent view of storage; that is, no matter which debugger is active, the UDD provides a single interface to display ECB data. The UDD provides for views of the ECB work areas, levels, and so on in a more comprehensive and more readable format than with displays that were available previously. For example, let's say you are using the C debugger and you step into an assembler function. This causes the assembler debugger to become active; however, because of the UDD, you still have a seamless view of the ECB.

Trace on production expands the capability and usability of the ZDBUG functional message by letting you do the following:

  • You can use the STOP parameter to disable the debugger that you are using.
  • You can use the DISPLAY parameter to display trace registration information for one or both of the trace-by-terminal or trace-by-program tables whether the entry status is active or nonactive. The display includes the following information:
    • It tells you if you are using the C debugger, assembler debugger, or performance analyzer.
    • It verifies that you are actively debugging a program. (If you are using the VisualAge Performance Execution Trace Analyzer for TPF, this field is blank.)
    • It carries the user token field from the registration window. You can use this field to select an ECB to debug by associating a particular ECB with a debugger session.
    • It tells what programs are registered.
  • You can use the CLEAR parameter to clear all trace entries in the table or clear a single entry for a specified Internet Protocol (IP) address. One caveat here is that you must stop all your current debug sessions before using the CLEAR or CLEAR and IP parameters. If you do not stop a debug session (that is, an entry is active), zeros will be displayed in the WORKSTATION IP and TERMINAL fields of the trace-by-terminal or trace-by-program tables.

Tracing Created ECBs

Because created ECBs have no associated terminal address, you would normally have to specify an asterisk (*) for the terminal address to debug such programs. This might work OK if only one person is using the TPF system, but when multiple users are using the system or when multiple creates of that program might be occurring, you might need to be more selective. Therefore, since their release, both the TPF assembler and C debuggers have allowed debugging to flow from the parent ECB to the child. For this to happen, trace-created entries must be checked in the debug registration window. The child program must also be one of the programs registered as in the example that follows. QPK0 is the program to start debugging in the parent ECB, and QPM9 is a program that gets created (child ECB).

VA/TPF Debugger

When the trace created entries box is checked, all creates will cause a pop-up box to be displayed from which you must choose whether you want to continue debugging the parent ECB or start debugging the child ECB. If you select the child ECB, a new debugger session will be started for one of the programs listed in the debugger registration entry. The debugger session with the parent ECB is allowed to continue so that it is possible to debug both the parent and the child ECB.

VA/TPF Debugger

Customizing the Debugger

Everyone has their own idea of how the desktop should look. Whether it is the screen saver, the background, the task bar, or the shortcuts, everyone has customized their desktop to make it easier or just more enjoyable. The debugger would be remiss if these same types of options were not allowed. So, under the options menu bar, there are many ways you can customize your debug sessions. We will explain just a few that we have found particularly useful.

Monitor properties:

When using the assembler debugger, we often became annoyed that the program monitor would appear when we almost always were more interested in seeing the storage monitor so we could view 80 bytes or more of raw data at a time. Then we discovered the monitor properties option.

VA/TPF Debugger

The Monitor Properties window allows you to set which type of monitor should be the default, so double clicking on an expression will add the expression to the monitor. The Program monitor is the default after installation. This monitor is OK for C and C++, but many times we are not interested in the one-line display when looking at things in assembler. By selecting the Storage monitor for our assembler debugger sessions, double clicking on an expression will always get us the large display of storage that we are looking for. We do not know of any reason why someone would pick the Popup monitor or Private monitor over the Program monitor, however, because the Program monitor has the little-known "stay on top" feature. What feature is that? Well, because you took the time to read this article, we will explain how to use this feature. By highlighting the Program monitor and pressing F8, the Program monitor will always stay on top of other debugger windows (similar to how the task bar stays on top), so you can step through the code while having the variables displayed in the forefront. To stop the Program monitor from always staying on top, highlight it again and press F8. F8 acts as a toggle to allow the stay on top feature to be turned on and off.

Select program profile information:

VA/TPF Debugger

We also became annoyed with the debugger when several windows were displayed again each time we started a debug session. Under the debugger settings options, there is something called "program profiles". As some of you may have already learned, the debugger keeps track of which monitors were being used, what was displayed in each, and what breakpoints were set so that all these things can be reestablished in a later debug session. You might be interested in having only some or maybe even none of these things being saved. We typically do not like to see storage windows displayed again because the location we are interested in has probably changed. Feel free to select from the list which items would be useful to have if you had to start a debug session again and leave out the remaining items.

Exception filtering:

A final option that has become particularly useful after PUT 11 is the exception filter. APAR PJ26600 allows you to stop the debugger on certain errors. If TEST(ALL) is highlighted, each error will cause an exception pop-up window to be displayed. If you are not interested in this, you can deselect TEST(ALL) and errors will be processed normally.

As we mentioned in the first Visiting with VisualAge TPF article, requirements are being compiled and prioritized through the TPF Users Group. However, we welcome feedback from everyone who has used or seen these tools in action.