4 Using the Debugger: Graphical User Interface

This chapter explains how to:

The chapter describes window actions and window menu choices, but you can perform most common debugger operations by choosing items from context-sensitive pop-up menus. To access these menus, click on MB3 while the mouse pointer is in the window area.

You can also enter commands at the command-entry prompt. For information about entering debugger commands, see Section 2.4.

4.1 Displaying the Source Code of Your Program

By default, the debugger's Main Window displays the source code of your program (see Figure 4-1).

Figure 4-1 Source Display

Whenever execution is suspended (at a breakpoint for example), the debugger updates the source display by displaying the code that surrounds the point at which execution is paused. The current- location pointer to the left of the source code marks the line whose code will execute next. (A source line corresponds to one or more programming-language statements, depending on the language and coding style.)

By default, the debugger displays line numbers to the left of the source code. These numbers help you identify breakpoints that are listed in the Breakpoint View (see Section 4.4.3). You can choose not to display line numbers. To hide or display line numbers, choose File:Display Line Numbers on the Main Window.

The current-location pointer is normally filled in as shown in Figure 4-1. The current-location pointer is cleared if the displayed code is not that of the routine in which execution is paused.

You can use the scroll bars to show more of the source code. However, you can scroll vertically through only one module of your program at a time.

The following sections explain how to display source code for other parts of your program so that you can set breakpoints in various modules. Section 4.1.2 explains what to do if the debugger cannot find source code for display. Section 4.6.1 explains how to display the source code associated with routines that are currently active on the call stack.

After you navigate the Main Window, you can redisplay the location at which execution is paused by clicking on the top item in the Call Stack menu.

If your program was optimized during compilation, the source code displayed might not reflect the actual contents of some program locations.

4.1.1 Displaying Source Code Contained in Another Module

To display source code contained in another module or source file:

  1. Choose File:Browse Source... on the Main Window. The Browse Source dialog box appears listing your program file. See Figure 4-2.

  2. Double click on the image to get a list of modules.

  3. Double click on the name of the module or source file containing the routine of interest. The names of the program's modules are displayed (indented) under the file name, and the Display Source button is now highlighted.

  4. Click on the name of the module whose source code you want to display.

  5. Click on Display Source. The source display in the Main Window now displays the module's source code.

Section 4.6.1 describes an alternative way to display routine source code for routines currently active on the call stack using the Call Stack menu.

The Browse Source dialog box displays information in a hierarchical form about all the binary files in your application. For each binary file, it displays information about the modules contained in the binary. For each module, a list of routines in that module can be displayed.

You can manipulate the Browse Source display by clicking on menu items in the Browse Source pop-up menus.

Figure 4-2 Displaying Source Code in Another Routine

4.1.2 Making Source Code Available for Display

In certain cases, the debugger cannot display source code. Possible causes are:

If the debugger cannot find source code for a display, it tries to display the source code for the next routine on the call stack for which source code is available. If the debugger can display source code for such a routine, the current-location pointer is cleared. The pointer then marks the source line to which execution returns in the calling routine.

4.1.3 Specifying the Location of Source Files

Information about the characteristics and the location of source files is embedded in the debug symbol table of your program. If a source file has been moved to a different directory since compile time, the debugger might not find the file. To direct the debugger to your source files, enter the use [directory] command at the command-entry prompt.

4.2 Editing Your Program

The debugger provides a simple text editor you can use to edit your source files while debugging your program (Figure 4-3).

Figure 4-3 Editor Window

To invoke the editor, choose Commands:Edit File on the Main Window. By default, the editor window displays an empty text buffer, called dbg_editor_main . However, if you are debugging a program when you invoke the editor, the editor window displays this program, names the filled text buffer with its file specification, and places dbg_editor_main on the buffer menu at the upper right corner as an alternative text buffer.

The editor allows you to create any number of text buffers by choosing File:New (for empty text buffers) or File:Open (for existing files). The name of each text buffer appears in the buffer menu. You can cut, copy, and paste text across buffers by choosing items from the Edit menu and selecting buffers from the buffer menu.

You can perform forward and backward search and replace operations by entering strings in the Find text and Replace with entry boxes and clicking on a directional arrow.

If you continue to click on a directional arrow, or if you continue to press the Return key, a repeated search for the string occurs in the direction you indicate.

You can also continue a search by choosing the Edit:Find/Replace Next or Edit:Find/Replace Previous.

When you complete your edits, save these to your file by choosing the File:Save or File:Save As. Then recompile and relink your source file so the changes will take effect.

4.3 Executing Your Program

This section explains how to:

For information about rerunning your program or running another program from the current debugging session, see Section 3.4 and Section 3.5.

4.3.1 Determining Where Execution Is Currently Paused

To determine where execution is currently paused within your program:

  1. To list the sequence of routine calls that are currently active on the call stack, click on the Call Stack menu. Level 0 denotes the routine in which execution is paused, level 1 denotes the calling routine, and so on.

  2. If the current-location pointer is not visible in the Source View, select the top item in the Call Stack menu. This will reset the Source View to the location of the pointer.

  3. Look at the current-location pointer:

4.3.2 Starting or Resuming Program Execution

To start program execution or resume execution from the current location, click on the Continue button on the push-button panel (see Figure 2-4) or the Continue item in the pop-up menu on the window or view of your choice.

Once started, program execution continues until one of the following occurs:

Whenever the debugger suspends execution of the program, the source display display is updated and the current-location pointer marks the line whose code will execute next.

Letting your program run freely without debugger intervention is useful in situations such as the following:

4.3.3 Executing Your Program One Source Line at a Time

To execute one source line of your program, click on the Next button on the push-button panel or the Next pop-up menu item in the window or view of your choice. Note that the Next button executes a routine call, but does not step into it.

After the line executes, the source display is updated and the current-location pointer marks the line whose code will execute next.

Executable lines have a toggle button to their left in the source pane.

Nonexecutable lines do not have a toggle button to their left in the source pane.

Keep in mind that if you optimized your code at compilation time, the source code displayed might not reflect the code that is actually executing (see Section 1.4).

4.3.4 Stepping into a Called Routine

When program execution is paused at a routine call statement, clicking on the Next push button executes the called routine in one step. The debugger suspends execution at the next source line in the calling routine (assuming no breakpoint was set within the called routine). "Stepping over" called routines lets you move through the code quickly without having to trace execution. Use the Next button to step over routines.

To "step into" a called routine so that you can execute it one line at a time:

  1. Suspend execution at the routine call statement by setting a breakpoint (see Section 4.4) and then clicking on the Continue push button on the push-button panel.

  2. When execution is paused at the breakpoint, click on the Step push button on the push-button panel. This moves execution just past the start of the called routine.

Once execution is within the called routine, click on the Next push button to execute the routine line by line.

Clicking on the Step button when execution is not paused at a routine call statement is the same as clicking on the Next push button.

4.3.5 Returning from a Called Routine

When execution is suspended within a called routine, you can execute your program directly to the end of that routine by clicking on the Return button on the push-button panel on the Main Window, returning you to the calling routine.

The Return button is particularly useful if you have inadvertently stepped into a routine that is out of the scope of the bug you are tracking.

4.4 Suspending Execution by Setting Breakpoints

A breakpoint is a location in your program at which you want execution to stop so that you can perform some action such as checking the current value of a variable, stepping into a routine, etc. When using the window interface, you can set breakpoints on:

A breakpoint with no condition associated with it can be set by using the Break menu, but it is often simpler to click on the toggle push button in the source display.

You can also qualify breakpoints as follows:

You can set a breakpoint that is both a conditional and an action breakpoint. The following sections explain these breakpoint options.

4.4.1 Setting Breakpoints on Source Lines

You can set a breakpoint on any source line that has a toggle button to its left in the source pane. These are the lines for which the compiler has generated executable code (for example, routine declarations, assignment statements).

To set a breakpoint on a source line:

  1. Find the source line on which you want to set a breakpoint (see Section 4.1).

  2. To set the breakpoint, do one of the following:

    The breakpoint is set when the button is filled in. The breakpoint is set at the start of the source line-that is, on the first machine-code instruction associated with that line.

Figure 4-4 shows that a breakpoint has been set on the start of line 14.

Figure 4-4 Setting a Breakpoint on a Source Line

To set a breakpoint in the Instruction View:

  1. In the Instruction View, find the instruction on which you want to set a breakpoint.

  2. Click on the toggle button to the left of that line. (The breakpoint is set when the toggle button is filled in.)

4.4.2 Setting Breakpoints on Routines with Source Browser

The Browse Source dialog box displays hierarchical information about all the binary files in your application. For each binary file, it displays information about the modules contained in the binary. For each module, you can display a list of routines in that module.

Setting a breakpoint on a routine enables you to move execution directly to the routine and inspect the local environment.

To set a breakpoint on a routine:

  1. Choose File:Browse Source... on the Main Window (see Figure 2-2). The Browse Source dialog box appears, listing your program file.

  2. Double click on the name of your program file. The names of any additional source files required for compilation are displayed (indented) under the program name.

  3. Double click on the name of the file where you want to set a breakpoint. The names of the routines in that file are displayed in the Routine column (see Figure 4-5).

  4. Do one of the following:

In the source pane, the toggle button to the left of the source line that contains the start of the routine is now filled in, confirming that the breakpoint is set. (If the Instruction Window is open, the breakpoint will also display for the corresponding instruction.)

Figure 4-5 Setting a Breakpoint on a Routine

4.4.3 Identifying the Currently Set Breakpoints

There are two ways to determine which breakpoints are currently set:

Figure 4-6 Breakpoint View with Action and Condition

4.4.4 Deactivating, Activating, and Deleting Breakpoints

After a breakpoint is set, you can deactivate, activate, or delete it.

Deactivating a breakpoint causes the debugger to ignore the breakpoint during program execution. However, the debugger keeps the breakpoint listed in the Breakpoint View so that you can activate it at a later time, for example, when you rerun the program (see Section 3.4). The following are procedures to deactivate or activate breakpoints:

When you delete a breakpoint, it is no longer listed in the Breakpoint View so that later you cannot activate it from that list. You would have to reset the breakpoint as explained in Section 4.4.1 and Section 4.4.2. The following are procedures to delete breakpoints:

4.4.5 Setting and Modifying a Conditional Breakpoint

A conditional breakpoint suspends execution only when a specified expression is evaluated as true. For example, you can specify that a breakpoint take effect when the value of a variable in your program is 4. The breakpoint is ignored if the value is other than 4.

The debugger evaluates the conditional expression when the breakpoint triggers during execution of your program.

To set a conditional breakpoint:

  1. Display the source or instruction line on which you want to set the conditional breakpoint (see Section 4.1).

  2. Display the Set/Modify Breakpoint dialog box in one of the following ways:

  3. Enter a relational expression in the Condition: field of the dialog box. The expression must be valid in the source language. For example, a[3] == 0 is a valid relational expression in the C language.

  4. Click on OK. The conditional breakpoint is now set. The debugger indicates that a breakpoint is conditional by changing the shape of the breakpoint's button from a square to a diamond.

Figure 4-7 Setting a Conditional Breakpoint

The following procedure modifies a conditional breakpoint; it can be used to change the location or condition associated with an existing conditional breakpoint, or to change an unqualified breakpoint into a conditional breakpoint:

  1. Press Ctrl/MB1 on the button to the left of a source line, an instruction code line, or a breakpoint entry in the Breakpoint View.

  2. Click on a breakpoint entry in the Breakpoint View, and choose the Set/Modify item from the Break menu.

  3. Enter a relational expression in the Condition: field of the dialog box. The expression must be valid in the source language. For example, a[3] == 0 is a valid relational expression in the C language.

  4. Click on OK. The conditional breakpoint is now set. The debugger indicates that a breakpoint is conditional by changing the shape of the breakpoint's button from a square to a diamond.

  5. Press MB3 over the breakpoint item in the Breakpoint View.

4.4.6 Setting and Modifying an Action Breakpoint

When an action breakpoint triggers, the debugger suspends execution and then executes a specified list of commands.

To set an action breakpoint:

  1. Display the source or instruction line on which you want to set the action breakpoint (see Section 4.1).

  2. Display the Set/Modify Breakpoint dialog box in one of the following ways:

  3. Enter one or more debugger commands in the Action: field of the dialog box. For example: assign x[j]=3; step; print a;

  4. Click on OK. The action breakpoint is now set (see Figure 4-8).

Figure 4-8 Setting an Action Breakpoint

The following procedure modifies an action breakpoint; that is, it can be used to change the command associated with an existing action breakpoint, or to change an unqualified breakpoint into an action breakpoint:

  1. Do one of the following:

  2. Enter one or more debugger commands in the Action: field of the dialog box. For example: assign x[j]=3; step; print a;

  3. Click on OK. The action breakpoint is now modified.

4.5 Examining and Manipulating Variables

This section explains how to:

4.5.1 Available Options

Table 4-1 describes options available for selecting and changing variables and values.

Table 4-1 Available Options for Selecting and Changing Variables and Values

Option  Attributes 
Local Variables View 

  • Local variables monitored automatically by debugger. You do not have to select names as with the Print button or Monitor View.

  • Cannot monitor global variables.

  • Can expand aggregates into their components.

  • Can assign new values directly in the Local Variables View.
 
Print button 

  • Must select a variable name.

  • Can display values of global names or local variables.

  • Must select name and press the Print button each time you want to see the updated value.

  • Shows output of the debugger in the Command Message View.
 
Monitor View 

  • Must select a variable name.

  • Can monitor global or local variables (when selected local variables are active).

  • Shows output in the Monitor View.

  • Can expand aggregates into their components.

  • Can assign new values directly in the Monitor View.
 
Print Dialog Box  Allows for typecasting. 
Assign Dialog Box  Allows for typecasting. 

4.5.2 Selecting Variable Names from Windows

Use the following techniques to select variable names from windows.

When selecting names, follow the syntax of the source programming language:

Select character strings from windows in one of the following ways:

4.5.3 Displaying the Current Value of a Variable

You can display the current value of a variable or expression as described in Table 4-1.

The following sections describe these methods.

4.5.3.1 Using the Local Variables View

In the Local Variables View, you can monitor the values of all local variables and parameters passed to a routine, as shown in Figure 4-9.

Figure 4-9 Local Variables View

The debugger automatically displays these values. It checks and updates them whenever the debugger regains control from your program (for example, after a step or at a breakpoint).

To monitor a local variable or parameter using the Local Variables View, select Views:Local Variables View or select Views:Manage Views and toggle the Local Variables View button on the Main or Optional Views Window.

The debugger automatically lists all local variable and parameter names (in the Monitor Expression column) and current values (in the Value/Assign column).

You cannot add or remove an entry to the local variables and parameters list. The debugger automatically removes previous entries and adds new entries when a new routine appears at the top of the Call Stack.

To monitor a global variable, use the Monitor View (see Section 4.5.3.3). Section 4.5.3.3 also explains how to monitor an aggregate variable and a pointer variable. The technique is the same whether you use the Monitor View or the Local Variables View.

4.5.3.2 Using the Print Button

To display the current value of a variable using the Print button:

  1. Find and select the variable name or expression in a window, as explained in Section 4.5.2.

  2. Click on the Print button on the push-button panel of the Main Window. The debugger displays the variable or expression and its current value in the Command Message View. (This is the value of the variable or expression in the current scope, which might not be the same as the source location where you selected the variable name or expression.)

4.5.3.3 Using the Monitor View

When you monitor a variable, the debugger displays the value in the Monitor View and automatically checks and updates the displayed value whenever the debugger regains control from your program (for example, after a step or at a breakpoint).

To monitor a variable or expression with the Monitor View:

  1. Choose Views:Monitor View or Views:Manage Views... and toggle the Monitor View button. The Monitor View appears in the Optional Views Window (see Figure 4-10).

  2. Find and select the variable name in a window, as explained in Section 4.5.2.

  3. Click on the Monitor push button on the push-button panel of the Main Window. The debugger does the following:

    1. Puts the selected variable name or expression in the Monitor Expression column

    2. Puts the current value of the variable in the Value /Assign column or, if the variable is an aggregate, displays the full type name of the aggregate.

Figure 4-10 Monitoring a Variable

4.5.3.3.1 Monitoring an Aggregate (Array, Structure) Variable

If you select the name of an aggregate variable such as an array or structure (record) and click on the Monitor push button, the debugger displays the full type name of the aggregate in the Value /Assign column of the Monitor View. To display the values of all elements (components) of an aggregate variable, double click on the variable name in the Monitor Expression column.

The displayed element names are indented relative to the parent name (see Figure 4-11). If an element is also an aggregate, you can double click on its name to display its elements.

Figure 4-11 Expanded Aggregate Variable (Array) in Monitor View

To collapse an expanded display so that only the aggregate parent name is shown in the Monitor View, double click on the name in the Monitor Expression column.

If you have selected a component of an aggregate variable, and the component expression is itself a variable, the debugger monitors the component that was active when you made the selection. For example, if you select the array component arr[i] and the current value of i is 9, the debugger monitors arr[9] even if the value of i subsequently changes to 10.

If the aggregate is a local variable, you can also use the Local Variables View to monitor the aggregate.

4.5.3.3.2 Monitoring a Pointer (Access) Variable

If you select the name of a pointer (access) variable and click on the Monitor push button, the debugger displays the address and value of the referenced object in the Value/Assign column of the Monitor View (see Figure 4-12).

If a referenced object is an aggregate, you can double click on its name to display its elements.

If the pointer is local, you can also use the Local Variables View to monitor the pointer.

Figure 4-12 Pointer Variable and Referenced Object in Monitor View

4.5.3.4 Using the Print Dialog Box

The Print dialog box allows you to request typecasting or an altered output radix in the displayed result.

To display the current value with the Print dialog box, select the variable or expression using the method described in Section 4.5.2 and click on Print or:

  1. Choose Commands:Print... on the Main Window. The Print dialog box appears.

  2. Enter the variable name or expression in the Variable /Expression entry box.

  3. If you are changing the output type, pull down the menu in the Typecast entry box and click on the desired data type.

  4. If you are changing the output radix, pull down the menu in the Output Radix entry box and click on the desired radix.

  5. Click on OK.

The debugger displays the variable or expression and its current value in the Command Message View.

Your echoed command and the current value appear in the Command Message View.

Figure 4-13 shows a typecast to int for the variable length.

Figure 4-13 Typecasting the Value of a Variable

The debugger displays your echoed command and the variable or expression and its current value in the Command Message View.

4.5.4 Changing the Current Value of a Variable

You can change the value of a variable with either of the following methods:

4.5.4.1 Clicking on a Monitored Value Within the Local Variables View or Monitor View

To change a value monitored within the Local Variables View or Monitor View (see Figure 4-14):

  1. Select the variable as explained in Section 4.5.2.

  2. Click on the variable's value in the Value/Assign column of the Local Variable View or Monitor View. A small text edit box appears over that value, which you can now edit.

  3. Enter the new value in the text edit box.

  4. Click on the check mark (OK) in the text edit box. The text edit box is removed and replaced by the new value, which indicates that the variable now has that value. The debugger notifies you if you try to enter a value that is incompatible with the variable's type and range.

Figure 4-14 Changing the Value of a Monitored Variable

To cancel a text entry and dismiss the text edit box, click on X (Cancel).

You can change the value of only one component of an aggregate variable at a time (such as an array or structure). To change the value of an aggregate variable component (see Figure 4-15):

  1. Display the value of the component as explained in Section 4.5.3.3.1.

  2. Follow the procedure for changing the value of a scalar variable.

Figure 4-15 Changing the Value of a Component of an Aggregate Variable

4.5.4.2 Changing the Value of a Variable with the Assign Dialog Box

To change the value of a variable with the Assign dialog box:

  1. Select the variable as explained in Section 4.5.2.

  2. Choose Commands:Assign... on the Main window. The Assign dialog box appears.

  3. Enter the variable name and new value in the Variable and Value entry boxes.

  4. If you are changing the input radix, pull down the menu in the Input Radix entry box and click on the desired radix.

  5. Click on OK.

Figure 4-16 shows a new value and input radix for the variable prime.

You can also display the Assign dialog box by clicking MB3 in the source pane and selecting Assign from the pop-up menu.

Figure 4-16 Changing the Value of a Variable

4.6 Accessing Program Variables

This section provides some general information about accessing program variables while debugging.

If your program was optimized during compilation, you might not have access to certain variables while debugging. When you compile a program for debugging, it is best to disable optimization if possible (see Section 1.4).

Before you check on the value of a variable, always execute the program beyond the point where the variable is declared and initialized. The value contained in any uninitialized variable should be considered invalid.

In most cases, the debugger resolves symbol ambiguities automatically, using the scope and visibility rules of the source programming language. For more information about resolving symbol ambiguities, see Chapter 8.

4.6.1 Setting the Current Scope Relative to the Call Stack

While debugging a routine in your program, you might want to set the current scope to a calling routine (a routine down the stack from the routine in which execution is currently paused). This enables you to:

The Call Stack menu, shown in Figure 4-17 lists the names of the routines of your program that are currently active on the stack, up to the maximum number of lines that can be displayed on your screen.

Figure 4-17 Current Scope Set to a Calling Routine

The numbers on the left side of the menu indicate the level of each routine on the stack relative to level 0, which denotes the routine in which execution is paused.

To set the current scope to a particular routine on the stack, choose the routine's name from the Call Stack menu; for example, 1:trycol in Figure 4-17. This causes the following to occur:

When you set the scope to a calling routine, the current-location pointer (which is cleared) marks the source line to which execution will return in that routine. Depending on the source language and coding style used, this might be the line that contains the call statement or some subsequent line.

4.6.2 How the Debugger Searches for Variables and Other Symbols

Symbol ambiguities can occur when a symbol is defined in more than one routine or other program unit.

In most cases, the debugger automatically resolves symbol ambiguities. First, it uses the scope and visibility rules of the currently set language. The debugger uses the ordering of routine calls on the call stack to resolve symbol ambiguities.

In some cases, however, the debugger might respond as follows when you specify a symbol that is defined multiple times:

To resolve such problems, you must specify a scope where the debugger searches for the declaration of the symbol you want:

4.7 Displaying and Modifying Values Stored in Registers

The Register View displays the current contents of all machine registers (see Figure 2-7).

To display the Register View, choose Views:Register View or Views:Manage Views... and toggle the Register View button. The Register View appears in the Optional Views Window.

By default, the Register View automatically displays the register values associated with the routine in which execution is currently paused. Any values that change as your program executes are highlighted whenever the debugger regains control from your program.

To display the register values associated with any routine on the call stack, choose its name from the Call Stack menu on the Main Window (see Section 4.6.1).

To change the value stored in a register:

  1. Click on the register value in the Register View. A text edit box appears over the current value, which you can now edit.

  2. Enter the new value in the text edit box.

  3. Click on the check mark (OK) in the text edit box, as shown in Figure 4-18.

Figure 4-18 Changing a Value in the Register View

The text edit box is removed and replaced by the new value, indicating that the register now contains that value.

To cancel a text entry and dismiss the text edit box, click on X (Cancel).

You can also change the radix for modifying values stored in a register as follows:

  1. Position your mouse pointer in the Register View and press MB3. A pop-up menu appears.

  2. Select Change Radix-> and choose from a list of radix choices for modifying values.

4.8 Displaying the Decoded Instruction Stream of Your Program

The Instruction View displays the decoded instruction stream of your program: the code that is actually executing (see Figure 4-19). This is useful if the program you are debugging has been optimized by the compiler. This means that the information in the Main Window does not exactly reflect the code that is executing (see Section 1.4).

To display the Instruction View, choose Views:Instruction View or Views:Manage Views... and toggle the Instruction View button on the Main or Optional Views Window.

By default, the Instruction View automatically displays the decoded instruction stream of the routine in which execution is currently paused. The current location pointer (to the left of the instructions) marks the instruction that will execute next.

By default, the debugger displays line numbers to the left of the instructions with which they are associated. You can choose not to display these line numbers so that more space is devoted to showing instructions. To hide or display line numbers, choose File:Show Instruction Addresses on the Instruction View.

To copy memory addresses or instructions into a command you are entering at the command-entry prompt, select text and choose Edit:Copy in the Instruction View. Then position your mouse pointer at the command you have entered and choose Edit:Paste on the Main Window. (You can also select instruction text to be used with a push-button command you click in the push-button panel of the Main Window.)

To set breakpoints from the Instruction View, toggle the breakpoint button next to the instruction of interest. The breakpoint is set in the source display, instruction display (if the Instruction View is open), and Breakpoint View (if the Breakpoint View is open). Information on the breakpoint is continuously updated in the source display, and in the Instruction View and Breakpoint View if they are open.

You can also set breakpoints and change breakpoint status by pulling down the Break menu from the Optional Views Window.

After navigating through the Instruction View, to redisplay the location at which execution is paused, click on the Call Stack menu.

To display the instruction stream of any routine on the call stack, choose the routine's name from the Call Stack menu on the Main Window (see Section 4.6.1).

Figure 4-19 Instruction View

4.9 Customizing the Debugger's Window Interface

You can customize the debugger's window interface in two ways:

Table 4-2 shows the methods you use to customize parameters.

Table 4-2 Customization Methods

Use This Method  To Change These Parameters 
Customize... dialog box 

  • Modify, add, remove, or resequence push buttons and the associated debugger command.
 
Edit debugger (ladebugresource) resource file  

  • Define the key sequence to display the dialog box for conditional and action breakpoints.

  • Define the key sequence to make text selection language- sensitive in the Main Window.

  • Define the character font for text displayed in specific windows and views.

  • Define or redefine the commands bound to individual keys on your computer's keypad.

  • Shut off the Exit Confirmation dialog box.

  • Shut off debugger command echo in the Command Message View for commands being sent to the engine.

  • Set the initial breakpoint toggle in the Run New Program dialog box to off.
 

The following sections discuss using these methods to customize the debugger window interface.

4.9.1 Defining the Startup Configuration for Debugger Windows and Views

To define the startup configuration of the debugger windows and views:

  1. While using the debugger, set up the desired configuration of the windows and views.

  2. Choose Options:Save Options on the Main or Optional Views Window. This creates a new version of the debugger resource file with the new settings.

When you later start the debugger, the new configuration appears automatically. Adding views to the startup configuration increases the startup time accordingly.

4.9.2 Displaying or Hiding Line Numbers by Default

The source pane displays source line numbers by default at debugger startup. To hide (or display) line numbers at debugger startup:

  1. While using the debugger, choose File:Display Line Numbers on the Main Window. Line numbers are displayed when a filled-in button appears next to that menu item.

  2. Choose Options:Save Options. This creates a new version of the debugger resource file with the new settings.

When you later start the debugger, line numbers are either displayed or hidden accordingly.

4.9.3 Modifying, Adding, Removing, and Resequencing Push Buttons

The push buttons on the push-button panel are associated with debugger commands. You can:


Note
You cannot modify or remove the Interrupt push button.

To save these modifications for subsequent debugger sessions, choose Options:Save Options on the Main Window or an optional view. This creates a new version of the debugger resource file with the new definitions.

The following sections explain how to customize push buttons interactively through the window interface. You can also customize push buttons by editing the resource file (see Section 4.9.4).

4.9.3.1 Changing a Button's Label or Associated Command

To change a button's label or the debugger command associated with a push button:

  1. Choose Options:Customize... on the Main or Optional View Window. The Customize dialog box appears.

  2. Select the Pushbuttons menu option. The Pushbuttons dialog box appears.

  3. Click on the push button in the control panel of the dialog box.

  4. If changing the push-button label, enter a new label in the Label field or choose a predefined icon from the Icon menu. (If changing the button label, verify that the Icon menu is set to None.)

  5. If changing the command associated with the push button, enter the new command in the Command field. For online help about the commands, see Section 2.5.2.

    If the command is to operate on a name or language expression selected in a window, include %s in the command name. For example, the following command displays the current value of the variable that is currently selected:

    print %s
    

    If the command is to operate on a name that has a percent sign (%) as the first character, specify two percent signs.

  6. Click on Modify. The push button is modified in the dialog box push-button display.

  7. Click on Apply. The push button is modified in the push-button panel of the Main Window (see Figure 4-20).

Figure 4-20 Changing the Step Button Label to an Icon

4.9.3.2 Adding a New Button and Associated Command

To add a new button to the push-button panel and assign a debugger command to that push button:

  1. Choose Options:Customize... on the Main Window. The Customize dialog box appears (see Figure 4-21).

  2. Select the Pushbuttons menu option and the Pushbuttons dialog box appears.

  3. Enter the debugger command for that push button in the Command field (see Section 4.9.3.1). The command up was chosen. This command interprets an entity selected in a window as a zero-terminated ASCII string.

  4. Enter a label for that push button in the Label field or choose a predefined icon from the Icon menu. The uparrow_pixmap label was chosen.

  5. Click on Add. The push button is added to the control panel within the dialog box.

  6. Click on OK. The push button is added to the push- button panel in the Main Window (see Figure 4-21).

Figure 4-21 Adding a Button for the up Command

4.9.3.3 Removing a Button

To remove a push button:

  1. Choose Options:Customize... on the Main Window. The Customize dialog box appears.

  2. Select the Pushbuttons menu option and the Pushbuttons dialog box appears.

  3. Click on the push button in the control panel of the Customize dialog box.

  4. Click on Remove. The push button is removed from the control panel within the dialog box.

  5. Click on OK. The push button is removed from the push- button panel in the Main Window.

4.9.3.4 Resequencing a Button

To resequence a button:

  1. Choose Options:Customize... on the Main Window. The Customize dialog box appears.

  2. Select the Pushbuttons menu option and the Pushbuttons dialog box appears.

  3. Click on the button you are resequencing. This fills the Command and Label fields with the parameters for that button.

  4. Click on the left or right arrow to move the button one position to the left or right. Continue to click until the button has moved, one position at a time, to its final position.

  5. Click on OK to transfer this position to the push-button panel in the Main Window.

4.9.4 Customizing the Debugger Resource File

The debugger is installed on your system with a debugger resource file (ladebugresource) that defines startup defaults.

When you first choose Options:Save Options on the Main or Optional Views Window, the debugger creates your own local debugger resource file in your home directory.

When you subsequently start the debugger, it uses the settings defined in your local resource file (such as window configuration) and uses the system default resource file for the other settings (such as character fonts). Whenever you choose Save Window Configuration, a new version of your local resource file is created.

Using the system default file as reference, you can add customized resource settings to your own local file. When you subsequently choose Options:Save Options, the debugger automatically copies these added settings to the new version of your local file.