|Overview of Assembler Option||Overview of CICS Option|
This chapter provides a description of Assembler Option's debugging facilities.
When an Assembler module is debugged, a separate character-based window opens containing the Assembler debugger. This window overlays the Application Output window, which remains available to you via a debugger option.
These are some of the things you can do during debugging:
For step-by-step instructions on how to use the Assembler debugger, click Help Topics on the Mainframe Express Help menu, then on the Contents tab click Assembler Option, Debugging, then select from the categories shown.
Before you can debug an Assembler module, you must compile the module with Create Debug Information checked. You can find this check box on the General page of the Assembler page of the Build Settings for Project or Build Settings for filename dialog box. If you want to debug a module that is part of an application containing several modules, you must check Create Debug Information for every module in the application. If your application has a separate link file, you must also check Create Debug Information on the General page of the Linker page of the Build Settings for Project or Build Settings for filename dialog box.
You start debugging by clicking Start Debugging on the Debug menu. On the Start Debugging dialog box, check Enable Assembler debugging, then click OK. If you debug the module again during the same session, you can start it by clicking Start Debugging, Run or Debug. Whenever control is passed to an Assembler module, the Assembler debugger window opens automatically and waits for an action from you (unless you have previously requested that the entire application should be executed with no more debugging).
The Assembler debugger also starts automatically if an abend occurs.
Certain actions from you stop the debugger automatically, such as rebuilding the project or opening a different project. Alternatively you can stop the debugger yourself in the following ways:
Figure 28-1 shows the Assembler debugger with the program mfasm03.mlc loaded. This program is part of the project acobdemo, which you can find in \mfuser\projects\gmdemo\acobdemo\acobdemo.mvp. See the chapters Assembler Applications and Debugging Assembler in your Getting Started for descriptions of how to build and run this project.
Figure 28-1: The Assembler Debugger Window
The Assembler debugger window is divided into four panels:
This is displayed on the left-hand side on a red background between lines 01 through 18 and columns 01 through 28. Line 18 of the trace panel always shows the next instruction to be executed. Lines in the trace panel scroll upwards as instructions are executed. The previous 17 instructions are displayed on lines 1 through 17.
This is displayed on the right-hand side on a blue background between lines 01 through 18, columns 29 through 80. The list panel shows the source listing. Line 18 of the list panel is normally in synchronization with line 18 of the trace panel. You can scroll and page forward and backward through the source listing.
This is displayed on a gray background between lines 19 through 21, columns 01 through 80. The register panel displays the 16 general-purpose registers. The registers are dynamically updated as they change during program execution. The floating-point registers may also optionally be displayed.
This is displayed on a black background between lines 22 through 24, columns 01 through 80. The menu panel displays the various menu choices available.
You can toggle synchronization of the trace and list panels on and off using the M (syncMode) command.
You can change the background and foreground colors used in each of the four panels using the C (Color) command.
There are a number of ways to execute all or part of the module:
For more information see the online help.
You can move around your source code in the listing panel using the + and - keys or Page Up and Page Down. If you then want to resynchronize with the trace panel you can press L (syncList) to display the next instruction to be executed on line 18.
You can use the F (Find) command to locate various parts of the code:
The debugger scrolls through the code until the instruction containing the part of the code you specified is on line 18.
You can halt execution by monitoring module exits with the E (Exit) command, and by setting breakpoints.
You can use the B (Breakpoint) command to set breakpoints on:
You can specify up to four relative addresses.
You can specify one or two opcodes.
You can set breakpoints on four categories of branch instruction.
You can set breakpoints on the value of any of the 16 general-purpose registers. You can select from a range of conditions.
In all cases, the debugger monitors the breakpoints you have set, and halts execution in accordance with them.
Use the U (Unset) command to clear all breakpoints of all types. You can do a certain amount of selective clearing within the four breakpoint options.
You can specify that execution is to be halted when the following types of module exit occur:
You can view and change values in registers and areas of memory.
The general-purpose registers are permanently displayed. You can use the R (Reg) command to:
You can use the D (Dump) command to view one or two dumps at once. Each dump displays 32 bytes of memory starting with the byte at the address you specify. Figure 28-2 shows the debugger window with two dumps displayed.
Figure 28-2: Dump Windows
Notice that the menu panel (on lines 22 through 24) now contains the dump menu. This includes facilities to:
Once you have closed the dump windows, you can see the dumps last requested by pressing O (Odump, which stands for Old dump).
You can examine the instruction that is currently on line 18 of the trace panel using the P (probe) command. There are two levels of information available as explained in this example.
When you press P the first time, you obtain the Probe window. Figure 28-3 shows the Probe window for a CP (Compare Packed-decimal) instruction in mfasm03.mlc.
Figure 28-3: Probing the Compare Packed-decimal Instruction
The information in the Probe window is in three categories:
|Line 1||Quick-reference information for the Assembler instruction.|
|Lines 2 through 10||Detailed description of the Assembler instruction to be executed. The machine code for the instruction is shown in the center of the Probe window.|
|Lines 11 through 12||Brief description of the Assembler instruction.|
When you press P a second time you see the dump windows shown in Figure 28-2. The first dump begins with the first operand of the instruction and the second dump begins with the second operand. The operands are highlighted.
When you press P a third time the Assembler debugger returns to Step mode to enable you to continue stepping through the program.
Note: Pressing Escape escapes from each Probe window a single step at a time.
The Assembler debugger displays messages on line 1. Most messages disappear when you perform another debugger function. You can recall the last message by pressing Shift+?
You can obtain a status report on the current debugging activity using the I (Info) command.
You can view the Application Output window by pressing F2. Pressing F2 again redisplays the debugger.
You can obtain a list of all Assembler instructions by pressing F1, then 1 from the menu displayed. Once you have obtained the list, you can press S (for Select) then enter an opcode; the debugger then displays the same instruction information that you get when you use the Probe instruction, except that actual addresses are missing.
The Assembler debugger provides a calculator for doing additions. You can add up to three numbers and can work in either hexadecimal or decimal. You can keep the calculator displayed while you return to debugging operations.
While you are working with the Assembler debugger you often have to enter hexadecimal values a byte at a time, which requires eight hexadecimal characters. The debugger provides a number of short-cut techniques for entering hexadecimal values.
For further information see the online help: click Help Topics on the Mainframe Express Help menu, then on the Contents tab click Assembler Option, Debugging, then select from the categories shown..
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
|Overview of Assembler Option||Overview of CICS Option|