asna extermin8 - Linoma Software
Transcription
asna extermin8 - Linoma Software
ASNA EXTERMIN8 COBOL, RPG, CL User’s Guide and Reference Manual This Manual and the EXTERMIN8 debugger contains proprietary information of ASNA (Amalgamated Software of North America, Inc. No component of the EXTERMIN8 product, including the software and the documentation may be reproduced, disassembled, transmitted, transcribed, stored in a retrieval system, or translated into any language, in any form, without the written permission of ASNA. Copyright 1993, 1996 - 2001 ASNA - Amalgamated Software of North America. All rights reserved. Microsoft and Windows is a registered trademark of Microsoft Corporation. Release 6.17 Last Revised, Feb, 2001 Amalgamated Software of North America, Inc. UNITED STATES 14855 Blanco Road Suite 300 San Antonio, TX 78216 (210) 408-0212 8:00 am to 6:00 p.m. Central Time UNITED KINGDOM 31 Frederick Sanger Road Surrey Research Park Guildford Surrey GU2 5YD United Kingdom Tel: (01483) 570666 International: +44 1483 570666 i Contents Chapter 1 - Introduction ........................................................................ 1 The EXTERMIN8 Package .................................................................................................. 2 Requirements................................................................................................................. 2 What the Installation Will Do............................................................................................... 3 Transferring and Installing EXTERMIN8 to the AS/400....................................................... 3 Installing EXTERMIN8 from the AS/400 ............................................................................. 3 Installing EXTERMIN8 using Tape Media .................................................................... 3 Installing EXTERMIN8 using an AS/400 CD-Rom Drive .............................................. 4 Installing EXTERMIN8 from the PC .................................................................................... 4 Installing EXTERMIN8 onto the AS/400 from the PC using FTP................................... 4 License Code ....................................................................................................................... 5 Entering, Displaying or Changing a License Code on the AS/400................................... 5 Installing New Releases of EXTERMIN8 ............................................................................. 7 Installing New Releases of OS/400....................................................................................... 7 Removing EXTERMIN8 from the AS/400............................................................................ 7 Technical Support ................................................................................................................ 7 Chapter 2 - Getting Started.................................................................... 9 EXTERMIN8 Quick Start ...................................................................................................10 EXTERMIN8 Commands ....................................................................................................11 Using the EXTERMIN8 Tutorials for RPG and COBOL .....................................................11 To Start the Tutorials for RPG ......................................................................................12 To Start the Tutorial for COBOL ..................................................................................12 Chapter 3 - Using EXTERMIN8 ............................................................ 13 Starting a Debug Session.....................................................................................................14 EXTERMIN8 Command Parameters ...................................................................................14 Program (PGM) ............................................................................................................14 Job (JOB) .....................................................................................................................14 Update Production File (UPPROD) ..............................................................................15 Clear EXTERMIN8 Command Log (CLRLOG) ............................................................15 Prompt for Source Names (PRMTSRC) ........................................................................15 Startup Script (STRXRPT) ...........................................................................................15 Program Source Prompt Screen.....................................................................................15 Preparing Programs to be Debugged .............................................................................15 The EXTERMIN8 Screen....................................................................................................16 The Browse Window...........................................................................................................16 SEU Type Browse Commands ......................................................................................16 SEU Type Function Keys and Commands .....................................................................17 Function Keys that may be used with the Browse Window ............................................17 Commands that may be used with the Browse Window .................................................17 The Log Window ................................................................................................................17 The Command Log File ................................................................................................18 Function Keys that may be used with the Log Window..................................................18 The Status Bar ....................................................................................................................18 EXTERMIN8 Commands ....................................................................................................19 Actions .........................................................................................................................19 ii Object Types Used by EXTERMIN8 are:......................................................................20 Conditional Expressions......................................................................................................21 Example of a Conditional Expression ...........................................................................22 User Choices.......................................................................................................................22 User Choices Parameters ..............................................................................................23 Using EXTERMIN8 in the System/36 Environment.............................................................27 Debugging RPG Programs Containing COPY Statements..............................................28 Debugging COBOL Programs Containing COPY Statements ........................................29 Debugging COBOL SQL ..............................................................................................29 Executing Programs To Be Debugged .................................................................................29 Interactive Programs.....................................................................................................29 Batch Programs ............................................................................................................30 Other Points to Consider When Using EXTERMIN8 ...........................................................30 Chapter 4 - Advanced Debugging Features ........................................ 31 Debugging Jobs that are Currently Executing ......................................................................32 Debugging a Batch Job that is Not Yet Running ..................................................................32 Using Scripts.......................................................................................................................33 Creating a Script...........................................................................................................33 Running a Script when Starting EXTERMIN8 ..............................................................34 Running a Script From Within EXTERMIN8 ................................................................34 Other Script Commands ................................................................................................35 Profiling..............................................................................................................................35 Starting Profiling from the Command Line....................................................................35 Starting Profiling from within Extermin8 ......................................................................36 End Profiling ................................................................................................................36 Clear Up Profiling ........................................................................................................37 Review Profiling Counts ...............................................................................................37 Printing Profiling..........................................................................................................38 Network Debugging ............................................................................................................38 Chapter 5 - Debugging Function Keys ................................................ 41 ATTN - Attention Key ........................................................................................................42 HELP - Help Key ................................................................................................................42 RolUp/RolDn - Roll Keys ...................................................................................................42 PRINT - Print Key ..............................................................................................................43 F1 - Break and Go...............................................................................................................43 F2 - Adjust Split of Windows ..............................................................................................43 F3 - Quit Session.................................................................................................................44 F4 - Prompt/Change Variable ..............................................................................................44 F4 - Prompt a Command......................................................................................................44 F5 - Display Current Location .............................................................................................45 F6 - Go to TAG, ENDSR or Paragraph Name......................................................................45 F7 - Find Top of Structure (RPG Only) .............................................................................45 F8 - Find End of Structure (RPG Only) .............................................................................45 F9 - Retrieve Variable .........................................................................................................46 F9-Retrieve Program Source (RPG and CL) ......................................................................46 F9-Retrieve Program Source (COBOL) .............................................................................46 F9 - Retrieve a Command ....................................................................................................47 F10 - Add/Remove Breakpoint ............................................................................................47 F11 - Single Step Execution ................................................................................................48 iii F12 - Start/Resume Execution .............................................................................................50 F13 - Display User Screen...................................................................................................50 F14 - Expand/Contract Browse Window..............................................................................50 F14 - Expand/Contract Log Window ...................................................................................51 F15-Toggle Upper/Lower Case Input on the Command Line................................................51 F16 - Find a String ..............................................................................................................51 F17 - Top of Source ............................................................................................................52 F18 - Bottom of Source .......................................................................................................52 F19 - Show Left of Source ..................................................................................................52 F20 - Show Right of Source ................................................................................................53 F21 - Toggle SEU Numbers or Nesting, or Execute Script...................................................53 F22 - Add/Remove Breakpoints up to Cursor Position .........................................................53 F23 - Step Over (RPG)......................................................................................................54 F23 - Step Over (COBOL) ................................................................................................54 F24-Step Out (RPG)..........................................................................................................54 F24-Step Out (COBOL) ....................................................................................................55 Chapter 6 - Debugging Commands ..................................................... 56 Command Syntax ................................................................................................................57 Priority of Operators.....................................................................................................57 AB - Add Breakpoint ..........................................................................................................59 AD - Add Display ...............................................................................................................59 AM - Add Monitor ..............................................................................................................60 AP - Add Program...............................................................................................................60 AX - Add Script ..................................................................................................................61 B - Bottom ..........................................................................................................................61 CB - Change Breakpoint .....................................................................................................62 CC - Change Contents .........................................................................................................62 CM - Change Monitor .........................................................................................................63 CO - Change Occurrence (RPG Only) ...............................................................................63 CP - Change and Compile Program .....................................................................................64 CS - Change Source ............................................................................................................64 CX - Change Script .............................................................................................................65 D@ - Display @Location ....................................................................................................65 D@ - Display Calling Stack ................................................................................................66 DB - Display Breakpoint .....................................................................................................66 DC - Display Contents ........................................................................................................67 DD - Display Display ..........................................................................................................67 DI - Display Indicators (RPG Only) ..................................................................................68 DL - Display List (RPG Only) ...........................................................................................68 DM - Display Monitors .......................................................................................................68 DP - Display Program .........................................................................................................69 DR - Display SubRoutine (RPG) .......................................................................................69 DR - Display PaRagraph or Copybook (COBOL) ..............................................................69 DS - Display Source............................................................................................................70 DX - Display Script.............................................................................................................70 F - Find ...............................................................................................................................70 FT - Find Type (RPG) .......................................................................................................71 FT - Find Type (COBOL) .................................................................................................72 GP - Go Program ................................................................................................................72 GX - Go Script....................................................................................................................73 G6 - Go S/36 Procedure ......................................................................................................73 iv LB - List Breakpoints..........................................................................................................73 LD - List Displays...............................................................................................................74 LF - List Files .....................................................................................................................74 LM - List Monitor ...............................................................................................................75 LP - List Programs ..............................................................................................................75 LR - List SubRoutines .........................................................................................................76 LS - List Source ..................................................................................................................76 LV - List Variable ...............................................................................................................76 LX - List Script ...................................................................................................................77 PN - Print Profiling .............................................................................................................77 RB - Remove Breakpoint ....................................................................................................77 RD - Remove Display .........................................................................................................78 RM - Remove Monitor ........................................................................................................78 RP - Remove Program.........................................................................................................79 RS - Remove Source ...........................................................................................................79 RX - Remove Script ............................................................................................................79 SA - Set Attributes ..............................................................................................................79 SA - User Choices...............................................................................................................81 User Choices Parameters ..............................................................................................81 SN- Start Profiling ..............................................................................................................85 SP - Set Program.................................................................................................................85 T - Top ...............................................................................................................................85 OS/400 Command Processor ...............................................................................................86 Appendix A - Error Messages.............................................................. 87 Appendix B - Quick Reference ............................................................ 91 EXTERMIN8 Function Keys...............................................................................................92 EXTERMIN8 Commands ....................................................................................................94 Appendix C – PC Support and Emulation ........................................... 97 Index..................................................................................................... 99 1 C H A P T E R 1 Introduction EXTERMIN8 is truly an interactive source level debugger that allows access to RPG, CL and COBOL programs to quickly find those subtle bugs. It can: • Stop execution at predefined breakpoints. • Invoke single step execution. • Monitor for specified conditions. • Display and modify fields and indicators. With Version 5, ASNA is pleased to introduce the option to be able to debug programs running on the AS/400 from the windows environment of an attached PC. This gives the user more power to define the layout and the information displayed on the screen. Point and click mouse operations significantly improves productivity, while color-coding of displayed information enhances visual understanding of what is happening. Clicking the right-mouse button pops up a Menu with options relevant to the position of the cursor. Watch windows can be defined where the value of the variables displayed are constantly updated whenever a breakpoint is reached. With the increased use of PC’s in development departments throughout the world, this option allows the debugging of the server portion of Client/Server applications from the same machine as the client portion is running on. When the windows option is used to debug interactive programs, those programs can be running on either a 5250 emulation session on the same PC or on a different terminal. EXTERMIN8 may also be used from a “green screen” AS/400 non-programmable terminal, or from a 5250 emulation session on any PC, to debug programs running in the same session or in batch. EXTERMIN8, as a source level debugger, opens the door to manipulate RPG, CL and COBOL program(s) interactively through commands issued against the source statements. For instance, to stop the execution of a program at a particular statement (breakpoint), simply position the cursor at that statement and press F10. The statement is underlined directly on the source to display that the execution will stop at that statement. When a breakpoint is reached during the execution of any program in the debug mode, the source of that program is shown, and the statement is highlighted. A particular variable, record, or data structure, may be displayed or modified by positioning the cursor on the name of the item in the source and processing a single Command key. The strength of EXTERMIN8 is in its extensive set of features, detailed in the user guide sections, that allows the expansion of debugging skills, even to the extent of creating one's own debugging commands! EXTERMIN8 is a tool used to get closer to the programs, thereby increasing productivity and satisfaction when debugging or modifying a program. 2 EXTERMIN8 This introduction section covers all general aspects of installing and maintaining EXTERMIN8 on a System, and then the manual breaks into two sections. One part being a guide for programmers wishing to use the product via a PC running Windows, Windows ’95 or Windows NT. The other part is the User Guide for “green screen” terminals. Contents • EXTERMIN8 Package • What the Installation Will Do • Installing EXTERMIN8 from the PC • Installing EXTERMIN8 from AS/400 Media • Entering a License Code • Installing New Releases • Removing EXTERMIN8 • Technical Support The EXTERMIN8 Package The EXTERMIN8 software package contains the following items: • The AS/400 part of the EXTERMIN8 product on AS/400 media. • The Windows part of the product on PC diskettes. • EXTERMIN8 User’s Guide. • Literature and References. • On-Line Help. • On-Line Manuals. • Keyboard templates for both PC and terminal keyboards. Requirements EXTERMIN8 requires an IBM AS/400 running the OS/400 operating System Version 2, Release 3.0 or higher. Please note that different libraries are loaded for different versions of the OS/400. User must have *USE authority to the OS/400 debug Commands STRDBG, ENDDBG, STRSRVJOB, and ENDSRVJOB. When using the windows option, the user profile, the router is signed on, and must have the fore-mentioned authority. To use the windows option OS/400 must be at either Version 2 Release 3 or Version 3 Release 1. The windows option is not supported on Version 3 Release 5. To use the windows option the PC must be at least a 386 processor with 8 megabytes of memory running either Windows 3.1 or 3.11, or Win’95 or Windows NT. The PC must be connected to the AS/400 via an APPC router, such as Netsoft, Client Access, Rumba or PC Support. Note: When upgrading to a new release of OS/400, be sure to contact ASNA Technical Support, (210) 408-0212, to ensure that your current release of EXTERMIN8 will run properly with the new operating System. Review your License Agreement for the privileges available from Maintenance. Introduction 3 What the Installation Will Do On the AS/400: • Restore the temporary library, XT8TEMP. • Restore the Tutorial library XT8TUTOR. • Request an Authorization Code to validate operation product. Note: You must ensure that no one is using EXTERMIN8 prior to and during the installation process. Transferring and Installing EXTERMIN8 to the AS/400 The procedure to install EXTERMIN8 on the AS/400 consists of 2 parts. The first is to transfer EXTERMIN8 to the AS/400, either from the PC or AS/400 media, and the second is to actually install EXTERMIN8 onto the AS/400. There are 2 ways in which you can transfer EXTERMIN8 to the AS/400 from AS/400 Media. • • AS/400 Tape Media A CD-Rom on the AS/400 There is 1 way in which you can transfer EXTERMIN8 to the AS/400 from the PC. • FTP Refer to the appropriate installation procedure below consisting of the desired transfer method. Each procedure will have a subheading noting whether the steps are done on the AS/400 or the PC. The last step in each procedure will be to run the command that actually installs EXTERMIN8 onto the AS/400. Installing EXTERMIN8 from the AS/400 Installing EXTERMIN8 using Tape Media This installation process has two steps. • The first step is to restore a temporary installation library and can be done by anyone with *USER authority or higher. • The second step does the actual installation and initialization of the product and requires *SECOFR authority to run it. To Install from AS/400 Tape Media 1. Load the Installation tape. Enter the following command to restore the Install program to the XT8TEMP library: RSTLIB XT8TEMP TAP01 TAP01 refers to the device name from which the object will be restored. If an alternative tape drive is being used, enter the appropriate device name. 2. Once the library is restored, sign onto the AS/400 with *SECOFR authority and execute the following command: XT8TEMP/LODXT8 Once the installation is completed, the XT8TEMP library is automatically deleted. 4 EXTERMIN8 Installing EXTERMIN8 using an AS/400 CD-Rom Drive This installation process has two steps. • The first step is to restore a temporary installation library and can be done by anyone with *USER authority or higher. • The second step does the actual installation and initialization of the product and requires *SECOFR authority to run it. To Install from an AS/400 CD-Rom 1. To restore the installation library, load the CD, then enter the following command: RSTLIB XT8TEMP OPT01 OPTFILE(' XT8/RSTLIB/XT8TEMP') (where OPT01 refers to the device name from which the object will be restored) 2. Then enter the following command: XT8TEMP/LODXT8 The installation program will prompt for a registration code if one has not already been entered. Once the installation is completed, the XT8TEMP library is automatically deleted. Installing EXTERMIN8 from the PC Installing EXTERMIN8 onto the AS/400 from the PC using FTP In order to install EXTERMIN8 on the AS/400 from a Save file (obtained from the Installation CD), you must have TCP/IP installed on both your PC and on the AS/400. (You must also have FTP installed on your AS/400). Note: Installing TCP/IP and FTP on the AS/400 is beyond the scope of this document. If you do not know whether your AS/400 has TCP/IP and/or FTP, please check with your network manager or system provider. On the AS/400 1. Sign onto the AS/400 using an account with *SECOFR authority. 2. On the AS/400, create a library (temporary) called ASNADLVR. (Note: QTEMP must not be used). CRTLIB ASNADLVR 3. Add this library to the library list: ADDLIBLE ASNADLVR 4. Create a Save file in the same library as the physical file: CRTSAVF FILE(ASNADLVR/XT8SF) On the PC 5. To upload the Save file from the CD or PC, an FTP session must be started to the AS/400. From Windows 95, or Windows NT 4.0, click on the START button and select RUN. From Windows NT 3.51, select Run from the file menu option from the Program Manager and enter the following command: FTP as400tcpipaddress where as400tcpipaddress is either a TCP/IP address such as 198.176.129.35, or a machine name that is registered either in a DNS or a HOSTS file. 6. When prompted for a user name and password, enter the appropriate information that will give you privileges to upload data to the AS/400. Introduction 7. 5 Once FTP has been started, upload the Save file to the AS/400 by entering the following commands: a) binary b) put x:\XT8\FTP\XT8TEMP ASNADLVR/XT8SF where x is the CD-ROM drive or PC disk drive c) quit On the AS/400 8. Restore the library called XT8TEMP from the Save file in ASNADLVR. RSTLIB SAVLIB(XT8TEMP) DEV(*SAVF) SAVF(ASNADLVR/XT8SF) 9. To install EXTERMIN8, execute the following command: XT8TEMP/LODXT8 10. Once the installation has completed, the library ASNADLVR is no longer needed, and may be deleted. (The XT8TEMP library is automatically deleted). License Code Before EXTERMIN8 may be used on any AS/400, a valid license code, issued by ASNA, must be entered. For new trials, this code will be sent with the product if the machine serial number and model type are known at the time of shipping. The code issued with a trial of EXTERMIN8 will license, or register the product to be used on a specified machine up to a specified date. If it is required to move the product onto another machine, upgrade the model type, or extend the trial period, please contact your Distributor or ASNA for a new license code. Once the product has been purchased, a new license code will be issued to register the product on a permanent basis. This code will be based on either unlimited users, or on a per-user basis. Entering, Displaying or Changing a License Code on the AS/400 A new license code is entered, or a current license can be viewed or changed by using the product’s Registration Assistant program. When installing the product for the first time, or when an upgrade is installed, the Registration Assistant screen is displayed with the bottom of the screen displaying whether the current License Code is valid or not. If the License Code is valid, press F3 to continue. If not, call ASNA or your Distributor to get a new License Code. Note: You cannot use the product without a proper License Code. To Enter a New License Code, or Display the Current License Code 1. If you are not already at the Registration Assistant Screen, enter the following: a. ADDLIBLE LIB(EXTERMIN8) POSITION(*FIRST) b. EXTERMIN8/REGISTER The following screen will display: 6 EXTERMIN8 2. Enter or verify the information as detailed below. System Name The name of the AS/400 will automatically display. Model The model of the AS/400 will automatically display. Serial Number The serial number of the AS/400 will automatically display. License Key For a new license, enter the 16-digit license code acquired from ASNA exactly as it is given. License Type License Type specifies if the licensing is for an individual machine, or for the entire company. • To license, or register the current machine, use *MACH, which is the default. • To license, or register the entire company, enter *SITE. Customer Name The name of the user that was entered when the product was installed will automatically display. However, you can change this name as needed. Note: The customer name is case-sensitive and must match the customers name exactly as ASNA's account shows. Company Name The name of the company that was entered when the product was installed will automatically display. However, you can change this name as needed. Note: If you are entering a Site License, the name of the company must be spelled exactly as determined by you and ASNA. This name is also case-sensitive, so capitalization must match exactly. Start Date The Start Date specifies if the product has been purchased, in which you have a Permanent code, or if the product is a “Trial”, which is only valid for a specified period. • If the product has been purchased, use *PERM, which is the default. Introduction • 7 For a ’Trial’ of the product, enter the starting date in the format MM/DD/YYYY. Expiration Date The Expiration Date indicates the date in which the license code will expire. • If the product has been purchased, use *PERM, which is the default. • For a ‘Trial’ of the product, enter the ending date of the trial as specified by ASNA in the format MM/DD/YYYY. User Count User Count specifies the number of concurrent users that can access the product, as a peruser-basis, or as unlimited. 3. • For unlimited users, use *UNLIM, which is the default. • For a specified number of users, enter the user count as a positive integer. Acceptance of a valid licensing code is confirmed at the bottom of the screen. Press F3 to continue. If the message “The License is Invalid” displays, recheck all entries. If no errors were made in any of the entries, call ASNA or your National Distributor for further assistance. Installing New Releases of EXTERMIN8 If a new release of EXTERMIN8 has been received, it is not required to de-install the existing release or reload an expired release. Simply follow the installation as for a new release, unless there were any special instructions enclosed in the shipment. There is no need to enter a new Authorization Code, unless the current copy of EXTERMIN8 has expired. All user choices and Scripts created under the previous release will remain unchanged. Installing New Releases of OS/400 Before upgrading a new release of IBM's operating System (OS/400), please check with ASNA that your current release of EXTERMIN8 is compatible with the new OS/400 release. Removing EXTERMIN8 from the AS/400 To Remove EXTERMIN8 from the AS/400 1. Delete the libraries EXTERMIN8 and XT8TUTOR and any commands that may have been copied to other libraries such as QSYS or QGPL. DLTLIB EXTERMIN8 DLTLIB XT8TUTOR Technical Support If you have ANY questions or problems regarding EXTERMIN8, contact us on the Internet at asna.com or call: In North America: (210) 408-0212 8:00 In Europe: (+44) 1483-570666 8 EXTERMIN8 This Page Intentionally Left Blank 9 C H A P T E R 2 Getting Started EXTERMIN8 is truly an interactive source level debugger that allows access to RPG, CL and COBOL programs to quickly find those subtle bugs. It can: • Stop execution at predefined Breakpoints. • Invoke single step execution. • Monitor for specified conditions. • Display and modify fields and indicators. EXTERMIN8, as a source level debugger, opens the door to manipulate RPG, CL and COBOL program(s) interactively through commands issued against the source statements. For instance, to stop the execution of a program at a particular statement (breakpoint), simply position the cursor at that statement and press F10. The statement is underlined directly on the source to display that the execution will stop at that statement. When a breakpoint is reached during the execution of any program in the debug mode, the source of that program is shown, and the statement is highlighted. A particular variable, record, or data structure, may be displayed or modified by positioning the cursor on the name of the item in the source and processing a single command Key. EXTERMIN8 is very simple to use. The most commonly used commands are executed by function keys. Merely point the cursor and press the appropriate function key. Using this “point and shoot” method makes EXTERMIN8 a very productive programming tool. EXTERMIN8 is very simple to learn, one command and four function keys provide the basic requirements to debug any program. The strength of EXTERMIN8 is in its extensive set of features, detailed in the reference chapters, that allows the explanation of debugging skills, even to the extent of creating one's own debugging commands! EXTERMIN8 is a tool used to get closer to the programs, thereby increasing productivity and satisfaction when debugging or modifying a program. This chapter gives a brief overview of using EXTERMIN8 from an AS/400 terminal, be it either a directly connected non-programmable workstation or a PC running a terminal emulation session. This chapter assumes that EXTERMIN8 has already been installed and a valid authorization code has been entered. It also assumes that the user is aware as to whether EXTERMIN8 is registered to debug COBOL, RPG, or both languages. Contents • EXTERMIN8 Quick Start • EXTERMIN8 Commands • EXTERMIN8 Tutorials 10 Extermin8 EXTERMIN8 Quick Start This section is included for those programmers who want to gain an overview of the product and get going without plowing through the manual. It will teach you the one command and four function keys that you need to get started. The principle of debugging from an AS/400 terminal is that as you start EXTERMIN8 you specify the programs that you want to debug (up to 10). Programs can be added later if necessary but the start command does require at least one program to be specified. Enter : EXTERMIN8/STRXT8 library-name/program_name The source of the first program specified will be displayed on the upper portion of the screen. The EXTERMIN8 screen consists of three sections, the top part being the browse window where program source is displayed. In the middle is the command line, which will accept not only EXTERMIN8 commands, but also all OS/400 commands. The user can scroll through the displayed source and set breakpoints as required by placing the cursor on the line where execution is required to stop and press F10. Note: Execution will stop BEFORE this line is executed. It is recommended, when first using EXTERMIN8, to set a breakpoint at the beginning of the program in code that you are sure is going to be executed. Breakpoints can be set in other programs at this time or when execution has stopped at a breakpoint in the first program. When at least one breakpoint has been set, the program to be debugged can be executed. This can be achieved in a variety of ways: 1. 2. 3. 4. If the program does not require any parameters and does not need to be called from another program: • Press F12 • or enter GP on the EXTERMIN8 command line • or enter a CALL statement on the EXTERMIN8 command line. If the program requires parameters, but does not need to be called from another program: • Enter the parameters on the command line, enclosed in parenthesis and press F12. • Enter GP followed by the parameters in parenthesis, on the EXTERMIN8 command line. • Enter a CALL statement with the required parameters on the EXTERMIN8 command line. If the program needs to be executed from another program or menu: • Enter the CALL statement with any required parameters on the EXTERMIN8 command line. • Enter GO menu_name on the EXTERMIN8 command line then, when the menu is displayed, select the required option. If the program needs to be executed in batch mode or is running from another terminal : • You need to end this EXTERMIN8 session and read Chapter 3 of this section of the manual or use the Windows option of the debugger. Chapter 2 Getting Started 11 Normal execution will continue until the breakpoint is reached. There is no need for the preceding program(s) to be in debug mode. Once the breakpoint has been reached the following can be done: • To display the contents of a variable position the cursor on the variable name in the displayed source file listing and press F9. • To change the contents of a variable place cursor on the variable name and press F9. • To set another breakpoint, place the cursor on the required line and press F10. • To execute the line currently stopped on and then stop before the next line press F11. • To continue execution to the next breakpoint press F12. These are the basic debugging commands. There is, of course, many other functions, which are described in the next chapters of the manual. A quick reference of all the function keys and commands is available by pressing the HELP function key. Function key templates are also available for both PC and standard 122-key keyboards. EXTERMIN8 Commands EXTERMIN8 has six commands that may be entered from the OS/400 command line: STRXT8 Start EXTERMIN8. (Refer to Chapter 2 of this manual.) STRTUTOR Start EXTERMIN8 Tutorial. (See the instructions below.) XT8SRV Start EXTERMIN8 on a Batch program. (Refer to Chapter 3 of this manual.) STRXT8RPF Start Profiling. (Refer to Chapter 3 of this manual.) CLRXT8PRF Clear Profiling. (Refer to Chapter 3 of this manual.) When the product is installed, the above commands reside in the library EXTERMIN8. It may be more convenient to move them to QSYS or QGPL. This will save having to either qualify them with the library name (as in: EXTERMIN8/STRXT8), or have the library EXTERMIN8 as part of every programmers library list. Using the EXTERMIN8 Tutorials for RPG and COBOL The simplest way to get to know how to use EXTERMIN8 is to work through the on-line, interactive Tutorial that comes with EXTERMIN8. Each Tutorial will take about 10 minutes to complete. The Tutorials are a front end to the real product so the programs are actually running and being debugged by EXTERMIN8, so the screens being displayed are the same as would be seen when debugging one's own programs. The Tutorial program pops up Windows explaining the product and requests the user to make the entries required to perform simple debug functions. If an error is made while entering the Tutorial commands, a message will be displayed at the bottom of the screen. Press the reset Key before re-keying the entry. As the Tutorials actually run EXTERMIN8 they can only be successfully completed if EXTERMIN8 is authorized for the language selected. 12 Extermin8 To Start the Tutorials for RPG The initial RPG Tutorial, WELCOME, will introduce you to the basic concepts of EXTERMIN8. To Start the Tutorial for RPG 1. Enter the following command from any command line. EXTERMIN8/STRTUTOR 2. This will start an interactive Tutorial that will introduce the basics of EXTERMIN8. Follow the instructions as they are displayed on the screen. 3. To end the Tutorial at any point press F3 twice. A second RPG Tutorial, LESSON 2, takes a more advanced look at EXTERMIN8’s capabilities. 1. Enter the following command from any command line. EXTERMIN8/STRTUTOR LESSON2 To Start the Tutorial for COBOL The single COBOL Tutorial covers both the basic and intermediate levels. To Start the Tutorial for COBOL 1. Enter the following command from the command line. EXTERMIN8/STRTUTOR COBOL1 2. Follow the instructions as they are displayed on the screen. 3. To end the Tutorial at any point press F3 twice. 13 C H A P T E R 3 Using EXTERMIN8 This chapter explains the functions of the EXTERMIN8 debugger. It will present a general overview of the screen formats, operation modes and command syntax. Chapter 3 gives detailed instructions for using EXTERMIN8 in special circumstances, and Chapters 4 and 5 provide a detailed reference for all function keys and commands. Contents • Starting a Debug Session • EXTERMIN8 command Parameters • The EXTERMIN8 Screen • The Browse Window • SEU Type function keys • The Log Window • The Status Bar • EXTERMIN8 commands • Conditional Expressions • User Choices • Using EXTERMIN8 in the System/36 environment • Debugging RPG programs where the source contains /COPY statements • Executing programs To Be Debugged • Other Points to consider when using EXTERMIN8 14 Extermin8 Starting a Debug Session User must have *USE authority to the commands STRDBG, ENDDBG, STRSRVJOB, and ENDSRVJOB. To Start a Debug Session 1. Enter the command STRXT8 that exists in the library EXTERMIN8. 2. If F4 is used to prompt for the parameters, see command parameters below. EXTERMIN8 Command Parameters If the command STRXT8 is entered on the command line or within a CL program, the following format of the keywords is required. The default parameters are underlined. STRXT8 PGM(lib/pgm lib/pgm) + JOB(number/user/name) + UPDPROD(*NO or *YES) + CLRLOG(*NO or *YES) + PRMTSRC(*NO or *YES) + STRXRPT(*USRCHOICE or *NONE or name) Program (PGM) Program is a list of up to 10 programs that will be debugged during the EXTERMIN8 session. At least one program name must be given. Programs may be qualified by library name. If the library name is not specified, then the library list will be searched. Further programs can be added during the EXTERMIN8 session (Up to a maximum of 10). There is no need to specify programs that will Run but not be debugged during the EXTERMIN8 session. Job (JOB) Job is the Job to be serviced. If omitted, EXTERMIN8 assumes the current Job (i.e., interactive session) is to be used. The Job number, user, and name may be found using option 5 of either the WRKACTJOB command (Job must be running) or the WRKSBMJOB (if the Job is still in the JOBQ). Refer also to Chapter 3, Advanced Debugging Features, for additional narrative on Job servicing. Chapter 3 Using Extermin8 15 Update Production File (UPPROD) • Update Production File defines whether or not if the programs, running during this debug session, may update files within production libraries. The options are *YES or *NO, the default is *NO. If *YES is chosen, keep in mind that all production files can be updated. Clear EXTERMIN8 Command Log (CLRLOG) Clear EXTERMIN8 Command Log defines whether or not the EXTERMIN8 command Log is to be cleared from the previous debug session before starting this session. Specify *NO to display the command Log in the Log Window as it was at the end of the last session for the same user. The options are *YES or *NO, the default is *YES. Prompt for Source Names (PRMTSRC) Prompt for Source Names directs EXTERMIN8 to either use the source member used by the CRTxxxPGM command that created the object, or to prompt for the source member to be used. The default, *NO, looks for the source member used to create the object. If this member no longer exists, EXTERMIN8 prompts for the source member to use. The option *YES, EXTERMIN8 will display the program source prompt screen, giving details of the source member used to compile the program. The user may then enter the library, source file and member name to be used. A separate screen is displayed for each program declared on the STRXT8 command. Startup Script (STRXRPT) Startup script defines which script, if any, is to be used when EXTERMIN8 begins execution. The default, *USRCHOICE, will execute the script defined on the User Choice screen. The default for the User Choice screen is *NONE. This means that a startup script will not be executed when starting EXTERMIN8. If a startup script is necessary, specify the name of the script to be executed. It is assumed that the script is a member of the source file defined on the User Choices screen. Program Source Prompt Screen EXTERMIN8 will normally use the source member given in the CRTxxxPGM command, since details of this is held in the object program’s information area. If this source member no longer exists with the same name in the same file and library as used by the compiler, EXTERMIN8 will display a prompt screen. The display shows the source member used to create the program. This display may be changed and EXTERMIN8 will use the given source member. If the PRMTSRC option was entered as *YES on the STRXT8 command, then the program source Prompt Screen will be displayed for each program on the STRXT8 list. Preparing Programs to be Debugged Once the STRXT8 command has been entered, the EXTERMIN8 main screen will be displayed with a message across the bottom stating “Preparing Program xxxxxx” where xxxxxx is the name of each of the programs given on the STRXT8 command. This process may take a few seconds since it is necessary for EXTERMIN8 to scan the source and build certain look up tables before any processing can take place. The length of time this can take depends on the size and complexity of the programs to be debugged. Once the preparation is complete, EXTERMIN8 will display the first 16 lines of source for the first program given on the STRXT8 command. 16 Extermin8 The EXTERMIN8 Screen The EXTERMIN8 screen is divided into three sections as shown below: • The Browse Window (top portion) is used to display program source code. • The Log Window (lower portion) is used to Log the EXTERMIN8 commands entered and display their output. • The Command Line is used to enter debug commands, source manipulation commands and standard OS/400 commands. It is located between the Browse and Log Window. The Browse Window The Browse Window is the top portion of the screen and is used to display and manipulate source code. The status bar at the top of the Browse Window has 3 fields: Col First source column displayed in Window Row First source row displayed in Window Source Name of the current source being displayed Library/File Member name format. If requested, the Browse Window can display the SEU line number of each source line, and/or the nesting level of a statement within the structure of the program. Each user may choose how these are displayed and use F21 to toggle the features on and off. A full description of these options may be found in Chapter 2 on “User Choices”. The default is not to show SEU numbers or nesting levels. By default, source lines that have a breakpoint applied to them are shown underlined, and the line where execution has stopped is shown in high intensity. All other lines are displayed in normal mode. These display attributes and the ‘color’ of the status bar, text, and command line may be changed to suit individual users. SEU Type Browse Commands The following commands may be entered to manipulate the source being displayed. (nn in the following commands means any number may be entered.). F string Find String: Searches for string in the source file. T Top: Display the beginning of the source member. B Bottom: Display the end of the source member. Wnn Window: Show column nn of the source member in column 1 of the screen. nn Display line nn on row 1 of the screen. +n Move display up n lines. -n Move display down n lines. Note: All Entries must be made on the command line. Unlike SEU, EXTERMIN8 does not accept commands on the left hand side of the Browse Window. Chapter 3 Using Extermin8 17 SEU Type Function Keys and Commands The following function keys work the same way as they do when browsing a source module using SEU. Roll Up/Down The amount the Window is rolled up or down can be determined by the user. Refer to Chapter 2, User Choices. F16 Repeat Find: Search for the string given on the command line, or if no string is given, search again for the same string specified on the last F command, or F16 operation. F19 Move the Window one display width to the left. F20 Move the Window one display width to the right. Note: For these keys to be effective, the cursor must be positioned either on the command line, or within the Browse Window. Function Keys that may be used with the Browse Window F2 Moves the split between the Browse and Log Windows to the current cursor position. F14 Expands the Browse Window to use the full screen (two lines at the bottom will be reserved for the command line and the Status Bar). Once the Window has been expanded, F14 will return the Window back to where it was prior to expanding. F18 Shows the bottom of the source member. F21 Toggles SEU line number display on and off, unless programmed differently. Note: For these keys to be effective, the cursor must be positioned either on the command line or within the Browse Window. Commands that may be used with the Browse Window DS library/file name source name Displays the given source member. FT x (RPG) Find Type: where x may be C, F or O - the Browse Window will display the first C, F or O spec of an RPG program. FT x (COBOL) Find Type: where x may be D, E, F, L, P or W - the Browse Window will display the first statement in the Data Division Environment Division, File Section, Linkage Section, Procedure Division or Working Storage Section, respectively. SA Display the User Choices screen. SA SEU Toggles SEU number display on and off. The Log Window The Log Window is used to record the EXTERMIN8 commands entered and display the results of those commands. At the top of the Log Window is the Status Bar, which displays the mode EXTERMIN8 is in, the currently selected program, and when stopped at a breakpoint, where execution will restart. 18 Extermin8 The Command Log File Everything that is shown in the Log Window is recorded in the command log file for the user. This log file is an OS\400 *USRSPC (user space). The EXTERMIN8 default is to allocate a user space in the library EXTERMIN8 with the same name as the User Profile. This allocation is done automatically the first time the user Runs the STRXT8 command. A different Log can be used by changing the options using the SA command. Note: If the requested log file is in use by another EXTERMIN8 session, a new temporary log file will be created in QTEMP. The command Log is cleared at the beginning of a debug session. If required, the Log from the previous session may be carried forward to the next session by entering *NO to the CLRLOG parameter on the STRXT8 command. Function Keys that may be used with the Log Window The following function keys are available when the cursor is positioned in the Log Window. Roll Up/Down Scrolls a given number of lines forward/backward. F2 Moves the split between the Browse and Log Windows to the current cursor position. F9 With the cursor positioned on the command line, each instance of F9 will retrieve the most recently executed command until the beginning of the log file is reached. With the cursor positioned on a line in the Log Window, that line will be copied to the command line. F14 Expands the Log Window to use the full screen (two lines at the top will be reserved for the command line and the Status Bar). Once the Window has been expanded, F14 will return the Window back to where it was prior to expanding. F17 Shows top of log file. F18 Shows bottom of log file. The Status Bar The status bar, located between the Log Window and the command line, has four fields that indicate the current status of EXTERMIN8: Pgm: Displays the name of the currently selected program. Any EXTERMIN8 commands that are program orientated will be applied to this program. Resume: Displays the name of the program in debug mode that has been stopped. at: When a breakpoint has been reached, this is the SEU line number where execution will restart. . MODE Indicates the current mode of the EXTERMIN8 session. BREAK The program has stopped at a breakpoint. MONTR The program has stopped because the condition being monitored has been met. PRESRV The Batch Job being debugged (serviced) is not yet active. SETUP This is the entry mode. When this status is shown no programs are currently running. STEP The program is running in single step mode. RUN The program is currently executing. Chapter 3 Using Extermin8 19 EXTERMIN8 Commands • EXTERMIN8 debug commands must be entered on the command line. Any output from these commands is displayed in the Log Window. All commands are explained in detail in Chapter 5. • Program oriented commands will always refer to the currently selected program, i.e. the one shown in the status bar (PGM). • Any entry on the command line that is not recognized as an EXTERMIN8 command will be passed to the OS/400 command processor. Through this facility any program can be called, menu displayed, or command executed, even if the programs involved are not in debug mode. • All characters are converted to upper case by the EXTERMIN8 command processor, except for strings of literals, so there is no need to worry about case sensitivity. If it is required to enter lower case characters on the command line, use F15 to toggle from the default of upper case characters. • The general syntax of any EXTERMIN8 command is: XY -options (condition) parameters where: XY XY is a mnemonic command where: X is the first letter of an action and Y is the first letter of an object type on which the action will be performed. For example, the command DC represents Display Contents, and AM represents Add Monitor. Options - Any options that follow a command are introduced with a dash and each letter represents one option. For instance, -s may mean to show the source. Not all commands allow options. Condition - The conditional expression, where valid. Parentheses must surround the condition. Parameters - The parameters follow the options and are separated by blanks. Not all commands require parameters. Actions Actions used by EXTERMIN8 are: Action Valid Objects A Add (BDMPX) C Change (BCMOPSX) D Display (@BCDILMPRSX) F Find (T or string) G Go (6PX) L List (BDFMPRSVX) R Remove (BDMPS) S Set (AP) S Start (N) /OS/400 command The letters in parentheses after each action are the valid object types for that action. 20 Extermin8 Object Types Used by EXTERMIN8 are: @ at location - This “object” is used with the Display action to show the name of the currently stopped program and the next line to be executed, and (optionally) the PERFORM calling Stack (COBOL).. A Attribute - Allows the individual user to Set various personal global attributes for debugging sessions that are stored under the user profile name within the EXTERMIN8 library. B Breakpoint - The point at which the program will stop executing, and return control to EXTERMIN8. Program execution stops before the breakpoint statement is executed. The value of selected fields, structures, and indicators can be automatically displayed when breakpoints are reached. A breakpoint can be defined by either the source SEU line number, a TAG name or a Subroutine name. Optionally, a conditional expression can be attached to the breakpoint so that execution will only stop at the breakpoint if the condition is true. breakpoints may also be added or removed from within the Browse Window by placing the cursor on the required source line and pressing F10. C Contents - Displays the Contents of any field, indicator, record or data structure, including multiple occurrence data structures. The user may also Change the Contents of any type of data element or structure. D Display - A list of field names, indicators and/or structures, the contents of which will be displayed whenever the execution of the program is interrupted by either reaching a breakpoint, single stepping or satisfying a monitor condition. The user can Add, Display, List and Remove names from the list to be displayed. F File - Refers to the files being used by the programs being debugged. The user can List the Files used by the programs and optionally show the record format names. I (RPG Only) Indicator - Refers to all indicators used by RPG programs. Display Indicators will show the current status of all indicators referenced by the RPG program. Those currently set on will be displayed in reverse image. To refer to an individual indicator, it must be referenced as a field named *INxx, where xx is the indicator number/name. L (RPG Only) List - Refers to a named Parameter List (PLIST) or key List (KLIST) in the current RPG program. Applicable action: Display the contents of a List. M Monitor - Monitors for a specified condition to be true. The execution of the program will stop immediately after the statement that caused the condition to be satisfied. Applicable actions: Add, Change, Display, List, and Remove the Monitor. N Numbering - Refers to profiling. Applicable actions: Print and Start. O (RPG Only) Occurrence - Refers to the current occurrence of a multiple occurrence data structure, which may be Changed. To display the current occurrence, use the Display Contents command giving the name of the data structure. P Program - Refers to either the current program or a named program depending on the action. Applicable actions: Add, List, and Remove programs from the active debug list, Set a program to be the current program, Display the source of a program, and start or resume (Go) the execution of a program. R subRoutine - Applicable actions: Display or List the subRoutines in all RPG programs or Display or List the paRagraph in all COBOL programs currently in debug mode. Chapter 3 Using Extermin8 21 S Source - Applicable actions: Display any source member in the Browse Window. When a source is displayed, the member is opened for read exclusive, so no updates can be made until the member has been released from the list of open sources. This can be achieved by the Remove Source command. Any source member can be Changed, which invokes the SEU editor. T Type - Applicable action: Find the first source line of the given Type within the displayed source. V Variable - Lists all variable names declared for the currently selected program. X Script - A collection of EXTERMIN8 commands grouped in a source member, which may be executed as a single command. Applicable actions: Add, Change, Display, execute (Go), or List a script. 6 System 36 environment - Executes (Go) a S/36 environment procedure. The output from any command is displayed in the Log Window. If the Window is not large enough to display the complete result, either use the Roll Up key or change the size of the Window to view the complete reply. Also use the Roll keys to view earlier commands and their replies. The command line will also accept all OS/400 and user commands. To use an OS/400 command that has the same name as an EXTERMIN8 one, precede the command with a / (forward slash). Conditional Expressions Monitors and breakpoints may be controlled by conditional expressions, so that the program will stop only when the expression is true. Conditional expressions are made up of variables, literals, constants, relational and logical operators surrounded by parentheses. Literals are defined within apostrophes. The valid logical operators are: Operator Meaning *AND AND & Logical AND *OR Logical OR OR | and the relational operators are: Operator Meaning *EQ EQ = Equal *GT GT > Greater Than *LT LT < Less Than *GE GE >= Greater than or Equal *LE LE <= Less than or Equal *NE NE ¬= Not Equal *NG NG ¬> Not Greater than *NL NL ¬< Not Less than 22 Extermin8 Expression evaluation is dependent on the order and type of operators in the expression. Parentheses may be used to change the order of expression evaluation. The following table shows the priority of all the operators used in expressions, including negative constants. Priority Operator 1 Negative constants 2 *GT, *LT, *EQ, *GE, *LE, *NE, *NG, *NL 3 AND 4 *OR A priority of 1 is the highest priority (negative constants are evaluated first); a priority of 4 is the lowest (OR relationships are evaluated last). When operators with different priority levels appear in an expression, operations are performed according to priorities. When operators of the same priority appear in an expression, operations are performed from left to right within the expression. Parentheses can be used to control the order in which operations are performed. The value of a parenthetical expression is determined from the innermost level to the outermost, following the priorities stated above within matching sets of parentheses. Example of a Conditional Expression >AB 173 ((DUE>0 | BAL>LIMIT) & CR=’B’) The above statement will set a breakpoint on line 173 of the current program with the following conditions: • If the account is overdue (DUE > 0), or • If the balance is greater than the credit limit (BAL > LIMIT), and • A credit extension was asked for (CR = 'B') If this condition becomes true, the execution of the program will stop at statement 173. User Choices EXTERMIN8 can be customized for each individual user. Details of each user’s preferences are stored in the physical file USERCHOICE in the library EXTERMIN8. When a user starts EXTERMIN8 for the first time, a record is created, with the EXTERMIN8 defaults, for that user. At any time, the user may change these options using the SA, Set Attributes command. On entering the SA command the following screen will appear: Chapter 3 Using Extermin8 23 User Choices Parameters Scripts File This option defines the source file where any scripts created by the user will be stored. The default is a file with the same name as the user in the library EXTERMIN8. Refer to Chapter 3 for further details of creating and using scripts. Startup Script Defines the script that will automatically be Run each time the user starts EXTERMIN8 with the STRXT8 command. This script can be overridden for individual sessions by changing the STRXRPT parameter on the STRXT8 command. The default is *NONE, which means that no script will be Run. This option is useful for performing a series of repetitive commands before running the program being debugged. F21 Action Defines the action F21 will perform from the EXTERMIN8 screen. The initial default for this function key is to toggle the display of SEU line numbers. The options are: *NEST Toggle on and off the display of structure nesting of RPG programs. *PROFILE Starts Profiling. *SEU Toggle on and off the display of SEU line numbers in the Browse Window. Name Run the named script. Command Log Name Defines the name and library of the user space (*USRSPC) that will be used to Log all EXTERMIN8 commands and their responses. The default is to set up a space with the same name as the user profile in the library EXTERMIN8. Maintain Subr/Perform stack (COBOL Only) Not applicable in RPG. Defines whether the PERFORM call stack is kept for the programs in debug mode. When this option is changed to Y, the next time a program is added or EXTERMIN8 is started, EXTERMIN8 will maintain the PERFORM call stack of the program. Selecting this option will allow: • The command D@ to display the PERFORM statements executed to get to the current breakpoint. • F23 and F24 to step over and out of PERFORM paragraphs when single stepping. When the option to maintain the perform stack is selected it will cause the initialization and execution of the program to be slower. The default option is not to keep the call stack. If this option is set to N (the default) then: • F23 and F24, stepping over and stepping out of a PERFORM / Subroutine, are not allowed. • D@ will only show the current location of the program. It will not show the perform calling stack. • Program initialization and execution will be faster. 24 Extermin8 RPG code section to display When browsing an RPG program source, EXTERMIN8 will initially position the display depending upon the value of this parameter. T Top of source. (The default) B Bottom of source. F At first F (File Description) specification. C At first C (Calculation) specification. O At first O (Output) specification. COBOL code section to display When browsing a COBOL program source, EXTERMIN8 will initially position the display depending upon the value of this parameter. T Top of source. (The default) B Bottom of source. E At the start of the ENVIRONMENT DIVISION. D At the start of the DATA DIVISION. W At the start of the WORKING STORAGE SECTION. L At the start of the DECLARATIVES SECTION. P At the start of the PROCEDURE DIVISION. Log Breakpoints Defines whether an entry should be made in the Log Window and log file every time EXTERMIN8 stops at a breakpoint. With this option is set to Y, each time a breakpoint is reached a Log entry will be made showing: Stopped at pgm XXXX line NN.NN/nnnn Where XXXX is the program name, NN.NN is the SEU line number, and nnnn is the MI instruction number. The default is no logging. The logging of breakpoints may also be temporarily set on and off using the SA command with the BREAK attribute. See the section on SA in chapter 5 for further details on this option. Character Case at Entry Defines whether the command line will accept lower case characters. The default is U for Upper case characters only. An entry of L will enable lowercase input on a permanent basis. The upper/lower case option can toggled on a temporary basis using F15. Show SEU Numbers at Entry Defines whether the SEU line numbers are displayed on the left hand side of the Browse Window. The default is N, not to show the numbers. Enter Y to display SEU line numbers on a permanent basis. The display of SEU line numbers can be temporarily toggled on and off using either F21, unless this has been re-assigned, or the command SA with an attribute of SEU. Chapter 3 Using Extermin8 25 Nesting Format Display Defines the format that will be used within the Browse Window to highlight the levels of nesting of structures within RPG programs, and is therefore not applicable to COBOL programs. The SA command with an attribute of NEST may be used to toggle on and off the nesting display. The format options are N L R and 1 to 9, and the default is N. Format Examples: If N is entered, the Number on the left side of the screen indicates the level. Blank means the statement is not within any structure: Structure C FIELDA IFEQ FIELDB 1 C FIELDC IFNE FIELDD 2 C . . . . . . . 2 C . . . . . . . 1 C 2 C . . . . . . . 2 C . . . . . . . 1 C END C END ELSE If L is entered, the structure numbering begins in the left column with each level’s number shown next to the previous, giving a visual impression of the depth of the structure. For structures nested to more than 9 levels, the 10th level will show as a ? to the left of the number 9 and all subsequent levels will be shown as an * for each level. Structure C FIELDA IFEQ FIELDB 1 C FIELDC IFNE FIELDD 12 C . . . . . . . 12 C . . . . . . . 1 C 12 C . . . . . . . 12 C . . . . . . . 1 C END C END ELSE If R is entered, the structure numbering is indented towards the right with ‘:’s filling spaces to the right of the number up to the deepest level of nesting within the program. If the depth of nesting is 10 or above the numbering sequence repeats from 0 to 9. Structure :::: C FIELD AIFEQ FIELDB 1::: C FIELD CIFNE FIELDD 2:: C . . . . . . . 2:: C . . . . . . . 1::: C 2:: C . . . . . . . 2:: C . . . . . . . 1::: C ELSE END 26 Extermin8 :::: C END The final option for nesting is to indent the source code by a specified number of spaces for each level of structure. Enter the required number (in range 1 to 9). The example below was created using 2 spaces between each level. C FIELDA C IFEQ FIELDC C FIELDB IFNE FIELDD . . . . . . . C . . . . . . . C ELSE C . . . . . . . C . . . . . . . C END C END Change Screen Attributes Now Entering Y to this option will display the EXTERMIN8 Attribute Selection Screen. This screen allows selection of the display attributes, either color or monochrome, for the background, status bars, command line, breakpoints and current stop statement. To use this screen, press the function key designated to change the required portion of the screen. Next, move the cursor to the required color or display attribute in the 4 x 8 matrix at the top right of the screen, then press enter. The lower portion of the display is an example of how the EXTERMIN8 screen would appear based upon the attribute selections. Function keys available on the Attribute Selection Screen are: F5 STATUS Changes the top line of the Browse Window and the Status Bar. F6 TEXT Changes the text displayed in both the command and Browse Window. F7 INPUT Changes the command line. F8 BREAK Changes how statements that are breakpoints will be highlighted in the Browse Window. F9 STOP Changes how the statement where the program is currently stopped will be displayed in the Browse Window. Press F3 to return to the User Choices screen. Remote Location of Source Specifies were EXTERMIN8 should look for the source of the program being debugged. The options are: *LCL Look for the source on the local machine. (The default) Name Look for the source on the AS/400 with the given system name. This AS/400 must be connected to the AS/400 via an APPN Network. For further information about retrieving the source from another AS/400 please see Chapter 3, Network Debugging. Chapter 3 Using Extermin8 27 Local Copy of Remote Source Only relevant when the source is being accessed from another AS/400. The options are: *YES A temporary copy of the source is created on the local machine. This speeds up processing once the copy has been made. (The default) *NO EXTERMIN8 will access the source member on the remote AS/400. This speeds up program initiation. For further information about this parameter see Network Debugging in Chapter 3. Amount to Roll This defines the amount a Window is to roll up or down when the relevant Roll key is pressed. The options are: F Full Window (The default) H Half Window C Cursor Position - The line the cursor is positioned on will become the top or bottom line. If the cursor is on the command line than the browse Window will roll a full Window. D Data - The screen will page up or down a full window minus 1 line. For example with roll-up the bottom line will become the top line. 1-999 Number of lines to be moved up or down. Using EXTERMIN8 in the System/36 Environment EXTERMIN8 may be used to debug programs written and compiled for the System/36 Environment of the AS/400. The following points should be considered: • System/36 environment should be active before the EXTERMIN8 session is be started. The STRS36 command may be entered from the EXTERMIN8 command line, but this will cause the initial S36 menu to be displayed. Control can be returned to EXTERMIN8 by either pressing the System Request key and selecting option 0, or running a program that already has at least one breakpoint set. • EXTERMIN8 should be started in the normal fashion. The program name(s) given must be the RPG36 program names. It is not possible to debug System/36 OCL procedures. • Because System/36 programs can only Run from System/36 procedures executing OCL statements, neither the GP command nor the F12 function key can be used to start their execution. EXTERMIN8 provides the command G6 that will start the execution of the OCL procedure given as a parameter of the command. G6 is the equivalent of the AS/400 STRS36PRC command and has the same syntax: G6 PRC(proc_name) CURLIB(Current_library) PARM(‘Parm1,Parm2,Parm3...’) • Once the program is executing, all EXTERMIN8 functions are available for RPG36 programs. • It is not possible to debug a multi-requester terminal (MRT) program. The program must be converted to a SRT program to debug. 28 Extermin8 Debugging RPG Programs Containing COPY Statements EXTERMIN8 relates the source code to the object code that is being executed. The /COPY statement within an RPG program includes code from other source members at compile time. The copied code does not remain with the original program source, so there are considerations for debugging programs with /COPY statements. Compiling with the CRTRPGPGM and CRTS36RPG Commands: • The source code is inserted where the /COPY statement is located, and it is not re-sequenced. When debugging a program compiled in this manner, the inserted source lines are not available for EXTERMIN8 to debug. As such, single stepping over these lines will behave as F12 and will stop at the next executable statement after the /COPY. Compiling with the CRTRPTPGM Command: • In this case, the copied statements are not always inserted in the same place as the /COPY statements. CRTRPTPGM creates a temporary expanded source member, with new SEU sequence numbers that are used in the created program. Therefore EXTERMIN8 may be used on these programs only if the expanded source member is available. • This interim source member is captured by creating an empty source member in a physical source file then entering the member and file names in the OUTMBR and OUTFILE parameters of the CRTRPTPGM command. Note: The member specified on the OUTMBR parameter of the command CRTRPTPGM, must exist in order for the expanded source to be captured. Compiling with the CRTS36RPT command: • On the System /36, RPG programs using the Auto Report facility (compiled with the AUTOC procedure) were required to have a U specification statement on the first line of the program. This statement provided the facility to specify where the expanded source member was to be saved. This feature is still available on the AS/400 when using the CRTS36RPT command. • The format of the U specification on the AS/400, beginning in position 7, is: • UClibrary_name,member_name The SEU editor will identify this is as invalid syntax, but ignore the error. The compiler will automatically put the source member in the source file called QS36SRC in the specified library. It will create the source member if it does not already exist. • The U specification overrides any options on the CRTS36RPT command. If the U specification has no C in position 7 or no source member name in positions 8-26, then the expanded source member will not be saved even if entries are made in the OUTMBR and OUTFILE parameters of the command. • If the U specification is not in the program, (unlike the System /36, this is optional on the AS/400), the OUTMBR and OUTFILE parameters on the CRTS36RPT command can be used to specify where the expanded source member is to be saved. In this instance the source member must exist before compiling the program. Chapter 3 Using Extermin8 29 Debugging COBOL Programs Containing COPY Statements Within COBOL programs there are two types of COPY statements: Format 1: Where the source statements are copied directly from the given member into the program as it is being complied. Format 2: Used to direct the compiler to create DATA DIVISION statements to describe a file. As a program is prepared by EXTERMIN8 it must read all lines included by copy statements in the PROCEDURE DIVISION to ensure that it builds a correct table to map the Machine Instructions (MI) in the object with the SEU line numbers in the source. This mapping is required to ensure that breakpoints and single stepping occur correctly. When EXTERMIN8 cannot find a PROCEDURE DIVISION Copybook, a warning message will be issued. The program will still be added to the debug list, but be aware that all statements in the PROCEDURE DIVISION after the missing Copybook may not be correctly mapped to the object code. Unpredictable errors can occur when applying breakpoints or single stepping through the code after the missing Copybook. When the cursor is positioned on a Format 1 copy statement in the source displayed in the Browse window and F9 is pressed, the source of the Copybook will be displayed. All debugging features may be applied to the Copybook member. This option is not available in SETUP mode. F9 cannot be used on Format 2 type Copybooks. Debugging COBOL SQL When embedded SQL statements exist in a COBOL program, EXTERMIN8 must be able to work with the expanded source in order to develop the proper relationship between object and source. When the program is compiled with CRTSQLCBL, the expanded source is created in QTEMP with in the file named QSQLTEMP. EXTERMIN8 automatically attempts to find this expanded source file in QTEMP. If it is unable to do so, the user is prompted to enter the file and library name. NOTE: When debugging programs created by CRTSQLCBL from a different interactive session than where the program was compiled, and the QSQLTEMP member had not been saved to permanent library, then the program must be recompiled before it can be debugged. Executing Programs To Be Debugged Interactive Programs • When using EXTERMIN8 the programs to be debugged are either named on the startup command or added to the debug list using the AP command. At least one breakpoint should be added to each program before the program is executed. • The simplest way of executing a program to be debugged is to press F12. This will execute the OS/400 command CALL for the program named on the status bar, passing any entries on the command line as parameters. (Must be enclosed in parenthesis and in the same format as required for the call command.) • The GP (Go program) command may also be used to start executing the current program, and again parameters can be entered on the command line. • With the development/maintenance of a complex system it is often that the program to be debugged is deep in a calling stack of other CL, COBOL and RPG programs that must be Run first to set up the correct parameters. The other programs in the stack do not have to be in debug mode. The top program can be 'CALL'ed from the EXTERMIN8 command line, execution will continue normally until the first breakpoint is reached when control will then return to EXTERMIN8. • If the top-level program is called from a menu, this menu can be displayed by entering GO MENUNAME from the EXTERMIN8 command line. 30 Extermin8 Batch Programs Chapter 3 describes how to debug programs that must be Run as part of a Batch Job. Other Points to Consider When Using EXTERMIN8 • EXTERMIN8 opens the source members of all programs in DEBUG mode. SEU will open and edit any of these members from another interactive session, but it will not allow the edited member to be replaced in the source file unless either the EXTERMIN8 session has been ended, or the program has been removed from the EXTERMIN8 session (See the command RP). • Always set a breakpoint before starting execution of the program to be debugged. • If this is forgotten, the SysRq key, option 0 may be used to interrupt the program and return control to EXTERMIN8. • Copybooks can be debugged by retrieving the source with either F9 or the DR command. Refer to chapters 4 and 5 for detailed instructions. • System/36 OCL procedures cannot be debugged. • Compressed program objects cannot be debugged by EXTERMIN8. • Objects with observable information removed cannot be debugged by EXTERMIN8. • If for any reason an MCH error occurs while running under EXTERMIN8, respond with the C option to Cancel the program. Then, before restarting EXTERMIN8 or running any other Job, Run the command RCLRSC to reclaim the resources and clean up any files or work areas that may have been left open following the error. • Only 10 programs may be in debug mode at any one time. • EXTERMIN8 requires the user to have at least *USE authority to the debug commands; STRDBG, ENDDBG, STRSRVJOB, and ENDSRVJOB. If the user does not have the correct authority, a message is issued stating "not authorized to debug commands.” 31 C H A P T E R 4 Advanced Debugging Features This chapter describes some of the advanced debugging features of EXTERMIN8, including how to debug Batch Jobs and other users’ interactive Jobs. Throughout this chapter, the term SERVICE will be used to describe debugging a Job running in Batch or at another screen. Contents • Debugging Jobs that are Currently Executing • Debugging a Batch Job that is not yet running • Using Scripts • Profiling • Network Debugging 32 Extermin8 Debugging Jobs that are Currently Executing If the Job that is running the program(s) to be debugged is currently active, simply start EXTERMIN8 with the STRXT8 command giving the specific Job information as the JOB parameter. This Job can either be another interactive session or a Job that is running in one of the Batch Pools. Example: STRXT8 PGM(makemedia/shipdetail) JOB(016789/TA/DSP74) EXTERMIN8 will display the source of the first program given on the command. At this point the command window indicates SETUP mode even if the program is currently running. Only the debugging commands valid in SETUP mode may be used at this time. For example, breakpoints can be added, but a monitor cannot be added, nor can the contents of any field be displayed. At least one breakpoint should be set for EXTERMIN8 to stop the executed program in BREAK mode. GP command or F12, cannot be used to start the program in EXTERMIN8. Once stopped in BREAK mode, all debug commands and function keys can be used, including GP or F12 to resume execution. Note: When requesting F3 to quit EXTERMIN8, the serviced Job will not automatically be ended. If the Job being serviced is another session, then: • The user’s screen will be frozen while EXTERMIN8 has the program stopped. • F13 is not allowed while servicing a Job. A message will be issued starting "user screen not valid with service Job" if F13 is pressed. • The SYSRQ key cannot be used to interrupt the running of the serviced Job in order to return control to EXTERMIN8. Debugging a Batch Job that is Not Yet Running Breakpoints may be set in a Batch program before it starts executing. This is done by the following steps: 1. Hold the Job on the Job queue - use the SBMJOB command with the HOLD(*YES) parameter. Example: SBMJOB CMD(CALL PGM(library/program)) Hold(*YES) 2. Record the Job number, user, and name. This is displayed at the bottom of the screen after submitting the Job, or may be obtained by running the WRKSBMJOB command and using option 5 to work with the Job to be debugged. 3. Start EXTERMIN8 with the STRXT8 command giving details of the program and the Job. Example: STRXT8 PGM(library/program) JOB(nnnn/user/name) 4. This will display the first program’s source. EXTERMIN8 is now in PRSRV (pre-service) mode, and will remain in this mode until the serviced Job becomes active. In this mode, no debug commands or functions may be entered. 5. The message "Job: number/user/Job is being serviced in this session" and "Service Job is not active" will be issued in the Log window if EXTERMIN8 found the Job on hold, as seen on the screen on the next page. If the messages do not appear, check the Job Description entered on the STRXT8 command, and try the command again. 6. From the EXTERMIN8 command line, use the WRKSBMJOB command to release the Job. Do not press any keys until the "start service Job" screen appears. Chapter 4 Advanced Debugging Features 7. The OS/400 ‘Start Serviced Job’ screen will then be displayed. 8. Press F10 to display the OS/400 command screen. 9. On the command line enter EXTERMIN8/XT8SRV. This command will redisplay the EXTERMIN8 screen. 33 10. EXTERMIN8 is in SETUP mode and all commands that are valid for SETUP mode may be used. Note that the Job, and thus the program has not started running yet, so breakpoints can be set to stop execution anywhere in the program. 11. To start the Job, press F12, which will display the OS/400 command screen. 12. Press F12 again and the “Start Serviced Job” screen will be displayed. 13. Press ENTER and the Job will then start executing. The screen prior to releasing the Job will be displayed until the Batch program reaches one of the previously set breakpoints. The EXTERMIN8 screen will then be displayed in BREAK mode. 14. The program may now be debugged using all EXTERMIN8 functions and commands. Note: When F3 is used to quit EXTERMIN8, the Batch Job will continue running. The only way to cancel it is to use WRKACTJOB command. Using Scripts The Script feature of EXTERMIN8 allows the recording of a series of EXTERMIN8 and OS/400 commands and replay them as required. This is very useful when debugging a program that is embedded within a number of call statements and may require many steps to reach the crucial “bug” area. The Scripts are recorded in a source file and are entered using the SEU editor. EXTERMIN8 defaults that all Scripts for a user are held in a source file with the same name as the user profile within the library EXTERMIN8. This default may be changed using the SA command. Refer to Chapter 5. Creating a Script A Script can be created using the Add Script command AX, by passing one parameter - the Script name. AX will call the SEU editor to create a source member with the given Script name. The source member will be created in the Script file defined for the user in the choices screen, see Chapter 2. The default of the Script file is the name of the user’s profile. Once the SEU screen is displayed, the commands must be entered, one per line, exactly as they would have been entered on the EXTERMIN8 command line. RPG Example: For example, the RPG programs SHIPDETAIL and CUALFS in library XT8TEST are to be debugged. To set up a Script to add a few breakpoints and start the program running, the Script may look like this. ADDLIBLE XT8TEST SP CUALFS /* Set current program */ AB 41 /* add breakpoint at Seu# 41 */ SP SHIPDETAIL /* Set current program*/ AB 177 /* add breakpoint at Seu# 177 */ AB 45 /* add breakpoint at Seu# 45 */ AB 99 /* add breakpoint at Seu# 99 */ AD CUST# INV# NAME 34 Extermin8 /* Show contents of fields at every breakpoint */ GP SHIPDETAIL (‘CUSTOMER’ ‘123.5’) /* Start program with parameters */ COBOL Example: For example, the COBOL programs CBMAIN and CBSUB in library XT8TEST are to be debugged. To set up a Script to add a few breakpoints and start the program running, the Script may look like this. ADDLIBLE XT8TEST SP CBSUB /* Set current program */ AB 41 /* add breakpoint at Seu# 41 */ SP CBMAIN /* Set current program*/ AB 177 /* add breakpoint at Seu# 177 */ AB 45 /* add breakpoint at Seu# 45 */ AB 99 /* add breakpoint at Seu# 99 */ AD CUST-NO INV-NO-NAME /* Show contents of fields at every breakpoint */ GP (‘CUSTOMER’ ‘123.5’) /* Start program with parameters */ Comments may be added using the same convention as for CL programs, i.e. /* comment */. Blank lines may be used to improve readability. Any valid EXTERMIN8 or OS/400 commands may be included. The commands will be executed in presentation sequence, so care must be taken to ensure that EXTERMIN8 will be in a mode valid for the command. After entering/editing the Script, use the F3 key to end the SEU session and return control to EXTERMIN8. Running a Script when Starting EXTERMIN8 Scripts may be Run when EXTERMIN8 is started. There are two means of initiating the Script: • Use the User Choices screen (See Chapter 2) to set a Script to always Run when EXTERMIN8 is started. • Specify the Script to be Run in the STRXT8 command. Running a Script From Within EXTERMIN8 At any time the command Go Script, GX, may be used from within EXTERMIN8 to start the execution of a Script. The GX command has one parameter, which is the Script name. Example: GX Script1 All commands executed from a Script will be recorded in the command log in addition to the results of any command. Chapter 4 Advanced Debugging Features 35 Other Script Commands CX Scriptname calls the SEU editor to change the named Script. DX Scriptname calls SEU in Browse mode to display the named Script. RX Scriptname deletes the named Script. LX lists the names of all the Scripts in the default Script file. All these commands assume that the Script named is in the default source file. To select Scripts from a different file, change the file name on the User Choices screen, using the SA command, before executing the Script command. Profiling Extermin8’s profiling counts the number of times a line in a program is executed, or if a line is executed at all. The counting will continue until the Profiling is cleared, using CLRXT8PRF. You can then print the current program, which will also contain a Number column indicating the number of times the lines was executed. You can also specify multiple programs for profiling, and can be started from within an Extermin8 session using SN or from the command line using STRXT8PRF, as described below. Starting Profiling from the Command Line Extermin8 profiling can be started from the command line without starting Extermin8 by following the steps below. 1. From the command line, enter: STRXT8PRF 2. The following screen will display. 3. Enter the desired program or programs and their libraries requested for profiling. 4. Call the desired program(s) to begin profiling. Debug has been enabled at that point and the trace data is captured by an Extermin8 program and logged to the user space profilings. 5. Add desired breakpoints. 6. Run the program by pressing F12. The number of times a line has been executed will display in the left column, as shown below. 36 Extermin8 Starting Profiling from within Extermin8 To start Profiling from within Extermin8, follow the steps below. 1. With Extermin8 already running, enter SN (Start Numbering). Debug has been enabled at that point and the trace data is captured by an Extermin8 program and logged to the user space profilings. 2. Add desired breakpoints. 3. Run the program by pressing F12. The number of times a line has been executed will display in the left column, as shown below. The attributes are automatically set to *PROFILE like SA PROFILE would do. If you add an additional program, that program will not automatically start profiling, you will have to explicitly do a SN on that program to enable profiling. But, until you do, that program, when it is the active program, will not have its non-existent profiling counts (numbers) displayed regardless of the user attribute screen settings. Profiling is enabled on a per program basis by using the SN start profiling command. Profiling statement counts are kept in user spaces in the EXTERMIN8 library with weird mangled names. The name of the program, however, is in the text field. There could potentially be more than one profile (user space) kept for the same program name because it may be in multiple libraries. This will work fine with Extermin8's profiling. If a program gets recompiled after Profiling was started, the next Extermin8 SN or STRXT8PRF over that program will simply generate a new user space (the pointer to the program name is checked.) End Profiling Once you have completed profiling, end profiling within Extermin8 with the following command: ENDXT8PRF Profiling will stop for the current program. This command executes the ENDDBG command and reclaims the Extermin8 Activation group. Chapter 4 Advanced Debugging Features 37 Clear Up Profiling You must clean up profiling after you are done, since profiles take up a lot of space. To clear up profiling, enter the following command within Extermin8. CLRXT8PRF The program name and library take generic names. The library name is not the location of the user space that is always Extermin8, the library name is for the program object's library name. This name is stored in the user space itself. To delete all the ones with the attribute XT8CODECOV, enter: WRKOBJPDM EXTERMIN8 *ALL *USRSPC Review Profiling Counts Profiling counts can be reviewed at any time by setting the F21 action within User Choices to *PROFILE. To review profiling counts, follow the steps below. 1. To review profiling counts, enter SA, Set Attributes: The following screen will display. 2. Enter *PROFILE for the F21 action. 3. Press F3 to return to the Extermin8 source screen. 4. Press F21. 38 Extermin8 Note: You must use SN, Start Profiling, every time you add a program to enable profiling or the counts will not show. Printing Profiling To print profiling for the current program, enter PN from within Extermin8. If you starting profiling from the command line outside of Extermin8, you must still print from within Extermin8. Note: You may want to print profiling before modifying a program, since the print option won't show all the profilings before the program changed. However, it will not be necessary if you are going to do a full profiling again after the program changes. Network Debugging EXTERMIN8 cannot function unless the current source of the program being debugged is available. Many companies keep the source on one machine and transmit just the object to other machines in the network. Provided the source machine is linked to the object machine via an APPN network, EXTERMIN8 can be instructed to access the source on the other machine. EXTERMIN8 must be installed on the object machine, but does not have to be on the machine where the source resides. The following scenarios describe how EXTERMIN8's networking debugging may be used. 1. Programmer is at headquarters where the source code exist on the local AS/400. A second AS/400 is located at a remote site and is running a program that needs to be debugged. The remote site is accessed via pass-through. EXTERMIN8 is initiated on the remote system and is instructed to find the source code on the local system. EXTERMIN8 does not have to exist on the local system. 2. Programmer is at client's office on a local AS/400 where the program to be debugged is running. The remote site is at headquarters where the source code resides. EXTERMIN8 is initiated on the client's AS/400 and instructed to find the source on the headquarters system. EXTERMIN8 does not have to exist on the headquarters system. 3. Programmer is at headquarters on a local AS/400, while the program to debug is running on a remote system. However, the source code resides on another remote AS/400. EXTERMIN8 is initiated on the remote system where the program is running and is instructed to access the source from the third system in the network. EXTERMIN8 does not have to exist on either the headquarters system or the third system. To initiate network debugging in EXTERMIN8, it is necessary to set up the users EXTERMIN8 profile to look for all source on the remote machine. 1. From within an EXTERMIN8 session enter SA to display the User Choices screen. 2. Change the option "Remote location of source" to the APPN network name of the source machine. For example, if the source resides on the machine with the system name of S1012345, this name should be entered on this option. The default for this option, *LCL, instructs EXTERMIN8 that the source is local and resides on the machine were the program is running. 3. The second option for network debugging is "Local copy of remote source". This gives the user a choice of copying the source to the machine where EXTERMIN8 is running. The default is Y, and will cause a copy of the source to the created in the user's QTEMP library, during the initialization of the program. This option will slow down initialization by creating a local copy of the source but will considerably speed up the execution of many EXTERMIN8 commands. If this value is changed to N then EXTERMIN8 will be working with the source on the remote machine, this option will speed up initialization, but will cause some EXTERMIN8 commands to be much slower. It is recommended that the latter option (N) only be used when doing a small amount of debugging on very large programs. Chapter 4 Advanced Debugging Features 39 By default, this option will create a temporary copy of the source code onto the object machine. If a local copy of the source code is not desired, then change this option to N. The temporary copy of the source code is deleted when exiting EXTERMIN8. 4. Once the options have been keyed, press ENTER to exit the Users Choices screen and update the user's profile. These options are set up for each individual using EXTERMIN8 and will have no affect on other users. 5. EXTERMIN8 is now set up to look for all sources on the given machine, either when a new program is added (AP command) or when EXTERMIN8 is started. To access a remote source during the current session use the AP command to add the program. Future sessions of EXTERMIN8 started by the same user will always look for the source on the remote machine. The SA command must be used to change the "Remote location of source" option back to *LCL, to resume debugging programs where the source is on the same machine as the object. If an EXTERMIN8 session is started while the remote machine is not available the error message "DDM file is not opened" will be issued, to return to local debugging from this screen: 1. Press ENTER to accept the error message, the prompt screen for the location of the source will be displayed. 2. Press F12 to cancel the prompt screen, EXTERMIN8 will now be in set up mode. 3. Enter SA to change the User Choices options. 4. Enter *LCL on the option "Remote location of source" and press ENTER. If there is any other problem starting a remote debugging session because of communication failure, etc., start EXTERMIN8 on a non-existent program name, this will return to EXTERMIN8's command line without any communications being attempted. From this command line use the SA command to go back to local debugging until the communication problem gets sorted out. 40 Extermin8 This Page Intentionally Left Blank 41 C H A P T E R 5 Debugging Function Keys Most EXTERMIN8 actions can be initiated with function keys. All function keys are documented in this chapter in the following structure: Description: Narrative description of the function(s) the key performs. If the function key behaves differently in the EXTERMIN8 Browse and Log windows, a description of the function key for each window is given. Modes: The EXTERMIN8 modes in which the key is valid, i.e. SETUP, BREAK, MONTR, STEP, RUN, PRESRV or All. Restrictions: Restrictions in using the function key. See Also: Quick cross-reference to similar or related EXTERMIN8 function keys and commands. Example: Sample displays to demonstrate the action of the key. Where two screens are shown, the first represents the state of the display before the function key is used, and the second reflect the results from the function key. Contents • Keyword Keys • Function Keys • Command Keys 42 Extermin8 ATTN - Attention Key Description: The ATTN key is no longer used by EXTERMIN8. If the ATTN key has been programmed to perform a Set Program or command, this will occur whenever the ATTN key is pressed no matter what mode EXTERMIN8 is in. Modes: All Restrictions: None HELP - Help Key Description: HELP displays the EXTERMIN8 help documentation in the Browse window. Comments: The first screen displayed is a quick cross reference of available commands and an index for the main Help topics. To view a specific topic, simply enter the required line number. The Help text is either in the source member RPG_HELP or COBOL_HELP, in the source file HELP in the library EXTERMIN8. This member may be edited to add text relevant to the user’s own installation. Please be aware that new releases of EXTERMIN8 will replace the HELP text, so if any changes are made it is advisable to keep a back up, either off line or in another library. Since this is the same as displaying any other source member, all browse functions and commands are available, as are all debugging commands. Use the F12 key to exit from the HELP screen. Modes: All Restrictions: None RolUp/RolDn - Roll Keys Description: RolUp/RolDn rolls the text up or down that is displayed in the window in which the cursor is positioned. Comments: The amount the screen will roll depends on the setting chosen by the SA command. The options are: F= Full window H= Half window C= Cursor Position becomes top or bottom D= Data, Bottom line becomes top or top line becomes bottom. 1-999 = Number of lines Modes: All Restrictions: None Chapter 5 Debugging Function Keys 43 PRINT - Print Key Description: PRINT prints the screen displayed on the workstation where the function was selected. Modes: All Restrictions: None F1 - Break and Go Description: F1 will set a temporary breakpoint on the line where the cursor has been positioned in the Browse window, then start or continue the execution of the program. To set a temporary breakpoint, position the cursor on the line of source where the execution of the program is to stop, and press F1. The default is to distinguish breakpoints by underlining the statement in the Browse window. This default may be changed using the EXTERMIN8 Attributes Screen. Once the breakpoint has been reached, it will be removed, therefore, execution of the program will no longer stop at the statement. If you place the cursor on a non-executable statement (e.g. TAG or BEGSR) and press F1, then the temporary breakpoint will be allocated to the next executable statement in the source code. F1 cannot be used to set a Conditional breakpoint. The Add breakpoint command AB must be used to do this. See Chapter 5. If F1 is pressed in SETUP mode, the program will start executing. If parameters are required, enter them on the command line enclosed within parenthesis, then press F1. While running the program, whenever a breakpoint is reached the execution of the program is stopped after the preceding statement. With the EXTERMIN8 default options, the current breakpoint, (i.e. the next statement to be executed) is shown in high intensity, and the status bar shows the program name and the SEU line number of the breakpoint. The execution of the program must be restarted at a breakpoint by either another F1, F11, F12 or the GP command. Mode: All Restrictions: None See Also: F10 F22 AB AD DB LB RB F2 - Adjust Split of Windows Description: F2 moves the position of the command line, altering the size of the Browse and Log Screens. Position the cursor on the line where the command line is to be moved to and press F2. The command line will appear in its new position. Mode: All Restrictions: None See Also: F14 44 Extermin8 F3 - Quit Session Description: F3 will end the EXTERMIN8 session. Before quitting, a window will prompt for confirmation. Press F3 again to confirm. F3 also exits any programs that may have been executed from within the debugger that are still running. Control is returned to the screen from where the STRXT8 command was entered. To exit a program that has been called from within EXTERMIN8 without canceling EXTERMIN8, use the OS/400 System Request option 2. Mode: SETUP BREAK STEP MONTR PRESRV Restrictions: None See Also: F14 F4 - Prompt/Change Variable Description: F4 displays the current contents of a variable and prompt for a new value. Position the cursor to a variable name in the Browse window and press F4. A pop up window displays the current contents of the variable and allows the contents to be modified. The complete contents of a data structure, list, table, etc., will be displayed formatted by the field name. Use the Roll keys to move the display up or down. To change the variable, key the new value over the existing display, then press ENTER to accept the change. Press ENTER again to confirm the change and return to the Browse window. Mode: BREAK STEP MONTR Restrictions: None See Also: CC F4 - Prompt a Command Description: With an EXTERMIN8 or OS/400 command keyed on the command line and F4 pressed, the syntax of the EXTERMIN8 command or OS/400 command prompt is displayed, respectively. With the two-character EXTERMIN8 command keyed on the command line and the cursor on the command line press F4, the syntax of the command will be displayed in the Log window. The EXTERMIN8 command remains on the command line to allow completion of the command parameter entry. With the OS/400 command keyed and the cursor on the command line press F4, the OS/400 prompt screen for the command will be displayed. Mode: All Restrictions: None. However, if the OS/400 command word is the same as an EXTERMIN8 command, precede the command with a forward slash (/). Chapter 5 Debugging Function Keys 45 F5 - Display Current Location Description: F5 displays the source of the interrupted program with the current breakpoint instruction at the top of the Browse window, regardless of what was previously displayed. Mode: BREAK STEP Restrictions: Not available in SETUP, PRSRV, RUN modes. See Also: D@ F6 - Go to TAG, ENDSR or Paragraph Name Description: F6 moves the point where the currently stopped program will resume execution. This function effectively inserts a GOTO instruction in the program. (RPG Only: The same rules apply as within an RPG program, where a GOTO is allowed to a TAG or ENDSR statement within the current specification level only. A GOTO is not permitted between detail, total and Subroutine specifications). Position the cursor to the line containing the TAG, ENDSR or Paragraph statement and press F6. The next executable statement following the TAG EXSR or Paragraph statement becomes the resume execution point. F1, F11, F12 or GP must be issued to continue execution of the program. Mode: BREAK STEP Restrictions: The cursor must be positioned only at a TAG, EXSR or Paragraph Name statement. This function key does not affect the contents of any program variables or indicators, so be aware of the consequences of any change of restart point. Care must be taken not to move the restart point into a Subroutine or Section that is not currently being executed, as unexpected results may occur. See Also: AB GP F10 F12 F7 - Find Top of Structure (RPG Only) Description: F7 finds the top of an RPG structure (IF, ELSE, DO, etc.) from the position of the cursor in the Browse window. Position the cursor on a line within a structure and press F7. The cursor and display then moves to the first statement of the current structure. For nested structures, repetitive use of the F7 key will walk back through the levels. Mode: ALL Restrictions: Only valid with RPG programs See Also: F8 F8 - Find End of Structure (RPG Only) Description: F8 finds the end of the RPG structure (IF, ELSE, DO, etc.) from the position of the cursor. Position the cursor on a line within a structure and press F8. The display and cursor then moves to the END statement of the current structure. For nested structures, repetitive use of the F8 key will walk forward through the levels. Mode: ALL 46 Extermin8 Restrictions: Only valid with RPG programs See Also: F7 F9 - Retrieve Variable Description: With the cursor positioned on a variable name in the Browse window, F9 retrieves and displays the contents of the variable. A pop up window displays the current contents of the variable. The complete contents of a data structure, list, array, etc., will be displayed formatted by the field name. Use the Roll keys to move the display up or down. The contents of the variable may not be changed. Press ENTER to return to the Browse window. Mode: BREAK STEP Restrictions: None See Also: DC F9-Retrieve Program Source (RPG and CL) Description: With the cursor positioned on EXSR, CAS or CALL statements in the Browse window, F9 retrieves and displays the source code of the Subroutine or called program. F9 retrieves the source for the Subroutine or the called program in the Browse window. Only source members of programs that are in debug mode may be displayed. To retrieve the source of a Subroutine, position the cursor on the CAS, EXSR statement and press F9. EXTERMIN8 will display the source of the Subroutine in the Browse window. To retrieve the source of a called program, position the cursor in the name of the member on the CALL statement line and press F9. The called program must be in debug mode. Mode: All Restrictions: The source being displayed must be of a program in debug mode. See Also: DP (called program) F9-Retrieve Program Source (COBOL) Description: With the cursor positioned on PERFORM, COPY or CALL statements in the Browse window, F9 retrieves and displays the source code of the paragraph or called program. Only source members of programs that are in debug mode may be displayed. To retrieve the source of a Paragraph, position the cursor on the paragraph name in the PERFORM statement and press F9. EXTERMIN8 will display the source of the paragraph in the Browse window. To retrieve the source of a COPYbook statement, position the cursor in the name of the member on the COPY statement line and press F9. All EXTERMIN8 debugging commands and function keys are valid for the displayed Copybook under the same rules as apply to the main program. F9 may be used on any COPY statement except the type Format 2 used in the Data Division to copy external file definitions. Chapter 5 Debugging Function Keys 47 To retrieve the source of a called program, place the cursor on the program name in the CALL statement. The called program must be in debug mode. To re-display the source containing the COPY or CALL statement, use the Display program command (DP), or if stopped at a breakpoint, use F5 to return to the current breakpoint. Mode: All Restrictions: The source being displayed must be of a program in debug mode. See Also: DP (called program) F9 - Retrieve a Command Description: F9 retrieves previously entered commands from either the command line or Log window. • With the cursor positioned on the command line, F9 retrieves the last command entered and copies it to the command line. Each successive time F9 is pressed, the next previously entered command is retrieved to the command line. The command may now be edited and executed. • With the cursor positioned on a previously entered command displayed in the Log window, F9 retrieves that command and copies it to the command line. The command may now be edited and executed. Mode: All Restrictions: None See Also: DP (called program) F10 - Add/Remove Breakpoint Description: F10 sets a breakpoint or removes an existing breakpoint on the line where the cursor has been positioned in the Browse window. Positioning the cursor on a non-executable statement (e.g. TAG, BEGSR or comment line) before pressing F10 will affect the next executable statement in the source code. • To set a breakpoint, position the cursor on the line of source where execution of the program is to stop, and press F10. The default is to distinguish breakpoints by underlining the statement in the Browse window. This default may be changed using the EXTERMIN8 Attributes Screen. If the contents of one or more variables are to be displayed when the breakpoint is reached, key the field name(s) on the command line before pressing F10. Up to five variable names may be given, each separated by a blank. If the same variable(s) are to be displayed on all breakpoints, use the Add Display command, AD, to define them. F10 cannot be used to set a Conditional breakpoint. The Add breakpoint command, AB must be used to do this. See Chapter 5. 48 Extermin8 Whenever a breakpoint is reached in a program, execution is stopped prior to executing the statement. With the EXTERMIN8 default options, the current breakpoint is shown in high intensity, and the status bar displays the program name and the SEU line number of the breakpoint. The execution of the program must be restarted at a breakpoint by either F1, F11, F12, F23 or GP command. • • To remove an existing breakpoint, position the cursor on the breakpoint to be removed and press F10. To remove all breakpoints use the Remove breakpoint command, RB, with the *ALL parameter. To add or remove a range of breakpoints, use F10 at the beginning of the range and F22 at the end. The Add breakpoint command, AB, may also be used to set ranges. The Remove breakpoint command, RB, may also be used to remove ranges. Mode: All Restrictions: A temporary breakpoint, which is automatically removed after the program has stopped at the statement, cannot be created with the F10 option. The AB command or F1 function must be used. See Also: F1 F22 AB AD LB RB F11 - Single Step Execution Description: F11 executes only the single statement where the program is currently stopped. Optionally, each statement executed via Single Stepping may be logged, as well as automatically Single Step through a program without user intervention. The next statement to be executed is shown in high intensity, and the status bar displays the program name and the next SEU line number to be executed. The execution of the program must be restarted by F1, F11, F12, F23, F24 or the GP command. When the next statement to be executed is a CALL and F11 is pressed, the called program will execute without stopping, except for breakpoints already defined within the program. Control is returned to EXTERMIN8 before the execution of the next statement following the CALL. RPG Only When the next RPG statement to be executed is an EXSR operation, F11 will Single Step into the Subroutine. This may be avoided by pressing F23 to step over the Subroutine; i.e., the Subroutine will be executed and the program stopped at the statement immediately following the EXSR statement. When stepping through a Subroutine, F24 will step out of the Subroutine; i.e., complete the execution of the Subroutine without stopping. Execution stops at the statement immediately following the EXSR statement. If F11 was not used to step into a Subroutine, then F11 will behave as F12 on the ENDSR statement, as EXTERMIN8 will be unable to determine from where the Subroutine was executed. If F11 was used to step into the Subroutine and F12 was used to reach a breakpoint defined in the Subroutine, then F11 on the ENDSR will also behave as F12. By pressing F12 to reach the breakpoint, EXTERMIN8 loses the information from where the Subroutine was called. COBOL Only When the next statement to be executed is a PERFORM operation, F11 will Single Step into the PERFORM paragraph. This may be avoided by pressing F23 to step over the PERFORM paragraph; i.e., the PERFORM paragraph will be executed and the program stopped at the statement immediately following the PERFORM statement. Chapter 5 Debugging Function Keys 49 When stepping through a PERFORM, F24 will step out of the PERFORM; i.e., complete the execution of the PERFORM without stopping. Execution stops at the statement immediately following the PERFORM statement. Note: F23 and F24 are only available if the option to maintain the PERFORM call stack was set to Y when the program was put in debug mode. See Chapter 2 for further information. Single step execution performs faster when the number of statements to be viewed through Single Stepping is given to EXTERMIN8 when executing the F11 function key. When at a breakpoint, key the number of statements to Single Step onto the command line and press the F11 key. Note: Be aware that when using this statement count feature, it does not follow logic of the program. If a GO TO or PERFORM statement directs the program to a statement outside the selected group, then Single Step will behave as F12, continue execution of program. Since a number of statements can exist in a single COBOL statement line, Single Stepping may not appear to advance to the next “line” of code. Automated Single Stepping “Automated” Single Stepping executes one statement at a time without halting for user intervention. As each statement is executed, the source is displayed in the Browse window, highlighting the next statement to be executed. This is the equivalent to repeatedly pressing the F11 key approximately once each second. It is recommended this option be used in conjunction with the logging feature of the Set Attributes command, SA STEP LOG, so that a record is maintained of the statements executed. • Optionally set the range for automated Single Stepping by positioning the cursor to the first statement in the range. Using the Add Breakpoint command, AB, set a breakpoint to the last statement in the range. If no range is desired, automatic Single Stepping will continue until a previously set breakpoint is reached, the program terminates, or the program is interrupted. • Use the Set Attributes command to initiate automatic stepping as shown here: SA STEP GO • Start automated stepping by pressing F11. If a previously set breakpoint is reached, automated stepping will stop. To resume automated stepping, press F11 again. If stepping to observe the progress of the program being executed, the GO option on the SA BREAK command may prove useful. If this attribute is set and F11 is pressed, execution will continue when a breakpoint is reached. Mode: SETUP BREAK STEP Restrictions: None See Also: F12 F23 F24 50 Extermin8 F12 - Start/Resume Execution Description: F12 will start the execution of the currently selected program or resume execution of the currently stopped program. When in SETUP mode, F12 will start the program named in the Status Bar. If no program is indicated, the first program named on the STRXT8 command will be executed. If the program to be started requires parameters, the parameters should be keyed on the command line enclosed within parenthesis. When in BREAK or STEP mode, F12 will resume the execution of the stopped program at the SEU line number shown in the Status Bar. The program will continue until it reaches the next breakpoint of the program. Additional Functions of F12 • When the HELP source is displayed, F12 will cancel the help display and return to the previous source displayed. Mode: All Restrictions: None See Also: GP F13 - Display User Screen Description: For reference purposes, F13 redisplays the last interactive user screen before control was returned to EXTERMIN8. This display may not be modified in any way. Pressing ENTER or any function key when viewing the redisplayed screen will return to the current EXTERMIN8 display. If a user screen has not been displayed during the execution of the programs within EXTERMIN8, the EXTERMIN8 SETUP screen will be re-displayed. Press ENTER to return to the current EXTERMIN8 display. Mode: BREAK STEP Restrictions: Cannot be used when debugging a service or batch Job. F14 - Expand/Contract Browse Window Description F14 expands the Browse window from where the cursor is positioned to the full screen size, or returns the window sizes back to their original size before the previous F14 was pressed. • To expand the Browse window, place the cursor either on the command line or anywhere in the Browse window, then press F14. The Status Bar will move to the bottom line of the screen with the command line on the line above. The remainder of the display will be the Browse window. • To return the Browse and Log windows to their original size, press F14 again. Mode: All Restrictions: None See Also: F2 Chapter 5 Debugging Function Keys 51 F14 - Expand/Contract Log Window Description: F14 expands the Log window from where the cursor is positioned to the full screen size, or returns the window sizes back to where they were before the previous F14 was pressed. • To expand the Log window, position the cursor in the Log window and press F14. The Browse Status Bar remains positioned at the top line of the screen, and below it is the command line with the main Status Bar on the next line. The remainder of the display is the Log window. • To return the Browse and Log windows to their original size, press F14 again. Mode: All Restrictions: None See Also: F2 F15-Toggle Upper/Lower Case Input on the Command Line Description: F15 toggles the case of the command line input characters between upper and lower case. • The EXTERMIN8 entry default is to allow uppercase input only on the command line. Pressing F15 will change this to allow lower case characters. Subsequent uses of the F15 key will toggle between lower and upper case input options. The position of the cursor will not change when F15 is pressed, so it may be used many times while keying just one command. • User Choices provides the option to change the entry default to lower case characters. See Chapter 2. Mode: All Restrictions: None See Also: SA F16 - Find a String Description: F16 searches the currently displayed source member for the character string keyed on the command line, or repeats the prior search if the command line is blank. To find a character string within the source that is currently displayed, key the required string on the command line and press F16. The search begins with the first line displayed in the Browse window. Note: The search is case sensitive so it must be keyed exactly how you expect to find it in the source. Embedded blanks are acceptable, so there is no need to surround the string with apostrophes. When the string has been found, the cursor is positioned at the beginning of the string in the Browse window. If the string is not originally displayed in the current window, the source line containing the string will be on the second line of the window. 52 Extermin8 Press F16 again to find the next occurrence of the string. If no string is given on the command line, the last entered string is searched for again, even if that string was entered using the F command. If the cursor is moved after the string was found, the next F16 will begin searching for the string on the first line of code displayed in the Browse window. Once the search has reached the end of the source, a pop up window showing the search string and the message ”not found before end of source” is displayed. Press ENTER to acknowledge the message. To resume the search at the beginning of the source, press F16 again. Mode: All Restrictions: None See Also: F F17 - Top of Source Description: Depending upon the cursor position, F17 displays the first entries of either the current source member or the command Log. Cursor in the Browse window or command line: F17 displays the beginning lines of the source member that is currently displayed in the Browse window. Cursor in the Log window: F17 displays the beginning of the command log file in the Log window. Mode: All Restrictions: None See Also: T F18 F18 - Bottom of Source Description: Depending upon cursor position, F18 displays the last entries of either the currently displayed source code or the Log window. Cursor in the Browse window or command line: F18 displays the end of the source member that is currently displayed in the Browse window. Cursor in the Log window: F18 displays the end of the command log file in the Log window. Mode: All Restrictions: None See Also: B F17 F19 - Show Left of Source Description: F19 displays the left side of the source member in the Browse window. Mode: All Restrictions: Only allowed when the cursor is positioned in the Browse window or command line. See Also: F20 Chapter 5 Debugging Function Keys 53 F20 - Show Right of Source Description: F20 displays the right side of the source member in the Browse window. If F20 is pressed while the SEU line numbers are displayed, the numbers will remain on the left side of the screen. Mode: All Restrictions: Only allowed when the cursor is positioned in the Browse window or command line. See Also: F19 F21 - Toggle SEU Numbers or Nesting, or Execute Script Description: F21 is a programmable function key that provides one of the features below. The EXTERMIN8 default for this function key is to toggle SEU line numbers display. This key can be re-programmed from the User Choices screen, see Chapter 2. • Toggle on and off the Browse window display of SEU numbers. See example, or • Toggle on and off RPG structure nesting levels. See example, or • Execute a predefined Script. Each time F21 is pressed, the Script named in the User Choices Screen is executed. Mode: All Restrictions: None See Also: SA F22 - Add/Remove Breakpoints up to Cursor Position Description: F22 adds or removes breakpoints on ALL executable statements between the statement where F10 was last used to add or remove a breakpoint and the current cursor position. • If the last use of F10 set a breakpoint, F22 will set breakpoints on ALL executable statements between the current cursor position and the statement were that breakpoint was set. • If the last use of F10 removed a breakpoint, F22 will remove ALL breakpoints between the current cursor position and the statement where that breakpoint was removed. Mode: All Restrictions: The last breakpoint set by F10 must be in the same source member as is currently being displayed. See Also: F10 54 Extermin8 F23 - Step Over (RPG) Description: When Single Stepping through an RPG program and stopped at an EXSR or CAS operation, F23 “steps over” the Subroutine. The Subroutine will execute without stopping. EXTERMIN8 will stop the program again at the statement following the EXSR or CAS statement. If a defined breakpoint exists in the Subroutine, execution will stop at that breakpoint. If F23 is pressed on any statement other than EXSR or CAS, it is treated as F11 to Single Step. Mode: BREAK STEP Restrictions: None See Also: F11 F12 F24 F23 - Step Over (COBOL) Description: When Single Stepping through a COBOL program and stopped at an PERFORM operation, F23 “steps over” the paragraph. The paragraph will execute without stopping. EXTERMIN8 will stop the program again at the statement following the PERFORM statement. If a defined breakpoint exists in the paragraph, execution will stop at that breakpoint. If F23 is pressed on any statement other than a PERFORM, it is treated as F11 to Single Step. Mode: BREAK STEP Restrictions: This function key is available only when the program has been added with the "Maintain subr/perform stack" option set to Y in User Choices. See Chapter 2 or the SA command for further details. See Also: F11 F12 F24 F24-Step Out (RPG) Description: When Single Stepping in a Subroutine, F24 will “step out” of the Subroutine. The Subroutine will complete executing without stopping. Execution of the program stops at the statement immediately following the EXSR or CAS statement that called the Subroutine. Program execution will stop at any breakpoints in the Subroutine beyond where F24 was pressed. Mode: STEP Restrictions: None See Also: F11 F12 F23 Chapter 5 Debugging Function Keys 55 F24-Step Out (COBOL) Description: When Single Stepping in a Subroutine, F24 will “step out” of the paragraph. The paragraph will complete executing without stopping. Execution of the program stops at the statement immediately following the PERFORM statement that called the paragraph. Program execution will stop at any breakpoints in the paragraph beyond where F24 was pressed. Mode: STEP Restrictions: This function key is available only when the program has been added with the "Maintain subr/perform stack" option set to Y in User Choices. See Chapter 2 or SA command for further details. See Also: F11 F12 F23 56 C H A P T E R 6 Debugging Commands This chapter provides a detailed explanation of all EXTERMIN8 commands. All commands are in alphabetic order and have the following structure: Syntax: The syntax of the command shows all of the required and non-required options and parameters, where { a } means a is optional [a | b] means select a or b, but an entry must be made ...N means can be repeated up to N times Brackets and braces ([], {}) are NOT entered for the options and parameters. However, parentheses ( ) are required for conditions. Description: Narrative description of the command. Restrictions: Restrictions of the command. See Also: Quick cross-reference to similar or related EXTERMIN8 commands. Example: An example of how to use the command. Contents • General Syntax of Most commands • Examples of Conditional Expressions • User Choices Chapter6 Debugging Commands 57 Command Syntax The general syntax of most commands is: XY -options (condition) parameters where XY is the name of the command, X is the first letter of an action and Y is the first letter of an object on which the action will be performed. • -option only applies to certain commands to qualify the action and may be omitted if not required. All options are preceded with a dash and each letter represents one option. For instance, -s may mean to show the source. • conditional expressions require parentheses to surround the condition. The following operators are valid: Operator Meaning *AND AND & Logical AND *OR OR | Logical OR *EQ EQ = Equal *GT GT > Greater Than *LT LT < Less Than *GE GE >= Greater than or Equal *LE LE <= Less than or Equal *NE NE ¬= Not Equal *NG NG ¬> Not Greater than *NL NL ¬< Not Less than Priority of Operators The priority of the operators follow, where 1 is the highest and 4 is the lowest priority. If more than one operator of the same level exist in the condition, the expression is performed from left to right. Parenthesis can be used to override the evaluation sequence. Priority Operator 1 Negative constants 2 *GT, *LT, *EQ, *GE, *LE, *NE, *NG, *NL 3 *AND 4 *OR Field names, numeric constants and alphanumeric strings can be used within expressions, alphanumeric strings must be enclosed within apostrophes. 58 Extermin8 Examples of conditional expressions: (CUST# < 3 | CUST# > 10) (CUST# NE *LSTVAL) ((CUST# = 12345 & STATUS = ‘B’) OR (CUST# > 80000 & STATUS =‘A’)) *LSTVAL is a special value used in the condition statement to allow the comparison of the current value of a variable with the value of that variable when the condition was entered. Parameters are entered as specified for the individual command where required. The following is a list of actions and objects that are allowed, and their possible combinations. ACTION X Used with objects Add A B, D, M, P, X Bottom B Change C B, C, M, O, P, S, X Display D @, B, C, D, I, L, M, P, S, X Find F T Go G P, X List L B, D, F, M, P, R, S, V, X Remove R B, D, M, P, S Set S A, P Top T OS/400 command / Y OBJECT Used by action @ at location D A Attribute S B Breakpoint A, C, D, L, R C Content C, D D Display A, D, L, R F File L I Indicator D L List D M Monitor A, C, D, L, R O Occurrence C P Program A, D, G, L, R, S R subRoutine L S Source D, L, R T spec Type F V Variable L X Script A, C, D, G, L Chapter6 Debugging Commands 59 AB - Add Breakpoint Syntax: AB -tl [location | range] {(Condition)} {field1 ... Restrictions: When setting conditional breakpoints, the selected program must have had its execution stopped and be in BREAK or STEP mode. field5} The special condition *INMATCH may only be used with RPG programs. See Also: AD CB LB RB F10 F22 Example: > AB 123.5 Stop program at SEU line number 123.50. >AB 191 EMPNO DEPT *IN35 Stop program at SEU line number 191 and display the contents of the fields EMPNO and DEPT, and indicator 35. >AB 47 (CUST# < 3 | CUST# >10) CUST# CUNAME Stop program at SEU line number 47 if CUST# is less than 3 or greater than 10 and then display the variables CUST# and CUNAME. >AB LOOP3 Stop at the next executable statement after the TAG “LOOP3”. >AB 35 (*INMATCH) Stop program at SEU line number 35 only if the indicator conditions in the statement are true, that is, if the line will be executed. >AB -t 35 Stop at SEU line number 35, then remove the breakpoint. >AB 35>45 Set breakpoints at all executable statements between lines 35 and 40. AD - Add Display Syntax: AD Name {Name2 ... NameN} Description: AD adds the given variable name or names to a list of fields the contents of which will be displayed in the Log window whenever a breakpoint is reached in the selected program. If the variable name given is a structure then the contents of the individual fields within the structure will be displayed. Restrictions: Valid only in BREAK or STEP modes. See Also: DD LD RD Example: >AD EMPNO >AD EMPNO EMPNAM EMPADD EMPFON 60 Extermin8 AM - Add Monitor Syntax: AM (Condition) Description: AM adds a Monitor that stops program execution when the condition is true. Control is returned to EXTERMIN8, in MONTR mode, at the statement immediately following the statement where the condition becomes true. The AM command will override any existing Monitor for the selected program. The Monitor is not cleared when the program terminates. If the program is started again from within the same EXTERMIN8 session, the Monitor is still active, unless the remove Monitor RM command has been used. Note: Restrictions: Debugging a program with an active Monitor is slow in execution since it is equivalent to setting a conditional breakpoint on every statement. Only one Monitor is allowed for each program being debugged. Not valid in SETUP mode. See Also: CM DM LM RM Chapter 2 Example: >AM (EMPNO <= 17) Stop the selected program when EMPNO is less than or equal to 17. >AM (*IN35 NE 1’) Stop the selected program whenever *IN35 is not equal to 1 (Indicator 35 is off). >AM ((BAL >=5000 | AMTLAT >=10000) & STATUS = ‘A’) Stop the selected program whenever BAL is greater than or equal to 5000 and STATUS is equal to ‘A’, or when AMTLAT is greater than or equal to 10000 and STATUS is equal to ‘A’. >AM (GRSPAY *NE *LSTVAL) Stop the selected program whenever GRSPAY changes from its current value. AP - Add Program Syntax: AP -NP {LibrName/}ProgName Description: AP adds the given program to the list of programs in debug mode. The library list is used to search for the program, if the library name is not specified. If EXTERMIN8 cannot find the source for the given program, the program source prompt screen will be displayed. If EXTERMIN8 is started with the Prompt for Source Names parameter (PRMTSRC) as *YES, the program Source Prompt screen is automatically displayed. The program Source Prompt screen indicates the name and library of the program being added, in addition to the name of the library, file and source member it was compiled from. The source member information may be changed which will then be used by EXTERMIN8. Options: Chapter6 Debugging Commands 61 Not Prompt for Source - the program Source Prompt screen will not be displayed, if the source location is known. If the source location is not known then the prompt screen will still be displayed. Use this if EXTERMIN8 was started with PRMTSRC (*YES) but there is no need to prompt for the source for the program being added. Prompt for Source - the program Source Prompt screen will be displayed. Restrictions: A maximum of 10 programs may be in the debugging session at one time. See Also: LP CP RP Example: >AP xt8demo/cbmain >AP CBSUB AX - Add Script Syntax: AX ScriptName Description: Scripts are source members that contain a series of EXTERMIN8 and/or OS/400 commands that can be executed as a string. The AX command will call the SEU Editor to enter/edit a source member with the given Script name in the user’s current script file. The user’s current script file defaults to the source file in the library EXTERMIN8 with the same name as the user profile. This can be changed using the Set Attributes command (SA). Since AX calls the SEU editor, a new source member is created if one does not exist. All normal SEU editing commands are available and the editor should be exited in the normal fashion (F3 and ENTER) to return control to EXTERMIN8. Enter OS/400 and EXTERMIN8 commands into the Script just as they would be typed on the EXTERMIN8 command line. For command strings exceeding 80 characters, the + (plus) character is the continuation mark allowing strings of indefinite length. Restrictions: None See Also: CX DX GX LX Chapter 3 Example >AX Script1 Syntax: B Description: B displays the end of the source member currently in the Browse window. B - Bottom B positions the last line of source member at the bottom of the window, with the message, “**** End of Member ****”. Restrictions: None See Also: T F18 Example: >B 62 Extermin8 CB - Change Breakpoint RPG Syntax: CB {SeuNum|TagLabel|SubrName} COBOL Syntax: CB {SeuNum|ParagraphName} Description: CB provides a prompt screen, which allows the attributes, condition, and display fields of a breakpoint to be changed. Enter CB and the SEU line number or TAG name, Subroutine name or Procedure name where the breakpoint is set. A prompt screen is displayed identifying the current condition and variables to be displayed. Key the new conditions and/or field names and press ENTER to effect the change. The entries are in the same format as the Add Breakpoint command. The current breakpoint is prompted for change if the SEU line number, TAG name, Subroutine name, or Paragraph name are omitted. Restrictions: Only breakpoints in the currently selected program may be changed. To change breakpoints in another program use the Set Program (SP) or Display Program (DP) command first. See Also: AB DB LB RB F10 Chapter 2 Example >CB 191 CC - Change Contents Syntax: CC -x Field1 NewValue Description: CC changes the contents of the named field or indicator in the current program to the new value entered. The option -x indicates the new value is in hexadecimal format. When an alphanumeric literal is entered that is shorter than the field length, the field is padded with blanks to the right. Apostrophes (‘) must surround the literal if it contains imbedded blanks. If an apostrophe is contained in the new value, surround the literal with quotation marks (“). If the new value is numeric and requires a decimal point or a leading minus, these must be entered as part of the value. Otherwise all positions following the decimal point are set to zero and all numbers assumed to be positive. The syntax of the new value is edited to ensure alpha characters are not entered in numeric fields. CC may be used on structure or Record names. The string entered fills the structure or Record from left to right and is padded with blanks, without regard to the fields being numeric, so care must be taken to avoid decimal data errors. It is normally better to use F4 in this circumstance since EXTERMIN8 prompts for each field within the structure or Record. If the new value is longer than the command line, use the F4 key on the field name. The pop-up window will be large enough to accept the complete field. Restrictions: Not available in SETUP Mode. See Also: DC F4 Chapter6 Example: Debugging Commands 63 >CC EMPNO 12345 >CC *IN35 1 >CC EMPNAM ‘JOHN DOE’ >CC DATA "John’s Number" (note the imbedded apostrophe) >CC CITY AUSTIN >CC ARBAL -14.33 >CC -x CUST# 00001F CM - Change Monitor Syntax: CM Description: CM produces a prompt screen allowing the conditional attributes of the current program’s Monitor to be modified. The EXTERMIN8 Change Monitor prompt indicates the current conditions for the Monitor. Key in the changes to the Monitor and press ENTER. Restrictions: Program must be running. See Also: AM DM LM RM Chapter 2 Example: >CM CO - Change Occurrence (RPG Only) Syntax: CO MdsName NewOccur Description: CO changes the current occurrence of the named multiple occurrence data structure. Once the occurrence has changed, individual fields may be changed using the CC command. Restrictions: Program must be running. Only valid with RPG programs. See Also: CC Example: >CO LINDS 3 64 Extermin8 CP - Change and Compile Program Syntax: CP {ProgName} Description: CP calls the SEU editor for the source of the named program. If a name is not given, the source of the current program will be edited. Once editing has been completed, a prompt is presented to compile the program online. Press ENTER to compile the new source or F3 to return to EXTERMIN8 without recompiling the program. Note: When compilation is completed, a message is displayed indicating the success of the compilation. Press ENTER to continue. The new source will be displayed in the Browse window without regard to the success of compilation. • If the compilation is successful, the new object is loaded and all breakpoints, Monitors and displays are lost. • If the compilation is unsuccessful, the old object is still in place with the existing breakpoints, displays, etc. However, continuing to debug this module may prove difficult as the source does not match the object. • If the program was executing at the time of compilation, the old version of the object is renamed to Qnnnnn and moved to QRPLOBJ library. This version must be closed and the program re-executed before any further debugging can take place using the new source member. Restrictions: The program must be in debug mode. See Also: CS Example: >CP Go into SEU edit mode for the current program. >CP SHIPDETAIL Go into SEU edit mode for the program SHIPDETAIL provided it is in debug mode. CS - Change Source Syntax: CS {{{libr/}file} member} Description: CS calls the SEU editor to edit the given source member. If a source member is not specified then the source for the current program will be displayed. If the library is not specified, then the library list will be searched to find the member. If the file is not specified then the default file QRPGSRC will be searched for the member. If the member does not exist, it is created in the specified file or by default, in QRPGSRC. Once editing has been completed, control is returned to EXTERMIN8, with no compilation taking place. Note: Any source may be edited. However, if the source of a program currently in debug mode is changed, be aware that continued debugging may result in unpredictable results where the source no longer matches the object. Chapter6 Restrictions: None See Also: CP Example: >CS xt8demo/xt8demo cualfs Debugging Commands 65 Calls SEU edit for the source member CUALFS in file XT8DEMO in library XT8DEMO. >CS Calls SEU edit for the source of the current program. >CS RC001 Calls SEU for the source member RC001 in the first QRPGSRC found in the library list. CX - Change Script Syntax: CX ScriptName Description: CX calls the SEU editor to change the specified Script. When a Script name is not specified in the command, the first member in the user’s script file is displayed. The default for the user’s script file is a physical source file with the same name as the user profile in the library EXTERMIN8. The default is changed by using the Set Attributes command (SA). When the named Script does not exist as a member in the Scripts file, the SEU editor automatically creates it. Restrictions: None See Also: AX DX GX LX Chapter 3 Example: >CX SCRIPT1 D@ - Display @Location Syntax: D@ Description: D@ displays in the Log window the name of the current program and the next statement to be executed. Both the SEU line number and the MI Instruction Number are displayed. This is the same information that exists in the EXTERMIN8 status bar and is most often used to put a marker in the EXTERMIN8 command log. See Chapter 2 or SA command for further details. Restrictions: None Example: >D@ At pgm SHIPDETAIL line 35.00/006A (log entry) 66 Extermin8 D@ - Display Calling Stack Syntax: D@ -n N Description: If the option "maintain subr / perform stack" was set to Y when the program was added to debug mode, D@ displays the “calling stack” of the PERFORM statements executed before reaching the current breakpoint. See Chapter 2 or SA command for further details about setting the "maintain subr/perform stack" option. For each PERFORM statement executed from the initial statement on the PROCEDURE DIVISION the following information will be displayed. Caller: The SEU line number of the PERFORM statement. From Paragraph: The name of the paragraph to be executed in the PERFORM statement, and the SEU line number of the first executable statement. To Paragraph: The name and SEU line number of the last paragraph to be executed in the PERFORM statement. If there is only one paragraph to be performed then the details of this will be repeated. The screen will also display the name of the current program and the next SEU line number and MI instruction number to be executed. Options: -n displays the calling stack of PERFORMs without the associated SEU line numbers. EXTERMIN8 displays a maximum of 30 characters for each FROM and THRU Paragraph Names. Omitting this option includes the SEU line numbers, but shortens the Paragraph Names to 23 characters each. N indicates how deep to display the calling stack of PERFORMs. When a value for N is given, only the last N entries in the stack are displayed. Otherwise, the entire stack is displayed. Restrictions: Not valid in SETUP mode DB - Display Breakpoint Syntax: DB {SeuNum | TagLabel | SubrName} Description: DB displays in the Log window the breakpoint’s attributes, conditions and fields to display. The display includes the SEU number, Machine Instruction (MI) number, conditional expression if it exists, and variable names, the contents of which will be displayed when the breakpoint is reached. If a breakpoint is not specified, the current breakpoint is displayed. Restrictions: None See Also: AB AD CB RB F10 Example: >DB 35 3500/006A EMPNO (log entry) >DB 43.00/0076 (CUST# GT100) CUST# (log entry) Chapter6 Debugging Commands 67 DC - Display Contents Syntax: DC -x Name1 {Name2 ... NameN} Description: DC displays the current program’s contents of the named fields, data structures, Records, or indicators in the Log window. Position the cursor in the Log window and Use the Roll keys to move the display up or down. Data structures and Records are displayed by the field name in the data format of the field. Only the contents of the current occurrence of a multiple occurrence data structure is displayed. The name, length, current number and total number of occurrences is also be displayed prior to the current occurrence. To display a particular occurrence of a structure, enter the structure name followed by a comma and the occurrence number. To display all occurrences of a multiple structure follow the name with a period and the letter O. In this case, each occurrence will be displayed unformatted. The option -x displays the contents of the field in hexadecimal format. When displaying an array, the number of elements and the name of the array is given prior to the list of elements. To display a particular element of an array, follow the array name with a comma and the element number or field name containing the element number. Restrictions: Program must be running See Also: AD DI DL F9 Example: >DC CUST# Displays the contents of CUST# >DC -X CUST# Displays the contents of CUST# in hexadecimal format >DC SCRNLN.O Displays all occurrences of the multiple occurrence data structure SCRNLN >DC SEL,1 Displays the contents of array SEL element 1 >DC SEL,X Displays the contents of array SEL element X, provided X is a valid field name and contains a value within the array size DD - Display Display Syntax: DD Description: DD displays the contents of the variables in the display list for the current program that were added to the list using the command Add Display (AD). These are the variables that will be displayed each time a breakpoint is reached. Only the contents of the variables on the current program’s list will be 68 Extermin8 displayed. Restrictions: Program must be running. See Also: AD LD RD SP Example: >DD DI - Display Indicators (RPG Only) Syntax: DI {-a} Description: DI displays in the Log window the status of all indicators referenced by the current program. Indicators set on are shown in reverse image. The option -a may be used to display all numeric indicators, even if they are not reference by the current program. The status of individual indicators may be displayed using the DC *INxx command. Restrictions: Valid only with RPG programs. See Also: DC DD Example: >DI -A DL - Display List (RPG Only) Syntax: DL ListName Description: DL displays in the Log window the contents of the fields in the specified KLIST or PLIST. Each element of the LIST is formatted by its field name. Restrictions: Valid only with RPG programs. Program must be running. See Also: F9 Example: >DL CPKEY DM - Display Monitors Syntax: DM {ProgName} Description: DM displays in the Log window the conditional expression for the Monitor in the given program. If a program name is not specified, the Monitor for the current program is displayed. The command List Monitor (LM) may be used to display the Monitors for all programs currently in debug mode. Restrictions: None See Also: AM CM LM RM Example: >DM Displays conditions for Monitor in current program. >DM shipdetail Displays condition for Monitor in program named SHIPDETAIL. Chapter6 Debugging Commands 69 DP - Display Program Syntax: DP {ProgName} Description: DP displays in the Browse window the source code of the given program. The selected program is set to the status of current program in debug mode. Any command entered that requires the current program will now use the displayed program. If the program name is not specified, the source of the currently selected program using the command Set Program (SP), is displayed. Only the source of the programs in debug mode may be displayed. To display other sources, use the Display Source (DS) command. Restrictions: Program must be in debug mode. See Also: AP LP RP Example: >DP shipdetail DR - Display SubRoutine (RPG) Syntax: DR SubrName Description: DR displays the source for the given subRoutine in the current program in the Browse window. This performs the same function as positioning the cursor on the EXSR or CAS statement and pressing F9. DR is useful as a script file command. Restrictions: None See Also: F9 Example: >DR ROLLUP >DR getnam DR - Display PaRagraph or Copybook (COBOL) Syntax: DR Name Description: DR moves the display in the Browse window to the named Paragraph Name or Copybook in the current program. This performs the same function as positioning the cursor on the PERFORM or COPY statement name and pressing F9. DR is useful as a script file command where function key definitions are not allowed. To retrieve the source of a Copybook source, specify the name of the copybook. All EXTERMIN8 debugging commands and function keys are valid for the displayed Copybook under the same rules as apply to the main program. DR may be used for any copybook except the type Format 2 used in the Data Division to copy external file definitions. To re-display the source containing the COPY, use the Display Program command (DP). Restrictions: Program must be in debug mode See Also: F9 Example: >DR ROLLUP >DR getnam 70 Extermin8 DS - Display Source Syntax: DS {{Library}/File} MemberName Description: DS displays the contents of the given source member in the Browse window. None of the debugging commands are valid for this source unless it is the source of a program currently in debug mode. All Browse window commands and function keys may be used. The default for the Library is *LIBL and the default for the file is QRPGSRC. Note: When the source is displayed, it is opened for exclusive read. Therefore it may not be updated until the EXTERMIN8 session has ended or the source is released using the Remove Source command (RS). Restrictions: None See Also: DP LS RS Example: >DS ddslibr/qsrc empmast >DS CUALFS DX - Display Script Syntax: DX {ScriptName} Description: DX calls SEU in browse mode to display the given Script. If a Script name is not specified, the first member in the script file is displayed. The default for the script file is the name of the user’s profile in the library EXTERMIN8. To change this default use the command Set Attributes (SA). Restrictions: None See Also: AX CX GX LX Example: >DX SCRIPT1 Syntax: F string Description: F searches the currently displayed program in the Browse window for the string value entered on the command line. The argument string is case sensitive (use F15 to swap between lower and upper case entry). EXTERMIN8 searches for the complete string entered, including any embedded blanks. F - Find If the argument string is currently displayed in the Browse window, the cursor will be positioned at the beginning of the argument string without changing the display. Otherwise, the source line that contains the argument will appear at the top of the Browse window with the cursor positioned on the string. If the argument is not found before the end of source the message, “string not found before end of src”, is displayed, press ENTER to acknowledge the message. This command does not automatically wrap around to the beginning of the source to search for the argument. Either press F16 or enter F to restart the search at the beginning of the source. If the cursor is moved from the location of the found argument the next F16 or F will start the search from the top of the source being displayed. To Chapter6 Debugging Commands 71 continue searching for the same argument string, either press F16 or enter F with no search argument. Restrictions: The Find operation is case sensitive. See Also: F16 Example: >F CUALFS Searches for string ‘CUALFS’ >F Hello World Searches for string ‘Hello World’ FT - Find Type (RPG) Syntax: FT { F | C | O } Description: FT finds the first line of the given RPG specification type of the source member displayed in the Browse window. FT will find the first file, Calculations, or Output specification with the parameters F, C, or O respectively, and position that line at the top of the Browse window. If the specification type is omitted, the first C specification is displayed. If the given specification type does not exist within the member, the last line of the previous specification type will be displayed at the top of the Browse window. When a source is first displayed, the default is to show the beginning of the source. The EXTERMIN8 User Choices Screen EXTERMIN8 can be modified to always show the beginning of the selected specification type. See SA in Chapter 2. Restrictions: Program must be in debug mode. The command is valid in COBOL, but has different parameters. See Also: SA Example: >FT C or >FT Finds the first Calc spec >FT O Finds the first Output spec 72 Extermin8 FT - Find Type (COBOL) Syntax: FT { D | E | F | L | P | W } Description: FT finds the first line of the given COBOL specification type of the source member displayed in the Browse window. FT will find the first DATA DIVISION, ENVIRONMENT DIVISION, FILE CONTROL SECTION, LINKAGE SECTION, PROCEDURE DIVISION, or WORKING STORAGE SECTION specification with the parameters D, E, F, L, P or W, respectively, and position that line at the top of the Browse window. If the specification type is omitted, the first PROCEDURE DIVISION specification is displayed. If the given specification type does not exist within the member, the last line of the previous specification type will be displayed at the top of the Browse window. When a source is first displayed the default is to show the beginning of the source. The User Choices Screen EXTERMIN8 can be modified to always show the beginning of the selected division or Section. See SA or Chapter 2. Restrictions: Program must be in debug mode. See Also: SA Example: >FT C or >FT Finds the first PROCEDURE DIVISION statement >FT L Finds the first LINKAGE SECTION statement GP - Go Program Syntax: GP (Parm1 Parm2 ... ParmN) Description: GP starts execution of the current program, which is equivalent to issuing a call to the program. Any parameters the program requires for initiation must be entered on the command line, enclosed within parenthesis, each separated by a space. GP may also be used to resume the execution of the currently stopped program. If no current program is set, GP will execute the first program given on the STRXT8 command. Programs may also be initiated by entering the appropriate OS/400 command. To start the program from a menu, simply enter the OS/400 command Go Menuname. Once at this menu, take the option to execute the program. Restrictions: Parameter value may only be given if starting the execution of a program. See Also: F1 Example: >GP (12345 OLSON 541503626) (only if initiating) >GP Chapter6 Debugging Commands 73 GX - Go Script Syntax: GX {ScriptName } Description: GX executes the given Script containing EXTERMIN8 and OS/400 commands. If no Script name is given, the first Script in the script file defined in User Choices is executed. Restrictions: None See Also: AX CX DX LX Chapter 3 Example: >GX SCRIPT1 G6 - Go S/36 Procedure Syntax: G6 PrcName {Lib {PARM(‘Parm1,Parm2,..,ParmN’)}} Description: G6 starts the named S/36 procedure. The AS/400 command STRS36PRC is called by EXTERMIN8. G6 uses the same parameter format as STRS36PRC. It will assume that the procedure is within the source file QS36PRC in the given library. If a library name is not given, the library list is searched. Restrictions: The S/36 environment must already be started before executing the program. It is best if this is done before starting EXTERMIN8. Example: >G6 PAY01 USER1 PARM(‘ALL,VERIFY’) Starts S/36 procedure PAY01 in library USER1 and passes the parameters ALL and VERIFY. LB - List Breakpoints Syntax: LB Description: LB lists all breakpoints and their attributes for all programs in debug mode. The information displayed in the Log window consists of the program name, if it is a conditional breakpoint, the SEU line number, the Machine Instruction (MI) number, and the names of any variables that will be displayed upon reaching the breakpoint. A breakpoint having a ‘?’ under the condition column is a conditional breakpoint. A ‘*’ indicates the breakpoint has a *INMATCH condition. To view specifics of the condition, use the Display Breakpoint command (DB). Restrictions: Does not display the names of the fields in the general display list (see LD). See Also: AB CB DB LD RB Example: >LB displays: Program SHIPDETAIL SHIPDETAIL CUALFS Cond * ? Line/MI 34.00/0045 45.00/0059 112.00/01AE Variable CUST# CUST# ALPHAl 74 Extermin8 LD - List Displays Syntax: LD Description: LD lists the names of the fields whose contents will be displayed when the current program reaches a breakpoint. Restrictions: None See Also: AD DD RD Example: >LD displays: Displays for Program SHIPDETAIL CUST# SEL CXMDL LF - List Files Syntax: LF {-r} Description: LF lists the names of the files used by all the programs in debug mode. The file names shown are as they are found in the F specifications. EXTERMIN8 does not regard any AS/400 OVRDBF commands that may be current. • Displayed after each file name is the type of access is being made to the file; i.e., I for Input, U for Update, O for Output, or C for Combined. • The option -r includes the Record format names for each file shown. • If the complete list is not displayed, move the cursor to the Log window and use the Roll keys, or increase the size of the Log window (F2 or F14). Restrictions: Only valid with RPG programs. RPG Example: >LF >LF -r displays: Files for program: SHIPDETAIL F: SHIPDTFM C R: SHIPDT01 R: SHIPDT02 F: ESCUSP U R: ESCUSF COBOL Example: >LF >LF -r displays: Files for program: CBMAIN F: SHIPDTFM R: SHIPDT01 R: SHIPDT02 F: ESCUSP R: ESCUSF Chapter6 Debugging Commands 75 LM - List Monitor Syntax: LM Description: LM lists the Monitor conditions for each program in debug mode that has a Monitor. The program name(s) are displayed followed by the Monitored expression. Restrictions: None See Also: AM CM DM RM RPG Example: >LM displays: COBOL Example: Program SHIPDETAIL Monitor expression (CXMDL = ‘B20 ‘ & CXMDL = ‘B25 ‘) CUALFS (CUCUS ¬= 1) >LM displays: Monitor expression Program CBMAIN ((BAL >=5000 | AMT-LATE >=10000) & STATUS = ‘A’) CUALFS (GROSS-PAY *NE *LSTVAL) LP - List Programs Syntax: LP {-s} Description: LP lists in the Log window the names of all programs currently in debug mode. The list displays the program name, library and type (i.e., RPG, CLP, etc.). • The program name is preceded by the EXTERMIN8 Display Program command (DP) allowing F9 to be positioned at the display in the Log window to bring the command to the command line. • The option -s requests the additional display of the associated source member in the format: library name, file name, and member name. Restrictions: None See Also: AP DP GP RP SP F9-Log window RPG Example: >LP displays: Program dp SHIPDETAIL Library XT8DEMO Attribute RPG >LP -s displays: COBOL Example: Program Library Attribute Library File dp SHIPDETAIL XT8DEMO RPG XT8DEMO SHIPDETAIL >LP displays: Program dp CBMAIN >LP -s displays: Program dp CBMAIN XT8DEMO Member Library Attribute XT8DEMO CBL Library XT8DEMO Attribute Library File Member CBL XT8DEMO XT8DEMO CBMAIN 76 Extermin8 LR - List SubRoutines Syntax: LR Description: LR lists the names of all subRoutines within each program in debug mode. The list contains the program name, subRoutine name, and beginning and end SEU line numbers for the subRoutine. Restrictions: Only valid with RPG programs. Example: >LR displays: Program Subr SHIPDETAIL VALID1 VALID2 From 021300 025400 To 025200 028700 LS - List Source Syntax: LS Description: LS lists all source members that are currently open within the EXTERMIN8 session. This includes sources that have been opened with the Display Source command (DS) as well as those opened in debug mode. Listed for each member is the Library/Source file name and member name. • The program name is preceded by the EXTERMIN8 Display Source command (DS) allowing F9 to be positioned at the display in the Log window to bring the command to the command line. Restrictions: None See Also: DS RS RPG Example: >LS displays: ds XT8DEMO/XT8DEMO CUALFS ds XT8STEVE/XT8DEMO CUALFS ds XT8DEMO/XT8DEMO SHIPDETAIL LV - List Variable Syntax: LV {Prog_name | *ALL} Description: LV displays in the Log window all of the variable names used within the current or specified program. If a program name is not given, the variable names in the current program are listed. When *ALL is specified, the variable names used by each program in debug mode are listed. Restrictions: None Example: >LV displays: variables for program SHIPDETAIL var1 var2 var3 ..varN >LV *ALL displays: variables for program SHIPDETAIL var1 var2 var3 ...varN variables for program CUALFS var1 var2 var3 ...varN Chapter6 Debugging Commands LX - List Script Syntax: LX Description: LX lists in the Log window the names and descriptions of each Script in the user’s default scripts file. The description given is the text for the source member, which may be changed when ending the SEU editor. Only the Scripts in the current script file, as defined in the User Choices screen, are listed. Use the Set Attributes (SA) screen to change the default script file Restrictions: None See Also: AX CX DX GX Example: >LX displays: Description Script GX SCRIPT1 Sample Script GX STRUP Start up Script PN - Print Profiling Syntax: PN Description: PN prints the current program, including any profiling that was enabled for that program. Profiling is the number of times a particular line was executed. Profiling will continue until it is cleared with the CLRXT8PRF command. Restrictions: None See Also: SN SA RB - Remove Breakpoint Syntax: RB {*ALL|SeuNum|SeuRange|TagLabel|SubrName} {PgmName|*ALL} Description: RB removes one or more breakpoints from the named program. When all parameters are omitted, the current breakpoint is removed. If a program name is not given, all actions of this command are applied to the current program. *ALL First Parameter - All breakpoints are removed from the program named in the second parameter. If the program name is not given, all breakpoints are removed from the current program. SeuNum The breakpoint at the given SEU number is removed from the current or named program. SeuRange All breakpoints between a range of statement numbers are removed inclusively from the current or named program. The two SEU line numbers must be separated by a single greater-than sign (>). TagLabel (RPG) The breakpoint at the given TAG label is removed from the current or named program. Paragraph Name (COBOL) The breakpoint at the given TAG label is removed from the current or named program. 77 78 Extermin8 SubrName The breakpoint at the beginning of the given subRoutine removed from the current or named program. *ALL Second Parameter - When the first parameter is *ALL, all breakpoints in all programs are removed. Restrictions: Program must be running. See Also: AB F10 F22 Example: >RB 234 Removes the breakpoint at line 234 >RB 234>280 Removes all breakpoints between the lines 234 & 280, inclusively >RB 5.50 Removes the breakpoint at line 5.50 >RB *ALL Removes all breakpoints in all programs open for debug >RB GETTEM Removes the breakpoint at the beginning of subRoutine GETTEM RD - Remove Display Syntax: RD Description: RD removes the variable name from the display list that was added to the list using the command Add Display (AD). This variable will no longer be displayed when a breakpoint is reached. Restrictions: Program must be running See Also: AD DD LD Example: >RD EMP-NO RM - Remove Monitor Syntax: RM Description: RM removes the Monitor of the current program. Once the Monitor is removed, the execution time of the program will improve, since there is no longer the equivalent of a conditional breakpoint at every instruction. Restrictions: None See Also: AM CM DM LM Example: >RM Chapter6 Debugging Commands 79 RP - Remove Program Syntax: RP ProgName Description: RP removes the named program from the EXTERMIN8 session and from debug mode. Quitting the EXTERMIN8 session also removes all programs from debug mode. RP also releases the source member, so that it is available to be edited from another session. Restrictions: None See Also: AP CP LP Example: >RP shipdetail >RP CUALFS RS - Remove Source Syntax: RS Library/File Member Description: RS removes the named source member from the list of open sources. The released source becomes available for update so other users may edit the source member. Quitting the EXTERMIN8 session will also remove all source members. RS can only be used for the same members that we displayed using the DS or CS commands. Note: RS does not delete the source member from the file. Restrictions: Cannot be used for the source of programs in debug mode. See Also: CS DS Example: >RS xt8demo/xt8demo shipdetail RX - Remove Script Syntax: RX ScriptName Description: RX deletes the source member containing the Script from the current default script file as defined on the User Choices screen. Restrictions: None See Also: AX CX GX LX Example: >RX USER1 SA - Set Attributes Syntax: SA {Attribute} {option} Description: SA sets the attributes for the debug session. When the parameters are omitted, the User Choices Screen is displayed. See the next Section for details about using this screen. • The BREAK and STEP attributes provide tracing capabilities that are discussed within the narratives for each attribute. The following attributes and their options are available: 80 Extermin8 BREAK [go | nogo | log | nolog] This attribute controls the actions taken by EXTERMIN8 when a breakpoint is reached. To change both the STET and go|nogo options, enter the SA command twice, once for each option. go Automatically continue execution when a breakpoint has been reached. When combined with the log option, information regarding each breakpoint is posted to the log file. This provides the ability to trace the program execution and review only breakpoints. nogo (default) Stop execution at each breakpoint encountered. log Log information in the log file on each breakpoint encountered. nolog (default) Do not log information on each breakpoint encountered. NEST {on | off} (RPG Only) Turns on and off the display of nesting of structures within the Browse window. If the option is omitted, the current option will be toggled; i.e., off switches to on and on switches to off. How the nesting is displayed must be chosen from the User Choices Screen. (F21 may also be used to toggle this option, if it was set as such on the User Choices Screen). SEU {on | off} Turns on and off the display of SEU numbers for the source displayed in the Browse window. If the option is omitted, the current option will be toggled. F21 defaults to toggling SEU number display, but it may be programmed for other functions as defined in the Users Choices Screen. STEP [go | nogo | log | nolog] This attribute controls how EXTERMIN8 performs single stepping. It provides the “automated” single stepping feature. To change both the log|nolog and go|nogo options, enter the SA command twice, once for each option. Restrictions: go Automatically continue execution when F11 (start singlestepping) is used. When combined with the log option, information regarding each breakpoint is posted to the log file. This provides the ability to trace the program execution and review each instruction executed. nogo (default) Stop execution at each step when F11 is used. log Log information in the log file on each instruction executed during single-stepping, whether manual or automated. nolog (default) Do not log information on each single-step instruction executed. None Chapter6 Debugging Commands 81 SA - User Choices Syntax: SA Description: Entering SA on the command line, with no parameters, presents the User Choices Screen. User Choices Parameters Scripts File This option defines the source file where any Scripts created by the user will be stored. The default is a file with the same name as the user in the library EXTERMIN8. Refer to Chapter 3 for further details of creating and using Scripts. Startup Script Defines the Script that will automatically be Run each time the user starts EXTERMIN8 with the STRXT8 command. This Script can be overridden for individual sessions by changing the STRXRPT parameter on the STRXT8 command. The default is *NONE, which means that no Script will be run. This option is useful for performing a series of repetitive commands before running the program being debugged. F21 Action Defines the action F21 will perform from the EXTERMIN8 screen. The initial default for this function key is to toggle the display of SEU line numbers. The options are: *SEU Toggle on and off the display of SEU line numbers in the Browse window. *NEST Toggle on and off the display of structure nesting of RPG programs. *PROFILE Start profiling. Name Run the named script. Command Log Name Defines the name and library of the user space (*USRSPC) that will be used to log all EXTERMIN8 commands and their responses. The default is the user’s I.D. in library EXTERMIN8. Maintain Subr/Perform stack Not applicable in RPG. RPG code section to display When browsing an RPG program source, EXTERMIN8 will initially position the display depending upon the value of this parameter. T Top of source. B Bottom of source. F At first F (File DeScription) specification. C At first C (Calculation) specification. O At first O (Output) specification. 82 Extermin8 COBOL code section to display When browsing a COBOL program source, EXTERMIN8 will initially position the display depending upon the value of this parameter. T Top of source. B Bottom of source. E At the start of the ENVIRONMENT DIVISION. D At the start of the DATA DIVISION. W At the start of the WORKING STORAGE SECTION. L At the start of the DECLARATIVES SECTION. P At the start of the PROCEDURE DIVISION. Log Breakpoints Defines whether an entry should be made in the Log window and log file every time EXTERMIN8 stops at a breakpoint. With this option is set to Y, each time a breakpoint is reached a log entry will be made showing: Stopped at pgm XXXX line NN.NN/nnnn Where XXXX is the program name, NN.NN is the SEU line number, and nnnn is the MI instruction number. The default is no logging. The logging of breakpoints may also be temporarily set on and off using the SA command with the BREAK attribute. Character Case at Entry Defines whether the command line will accept lower case characters. The default is U for Upper case characters only. An entry of L will enable lowercase input on a permanent basis. The upper/lower case option can be toggled on a temporary basis using F15. Show SEU Numbers at Entry Defines whether the SEU line numbers are displayed on the left hand side of the Browse window. The default is N, not to show the numbers. Enter Y to display SEU line numbers on a permanent basis. The display of SEU line numbers can be temporarily toggled on and off using either F21, unless this has been re-assigned, or the command SA with an attribute of SEU. Nesting Format Display Defines the format that will be used within the Browse window to highlight the levels of nesting of structures within RPG programs. The format options are N L R and 1 to 9, and the default is N. The display of SEU line numbers can be temporarily toggled on and off using either F21, if it has been assigned *NEST, or the command SA with an attribute of SEU. Format Examples: If N is entered, the Number on the left side of the screen indicates the level. Blank means the statement is not within any structure : Structure 1 2 C C C FIELDA FIELDC IFEQ IFNE FIELDB FIELDD Chapter6 1 2 2 1 C C C C Debugging Commands 83 ELSE END C END If L is entered, the structure numbering begins in the left column with each level’s number shown next to the previous, giving a visual impression of the depth of the structure. For structures nested to more than 9 levels, the 10th level will show as a ? to the left of the number 9 and all subsequent levels will be shown as an * for each level. Structure C FIELDA IFEQ FIELDB C FIELDC IFNE FIELDD C C C ELSE C C C END C END If R is entered, the structure numbering is indented towards the right with ‘:’s filling spaces to the right of the number up to the deepest level of nesting within the program. If the depth of nesting is 10 or above the numbering sequence repeats from 0 to 9. 1 12 12 1 12 12 1 Structure :::: C FIELDA IFEQ FIELDB 1::: C FIELDC IFNE FIELDD 2:: C 2:: C 1::: C ELSE 2:: C 2:: C 1::: C END :::: C END The final option for nesting is to indent the source code by a specified number of spaces for each level of structure. Enter the required number (in range 1 to 9). The example below was created using 2 spaces between each level. C C C C C C C C C FIELDA FIELDC IFEQ IFNE FIELDB FIELDD ELSE END END Change Screen Attributes Now Entering Y to this option will display the EXTERMIN8 Attribute Selection Screen. This screen allows selection of the display attributes, either color or monochrome, for the background, status bars, command line, breakpoints and current stop statement. To use this screen, press the function key designated to change the required portion of the screen. Next move the cursor to the required color or display attribute in the 4 x 8 matrix at the top right of the screen, then press enter. The lower portion of the display is an example of how the EXTERMIN8 84 Extermin8 screen would appear based upon the attribute selections. Function keys available on the Attribute Selection Screen are: F5 STATUS Changes the top line of the Browse window and the Status Bar. F6 TEXT Changes the text displayed in both the command and Browse window. F7 INPUT Changes the command line. F8 BREAK Changes how statements that are breakpoints will be highlighted in the Browse window. F9 STOP Changes how the statement where the program is currently stopped will be displayed in the Browse window. Press F3 to return to the User Choices screen. Remote Location of Source Specifies were EXTERMIN8 should look for the source of the program being debugged. The options are: *LCL Look for the source on the local machine. (The default) Name Look for the source on the AS/400 with the given system name. This AS/400 must be connected to the AS/400 via an APPN Network. For further information about retrieving the source from another AS/400, see Chapter 3 Network Debugging. Local Copy of Remote Source Only relevant when the source is being accessed from another AS/400. The options are: *YES A temporary copy of the source is created on the local machine. This speeds up processing once the copy has been made. (The default) *NO EXTERMIN8 will access the source member on the remote AS/400. This speeds up program initiation. For further information about this parameter see Chapter 3 Network Debugging. Amount to Roll This defines the amount a window is to roll up or down when the relevant Roll key is pressed. The options are: F Full window (The default) H Half window C Cursor Position - The line the cursor is positioned on will become the top or bottom line. If the cursor is on the command line than the Browse window will roll a full window. D Data- The screen will page up or down a full window minus 1 line. For example with rollup, the bottom line will become the top line. Chapter6 1-999 Debugging Commands 85 Number of lines to be moved up or down. Restrictions: None See Also: AX CX GX LX Example: >RX USER1 SN- Start Profiling Syntax: SN Description: SN starts user profiling for the current program. Extermin8’s profiling counts the number of times a line in a program is executed, or if a line is executed at all. The counting will continue until the Profiling is cleared, using CLRXT8PRF. Multiple programs can be requested for profiling. After starting profiling, you simply call the program(s). Debug has been enabled at that point and the trace data is captured by an Extermin8 program and logged to the userspace profilings. You can then print the current program, using the PN command, which will also contain a number column indicating the number of times a particular line was executed. Restrictions: None See Also: PN SA SP - Set Program Syntax: SP ProgName Description: SP sets the specified program to be the current program. All further commands referring to the current program will now apply to the named program. SP does not affect what is displayed in the Browse window. Displaying a Program (DP) automatically sets the program displayed to current status. Restrictions: The program to be selected must already be in debug mode. See Also: AB AP CC DC DI DL DP LP Example: >SP shipdetail >SP CUALFS T - Top Syntax: T Description: T displays the beginning of the source member currently in the Browse window. Restrictions: None See Also: B F17 Example: >T 86 Extermin8 OS/400 Command Processor Syntax: /Command Description: The command following the slash is passed on to the OS/400 command processor. Preceding the OS/400 command with the “/” is optional. EXTERMIN8 passes any unrecognized command to the OS/400 command processor. However, if an AS/400 command is equal to an EXTERMIN8 command, the preceding “/” forces the AS/400 command invocation. F4 may be used to prompt any OS/400 command. Restrictions: None See Also: F4 Example: >/wrkactjob 87 A P P E N D I X A Error Messages ‘)’ expected Description: A conditional expression on an EXTERMIN8 command is missing the right parenthesis. Solution: Enter the command again, including the right parenthesis. Invalid decimal data in packed number. Displayed in hex Description: Value has not been assigned to a variable, so the contents are displayed in hex. Multiple occurrence data structure name expected (RPG Only) Description: When changing the occurrence of a data structure, the name of the data structure to change was not specified on the command. Solution: Verify the format of the Change Occurrence command (CO) to add the name of the data structure. No current Program Description: All of the programs have been removed from debug mode, but the EXTERMIN8 command requires a default program. Solution: Add a program to debug mode and then try the request again. Not found or already being serviced. Job not serviced Description: The named Job to debug in service mode was not able to be serviced since it is already being serviced by another Job, or the Job was not found. Solution: End the Job servicing the program you want to debug, or correct the access path to the program in debug mode. 88 Extermin8 Operand expected Description: A conditional expression was entered that is missing the second half of the condition. Solution: Add the second half of the condition and try the request again. Operand types disagree Description: An attempt was made to set a conditional expression of two variables that are not of the same type. Solution: Make sure the variables are of the same type and try the request again. Prior Monitor implicitly removed Description: A Monitor already existed in the current program when a new Monitor was added. The previous Monitor is now lost. Solution: To make sure a Monitor does not already exist in the current program before adding another one. Use the Display Monitor command (DM). Program doesn’t have a Monitor Description: Change Monitor (CM) was entered for the current program but a Monitor does not exist for that program. Solution: To check to see if a Monitor exist for the current program before trying to change it, use the DM command. Remove a Program, then try the command again Description: The maximum of ten programs are in debug mode and an attempt was made to add another program. Solution: Remove a program from debug mode and then add the new program. Service Job is not active Description: EXTERMIN8 was started on a Job that is not active either in batch or at another workstation. Solution: Start the execution of the Job being serviced either in batch or another workstation. See Section 3.2 to debug a batch Job that is not running. SEU number not found Description: When setting a breakpoint, EXTERMIN8 does not recognize the SEU number to be an executable statement. Solution: Make sure the source matches the compiled listing of the program. Appendix A Error Messages Too many variables Description: A maximum of five variables may be displayed on an Add Breakpoint command (AB). An attempt was made to display more than five variables. Solution: Limit the number of variables to five. Value expected Description: The command is expecting a numeric value. Solution: Check the syntax of the command and try the request again. Value padded with blanks to the right Description: The number of characters entered was smaller than the field definition. Solution: Warning only. Variable name expected Description: An EXTERMIN8 command was entered that requires a variable name. Solution: Check the syntax of the command to see where the variable name is expected. Variable name not found Description: EXTERMIN8 cannot find the variable within the source code. Solution: Check to see if the variable name is spelled correctly or that it is used within the program currently being debugged. 89 90 Extermin8 This Page Intentionally Left Blank 91 A P P E N D I X B Quick Reference If the command STRXT8 is entered on the command line or within a CL program, the following format of the keywords is required. PGM (lib/pgm lib/pgm) JOB (number/user/name) UPDPROD (*NO or *YES) CLRLOG (*NO or *YES) PRMTSRC (*NO or *YES) STRXRPT (*USRCHOICE or *NONE or name) Where: PGM A list of up to 10 programs that will be active during the debug session. At least one program name must be given. Programs may be qualified by library name. If the library name is not specified, the library list is searched. JOB Define the Job to be serviced. If omitted, EXTERMIN8 assumes the current Job (i.e. interactive session) is to be used. The Job number, user, and name may be found using option 5 of either the WRKACTJOB command (Job must be running) or the WRKSBMJOB (if the Job is still in the JOBQ). See Chapter 3 for full details of using this parameter. UPDPROD Defines whether or not the programs running during this debug session may update files within Production Libraries. The entry can either be *YES or *NO. The default is *NO. If *YES is chosen, keep in mind that the production files may be updated. CLRLOG Defines whether or not the EXTERMIN8 command log is to be cleared from the previous debug session before starting this session. Specify *NO to display the command log in the Log window as it was at the end of the last session for the same user. The entry can either be *NO or *YES. The default is *YES. PRMTSRC Defines if EXTERMIN8 is to use the source member used by the CRTxxxPGM command that created the object, or if it is to prompt for the source member to be used. The default *NO looks for the source member used to create the object. If this member no longer exists, EXTERMIN8 will prompt for the source member to use. With option *YES, EXTERMIN8 displays the program source prompt screen, giving details of the source member used to compile the program. The user may then enter the library, source file and member name to be used. A separate screen is displayed for each program declared on the STRXT8 command. 92 Extermin8 STRXRPT Defines which Script, if any, is to be used when EXTERMIN8 starts executing. The default, *USRCHOICE, will execute the Script defined on the User Choice screen. The default for the User Choice screen is *NONE, meaning that no startup Script will be executed when starting EXTERMIN8. If a startup Script is necessary, specify the name of the Script to be executed. It is assumed that the Script is a member of the source file defined on the User Choices screen. See Chapter 2 for further details about USER CHOICES and Chapter 3 for details about creating Scripts. EXTERMIN8 Function Keys The following is a brief explanation of all function keys and their uses within EXTERMIN8. Note that some keys have different meanings depending upon whether the cursor is positioned in the Browse or Log window, and may sometimes have different meanings depending on exactly where the cursor is within a given window. A full description of each function key may be found in Chapter 4. ROLL Up/Down Rolls the display in either window up or down . Help Displays the EXTERMIN8 help screen in the Browse window. F1 Sets a temporary breakpoint at the source line where the cursor is positioned. F2 Moves the split between the Browse and Log windows to the current cursor position. F3 Quits the EXTERMIN8 session after prompting for a second F3 to confirm the option. F4 Prompts for either the contents of a variable to be changed, or for a command format to be displayed. • With the cursor placed on a variable name in the Browse window when F4 is pressed, a pop up widow displays the current contents of the variable and allows entry of a new value. • With the cursor on the command line, and a 2-character EXTERMIN8 command having been keyed when F4 is pressed, the syntax of the command is displayed in the Log window. • With the cursor on the command line with an OS/400 command keyed, the relevant OS/400 prompt screen will be displayed. F5 Displays the source of the currently stopped program with the breakpoint line at the top of the Browse window. F6 Changes program restart point. The cursor must be on a TAG, ENDSR, or Paragraph statement within the currently stopped program. F6 only moves the restart position, and F12 or GP must be used to resume execution. F7 (RPG Only) Finds the top of an RPG structure (IF, ELSE, DO, etc.). F8 (RPG Only) Finds the end of an RPG structure (IF, ELSE, DO, etc.). Appendix B F9 Quick Reference 93 RETRIEVE - The action depends on the position of the cursor within the Browse window. This may be used to display the contents of any variable, structure, etc. • With the cursor placed on a variable name in the source when F9 is pressed, a pop up window displays the contents of that variable. This is not available in SETUP mode. • With the cursor placed on an EXSR or PERFORM statement when F9 is pressed, the source of the Subroutine is displayed. The program must be in debug mode. • With the cursor placed on a CALL statement when F9 is pressed, the source of the called program is displayed, provided both the currently displayed and called programs are in debug mode. • With the cursor placed on a COPY statement when F9 is pressed, the source of the copybook is displayed and may be debugged, since program is in debug mode. Format 2 COPY for externally described files is not supported. • In the Log window, F9 may be used to copy a line to the command line. • On the command line, each instance of F9 will retrieve the next most recently executed command until the beginning of the log file is reached. F10 Adds/Removes a breakpoint at the source line where the cursor is positioned. A Conditional Breakpoint may be specified by keying the condition on the command line before pressing F10. F11 Single Step - causes execution of the program executable to stop at the next instruction. EXTERMIN8 highlights each line before it is to be executed. Issuing the SA Step Go command before pressing this key will start “automatic” single stepping. In this mode, EXTERMIN8 executes each instruction line at one second intervals without further intervention. F12Resumes execution of the currently stopped program. When used in SETUP mode, F12 will start executing the currently selected program. If this program requires parameters, enter them on the command line (enclosed by parenthesis) before pressing F12. F13 Displays the last user screen output before the current breakpoint was reached. F14 Expands/Contracts the Browse/Log window to the full screen. The cursor position determines which window will be expanded or contracted. F15 Toggles between upper and lower case for the input on the command line. The default is upper case. F16 Finds a string. The string must be specified on the command line, otherwise the last string searched will be used. F17 Shows TOP of Log or Browse window depending on cursor position. F18 Shows BOTTOM of Log or Browse window depending on cursor position. F19 Moves the source in the Browse window one display width to the left. F20 Moves the source in the Browse window one display width to the right. F21 Toggles the display of Nesting or SEU line numbers or executes a Script depending on the “User choices” option selected. The default is to toggle the display of SEU line numbers. 94 Extermin8 F22 Adds/Removes breakpoints on all executable statements between where the last breakpoint was added or removed using F10 and the current cursor position. • For example, to add a range of breakpoints, place the cursor on the first breakpoint line and press F10. Then position the cursor on the last line of the range and press F22. If the last F10 removed a breakpoint, all breakpoints within the range are removed. • If a condition was entered on the command line when the last F10 was pressed, this condition is included on all breakpoints added with F22. F23 (RPG) Step Over - when single stepping, F23 may be used to Step Over a Subroutine, i.e. if the next statement to be executed is EXSR then the Subroutine will execute and EXTERMIN8 will stop before executing the statement immediately following the EXSR. F23 (COBOL) Step Over - when single stepping, F23 may be used to Step Over a Subroutine, i.e. if the next statement to be executed is PERFORM, the Subroutine will execute and EXTERMIN8 will stop before executing the statement immediately following the PERFORM. Only valid if subr/PERFORM stack is being maintained. F24 (RPG) Step Out - while in single step mode, steps out of the current Subroutine, i.e. continue execution and resume single stepping on completion of the Subroutine. F24 (COBOL) Step Out - while in single step mode, step out of the current Subroutine, i.e. continue execution and resume single stepping on completion of the Subroutine. Only valid if subr/PERFORM stack is being maintained. EXTERMIN8 Commands The commands available are listed below, each with a short description. A complete description of each command with parameters and options can be found in Chapter 5. AB Add a breakpoint. AD Add a field name to the Display list, the contents of which will be displayed whenever the program execution is stopped by EXTERMIN8. AM Add Monitor. program execution will be stopped when the conditional expression entered is met. AP Add the specified program to those currently in debug mode (maximum of 10). AX Add Script - i.e. display the editor to enter commands for a new Script. B Displays the end of the source member. CB Change or add condition for an existing breakpoint. CC Change the Contents of a field, indicator, data elements, or record. CM Change the current Monitor. CO (RPG Only) Change the Occurrence of a Multiple Occurrence Data Structure. CP Change one of the programs being debugged by editing, recompiling, and returning the new object to debug mode. CS Change any source by calling the SEU editor. CX Change Script. Appendix B Quick Reference 95 D@ Display the stopped program’s name and the next statement number to be executed. DB Display the details of a specified breakpoint. DC Display the Contents of a field, data elements or record. DD Display the contents of all the fields in the Display list. DI (RPG Only) Display all Indicators referenced by the program. DL Display the contents of the fields that make up a K or P List. DM Display the current Monitored condition. DP Display the source of the named program which must be currently in debug mode. DR Display the source of the named Subroutine in the current program. DS Display the contents of the named source member. DX Display the named Script. F Finds the given string in the currently displayed source. FT Find first line of RPG spec type in the source currently displayed. GP Go Program, resume the stopped program, if no program is currently stopped then start the currently selected program. GX Go Script. G6 Go S/36 procedure. LB List all breakpoints. All programs in debug mode are included in this list, as well as the variable names that will be displayed when each breakpoint is reached. LD List the names of the fields in the Display List. LF Lists the files used by the current program and optionally the record format names. LM List the condition being Monitored for in the current program. LP Lists the programs currently in debug mode, and optionally their source code members. LR Lists the subRoutines used by all programs currently in debug mode. LS List all the source members currently open for display. LV List all the variables declared for a given program. LX List the selected Script. PN Print profiling. RB Remove selected or all breakpoints. RD Remove a name from the Display list. 96 Extermin8 RM Remove the Monitor. RP Remove a program from debug mode. RS Remove the specified source member from the open source list. This must be done before the source can be modified by any Job. RX Removes the source member containing the given Script. SA Set User Choices, nesting attributes, break attributes, single step attributes. SN Start Profiling. SP Set the current program. T Displays the beginning of the source member. 97 A P P E N D I X C PC Support and Emulation When running EXTERMIN8 from a PC connected either with straight 5250 emulation or PC Support, some screen attributes may need to be changed to make breakpoints observable on a color screen. EXTERMIN8 is shipped with default screen attributes that are suitable for a monochrome screen, including underline to signify a line where a breakpoint has been set. The underline attribute is not used with a color screen, so a different attribute must be selected using the options from the SA command. See SA User Choices in Chapter 5 for instructions on how to change screen attributes. 98 Extermin8 This Page Intentionally Left Blank 99 Index A AB add breakpoint, 59 Actions used by EXTERMIN8, 19 AD add display, 59 Add breakpoint AB, 59 Add display AD, 59 Add monitor AM, 60 Add program AP, 60 Add script AX, 61 Add/remove breakpoint F10, 47 Add/remove breakpoints up to cursor position F22, 53 Adjust split of windows F2, 43 AM add monitor, 60 Amount to roll, 27 AP add program, 60 AS/400 model, 6 ATTN, 42 Attributes selection screen function keys, 26 Authorization code, 5 entering, 5 trial version, 5 Automated single stepping, 48 AX add script, 61 B B bottom, 61 Batch job debugging, 32 Batch programs, 30 Bottom B, 61 Bottom of source F18, 52 Break and go F1, 43 Browse commands (SEU type), 16 Browse window, 16 commands, 17 function keys, 17 status bar, 16 Browsing COBOL program, 24 RPG program, 24 C CB change breakpoint, 62 CC change contents, 62 Change and compile program CC, 64 Change breakpoint CB, 62 Change contents CC, 62 Change monitor CM, 63 Change occurrence CC, 63 Change script CX, 65 Change source CS, 64 Changing screen attributes, 26 Character case at entry, 24 Clear command log, 15 Clear profiling, 37 CLRLOG, 15 Clrxt8prf - clear profiling, 37 CM change monitor, 63 CO change occurence, 63 COBOL programs browsing, 24 100 EXTERMIN8 types of copy statements, 29 COBOL SQL debugging, 29 Command line, 16 start profiling, 35 Command log file, 18 Command log name, 23 Command parameters EXTERMIN8, 14 Command syntax, 57 Commands browse (SEU type), 16 EXTERMIN8, 11, 19 Company name, 6 Conditional expressions, 21 example, 22 valid operators, 57 COPY statements debugging programs (RPG), 28 Copybook Acceptable formats, 29 Debugging, 30 External file definitions, 46 Retrieve for debugging, 46 CP change and compile program, 64 Creating scripts, 33 CRTSQLCBL Debugging expanded source, 29 CS change source, 64 CX, 35 change script, 65 D D@ display @location, 65 display calling stack, 66 Date end, 7 DB display breakpoint, 66 DC display contents, 67 DD display display, 67 Debug session starting, 14 Debugging batch job not yet running, 32 COBOL SQL, 29 jobs currently executing, 32 network, 38 RPG programs containing COPY statements, 28, 29 DI display indicators, 68 Display subroutine DR, 69 Display @location D@, 65 Display breakpoint DB, 66 Display calling stack D@, 66 Display contents DC, 67 Display current location F5, 45 Display display DD, 67 Display indicators DD, 68 Display list DL, 68 Display monitors DM, 68 Display paragraph or copybook DR, 69 Display program DP, 69 Display script DX, 70 Display source DS, 70 Display user screen F13, 50 DL display list, 68 DM display monitors, 68 DP display program, 69 DR display paragraph or copybook, 69 display subroutine, 69 DS display source, 70 DX, 35 display script, 70 E End profiling, 36 End date, 7 Endxt8prf - end profiling, 36 Entering authorization code, 5 Error messages, 87 Examples format, 25 Executing programs to be debugged, 29 Expand/contract browse window F14, 50 Expand/contract log window F14, 51 Extending a trial, 7 EXTERMIN8 actions, 19 Index command parameters, 14 commands, 11, 19 object types, 20 points to consider, 30 quick start, 10 running a script, 34 running a script when starting, 34 screen, 16 tutorials (COBOL), 11 tutorials (RPG), 11 EXTERMIN8 commands listing of, 94 F F find, 70 F1, 43 F10, 47 F11, 48 F12, 50 F13, 50 F14, 18, 50 - 51 F15, 51 F16, 51 F17, 18, 52 F18, 18, 52 F19, 52 F2, 18, 43 F20, 53 F21, 53 F21 action, 23 F22, 53 F23, 54 F24, 54 - 55 F3, 44 F4, 44 F5, 45 F6, 45 F7, 45 F8, 45 F9, 18, 46 - 47 Find F, 70 Find a string F16, 51 Find end of structure F8, 45 Find top of structure F7, 45 Find type FT, 71 FT find type, 71 FT x (COBOL), 17 FT x (RPG), 17 Function keys attribute selection screen, 26 listing of, 92 log window, 18 SEU type, 17 G G6 go S/36 procedure, 73 General syntax of EXTERMIN8 commands, 19 Go program GP, 72 Go S/36 procedure G6, 73 Go script GX, 73 Go to TAG, ENDSR or paragraph name F6, 45 GP go program, 72 GX Go script, 73 H HELP, 42 I Interactive programs, 29 J Job, 14 Jobs debugging, 32 K Keys ATTN, 42 F1, 43 F10, 47 F11, 48 F12, 50 F13, 50 F14, 50, 51 F15, 51 F16, 51 F17, 52 F18, 52 F19, 52 F2, 43 F20, 53 F21, 53 F22, 53 F23, 54 F24, 54, 55 F3, 44 F4, 44 F5, 45 101 102 EXTERMIN8 F6, 45 F7, 45 F8, 45 F9, 46, 47 HELP, 42 PRINT, 43 RolUp/RolDn, 42 L LB list breakpoints, 73 LD list displays, 74 LF list files, 74 License ending date, 7 License key, 6 List breakpoints LB, 73 List displays LD, 74 List files LF, 74 List monitor LM, 75 List programs LP, 75 List script LX, 77 List source LS, 76 List subroutines LR, 76 List variable LV, 76 Listing of extermin8 commands, 94 extermin8 function keys, 92 LM list monitor, 75 Local copy of remote source, 27 Log breakpoints, 24 Log window, 16, 17 function keys, 18 LP list programs, 75 LR list subroutines, 76 LS list source, 76 LV list variable, 76 LX, 35 list script, 77 M Maintain subr/perform stack (COBOL), 23 N Name of company, 6 Name of user, 6 Nesting format display, 25 Network debugging, 38 Numbering starting, 36 O Object types used by EXTERMIN8, 20 Operators priority, 57 OS/400 command processor, 86 Overview EXTERMIN8, 10 P PC support and emulation, 97 PN print profiling, 77 PRINT, 43 Print profiling PN, 77 Printing profiling, 38 Priority of operators table, 22 PRMTSRC, 15 Profiling, 35 clear up, 37 end, 36 printing, 38 review, 37 starting, 35, 36 Program, 14 Program source prompt screen, 15 Prompt a command F4, 44 Prompt for source names, 15 Prompt/change variable F4, 44 Q Quick reference, 91 Quick start EXTERMIN8, 10 Quit session F3, 44 R RB remove breakpoint, 77 RD remove display, 78 Relational operators, 21 Index Remote location of source, 26 Remove breakpoint RB, 77 Remove display RD, 78 Remove monitor RM, 78 Remove program RP, 79 Remove script RX, 79 Remove source RS, 79 Retrieve a command F9, 47 Retrieve program source F9, 46 Retrieve variable F9, 46 Review profiling, 37 RM remove monitor, 78 RolUp/RolDn, 42 RP remove program, 79 RPG program browsing, 24 RPG programs debugging, 29 RS remove source, 79 RX, 35 remove script, 79 Show right of source F20, 53 Single step execution F11, 48 step over a procedure PERFORM, 48 Single stepping automated, 48 SN, 36 start profiling, 85 SP set program, 85 Start profiling SN, 85 Start/resume execution F1, 50 Starting debug session, 14 numbering, 36 profiling from command line, 35 profiling within extermin8, 36 tutorial (COBOL), 12 tutorial (RPG), 12 Startup script, 15, 23 Status bar browse window, 16 fields, 18 Step out F24, 54, 55 Step over F23, 54 STRTUTOR, 11 STRXRPT, 15 STRXT8, 11 format of keywords for, 14 STRXT8PRF, 35 S SA, 17, 37 set attributes, 79 user choices, 81 SA SEU, 17 Screen attributes changing, 26 Script commands, 35 creating, 33 Example, 34 running from within EXTERMIN8, 34 running when starting EXTERMIN8, 34 Scripts file, 23 Serial number, 6 Set attributes SA, 79 Set program SP, 85 SEU numbers show at entry, 24 Show left of source F19, 52 T T top, 85 Table priority of operators, 22 Toggle SEU numbers or nesting F21, 53 Toggle upper/lower case input on the command line F15, 51 Top T, 85 Top of source F17, 52 Trial expiration date, 7 Tutorial EXTERMIN8 (COBOL), 11 EXTERMIN8 (RPG), 11 starting (COBOL), 12 starting (RPG), 12 103 104 EXTERMIN8 U V Update production file, 15 UPPROD, 15 User choices, 22 parameters, 23 SA, 81 User name, 6 Using scripts, 33 Valid logical operators, 21 W Within extermin8 start profiling, 36 X XT8SRV, 11