Chapter 4. Operating and Debugging in Direct Mode

Revision History
Revision V7.1-002 19 September 2023
Revision V7.1-001 26 June 2023
Revision V6.3-007 04 February 2019
Revision V6.3-005 29 June 2018
Revision V6.3-003 12 December 2017
Revision V6.2-001 27 February 2015 In “Line Editing”, added GT.M behavior for the Delete key and an example to modify terminfo capabilities.

Table of Contents

Operating in Direct Mode
Entering Direct Mode
Functionality Available in Direct Mode
Exiting Direct Mode
Debugging a Routine in Direct Mode
Creating and Displaying M Routines
Executing M Routines Interactively
Processing with Run-time and Syntax Errors
Correcting Errors
Stepping Through a Routine
Continuing Execution From a Breakpoint
Interrupting Execution
Using the Invocation Stack in Debugging
Transferring Routine Control
Displaying Source Code
Correcting Errors in an M Routine
Relinking the Edited Routine
Re-executing the Routine
Using Forked Processes
Summary of GT.M Debugging Tools

Direct Mode is an important tool in GT.M because it allows you to interactively debug, modify, and execute M routines. Direct Mode is a shell that immediately compiles and executes GT.M commands providing an interpretive-like interface. M simplifies debugging by using the same commands for debugging that are used for programming.

The focus of this chapter is to describe the debugging process in Direct Mode, and to illustrate the GT.M language extensions that enhance the process. Command functionality is described only in enough detail to illustrate why a particular command is useful for a debugging activity being described. If you have specific functionality questions about a command or variable, see the Commands, Functions, or Intrinsic Special Variables chapter.

It is also from Direct Mode that you activate GT.M tools used to create M source code. The interaction of M commands used for editing and compiling is described in greater detail within Chapter 3: “Development Cycle.