PreviousMultiple Assembler Programs CICS ApplicationsNext"

Chapter 16: Debugging Assembler

Use the Assembler debugger in Mainframe Express to single-step an application. You can watch the flow of control through the Assembler source and use an extensive set of debugging facilities.


You need to have read the chapter Start Here for the Tutorials and worked through the first session, Using Mainframe Express, and the session Assembler Applications, before you do this session.

You need to have installed Assembler Option to do this session. We assume you are familiar with Assembler on a mainframe.


16.1 Overview

The Assembler debugger was introduced briefly in the chapter Assembler Applications. This session goes deeper into the use of the debugger. This session uses the same demo application as the chapter Assembler Applications.

16.2 Preparation

This demo uses the project acobdemo.mvp that you used in the chapter Assembler Applications.

  1. If you have closed Mainframe Express, open it as before. Close any project windows and any other windows that are open.

  2. Open the project acobdemo.mvp in any of the ways described in the chapter Start Here for the Tutorials.

    The full path is \mfuser\projects\gsdemo\acobdemo\acobdemo.mvp. If you use Open on the File menu, you need the Files of Type field on the Open dialog box set to Project files (*.mvp) to see this file.

16.3 Sample Session

In this session you:

16.3.1 Starting Debugging

To debug the application:

  1. Click Mfcbl03.tso in the right-hand pane to select it, then click Start Debugging on the Debug menu.

    You don't have to debug the COBOL as well as the Assembler - we could have used Run. But often you want to debug both at the same time.

  2. Check Enable Assembler debugging. This causes the Assembler module to be debugged.

  3. Click the TSO tab. The name of the CLIST file to run has defaulted to the one you selected.

  4. Click OK.

  5. Press g repeatedly until you reach the line:

    CALL 'MFASM03' USING PASS-AREA.

  6. Press g once more.

    The Application Output window is replaced by the Assembler debugger window.

16.3.2 Moving Around the Source

The following sequence illustrates various techniques for moving around the source code:

  1. Press the - key or Cursor Down key once. The main panel (the largest of the four panels, which contains the source listing) scrolls down one line.

  2. Press F (Find). In the window that appears, enter 1 for Label and enter ERROR1. You move to the line with the label ERROR1.

  3. Press L to resynchronize the current line to the line about to execute.

16.3.3 Setting and Clearing Breakpoints

In the following sequence you set a breakpoint then clear it.

  1. Press B (Break). In the window that appears, select 2, Opcode and against Opcode 1 enter SVC. Press Enter or Escape to remove the window.

  2. Press G (Go). You move to the next line that contains an SVC instruction.

  3. Press U (Unset). The breakpoint is unset.

16.3.4 Examining Dumps and Instructions

In the following sequence you view dumps then examine an instruction.

  1. Press D (Dump). The menu at the bottom of the window changes to the dump menu.

  2. Enter 1, then in the window that appears enter a hexadecimal address. Choose an address from the addresses listed at the left-hand side of the trace panel, on the left of the window. You see a window containing a dump of the 32 bytes starting at the address you gave.

  3. Enter 2, then in the window that appears enter another hexadecimal address. You see a second dump.

  4. Enter T (Text) to see any text equivalents of the hexadecimal values in the dump.

  5. Press Escape three times to close both dump windows and return to the normal menu.

  6. Assuming that you have not executed any more instructions since stopping at the SVC instruction, press S (Step) three times. You move to the third line following the SVC line. This line contains a CLC instruction.

  7. Press P (Probe). A window is displayed giving information about the CLC instruction.

  8. Press P (Probe) again. Two dump windows appear, one for each operand.

  9. Press P (Probe) a third time. All the probe windows disappear.

16.3.5 Continuing without Debugging

The term "zoom" means to continue the run without further debugging.

  1. Press N to run to the end of the Assembler program without further debugging.

    The two lines of output from the Assembler program appear in the Application Output window. The Assembler program exits back to the COBOL program. You can now continue debugging the COBOL.

  2. Click repeatedly until you reach the next occurrence of:

    CALL 'MFASM03' USING PASS-AREA.

  3. Click once more.

    The Assembler debugger appears again.

  4. Press Z to run to the end of the Assembler program without further debugging.

    The difference between N (Next) and Z (Zoom) is that after N, the Assembler Debugger appears again next time execution enters an Assembler program. With Z, subsequent calls to Assembler are not debugged. This is not affected by whether you continue single-stepping the COBOL code or you click to continue without further debugging the COBOL.

  5. Click .

    The application continues without debugging. Before finishing it waits for you to press Enter.

  6. When it pauses, click in the Application Output window and press Enter.

16.4 Before Continuing

Close the source view window and hide the Application Output window.

Close the project. If you want to take a break before going on to the next session, you can close Mainframe Express.

Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousMultiple Assembler Programs CICS ApplicationsNext"