f78
Contents|Previous|Next

Interface for GDBtk 

 
This documentation outlines the functions of the GDBTk user interface. 
When GDBTk first opens, it displays the Source Window. The other windows that are invoked from the Source Window, through View menu selections or tool bar buttons have documentation in the order that they appear in the Source Window's View menu. The Help window, for instance, is invoked from the Source Window's Help menu.
The documentation discusses what occurs during an actual debugging session, after running the executable up to a single breakpoint set in 'main.c' of our example executable program.

Source Window

When GDBTk first opens, it displays the Source Window ffb (see Source Window).
The following documentation describes the Source Window attributes and its correlating functionality.

Figure 1:  Source Window

     

Menu bar for the Source Window

There are six menu item selections: File, Run, View, Control, Preferences and Help.
The following documentation discusses the Source Window menus.

File

Figure 2:  File menu

Run 

Figure 3:  Run menu

View

Figure 4:  View menu

Control 

Figure 5:  Control menu

Preferences 

    Figure 6:  Preferences menu

Help 

Figure 7:  Help menu

Toolbar buttons 

Run / Stop

Figure 8:  Run button
Figure 9:  Stop button

Step

Figure 10:  Step button

Next

Figure 11:  Next button

Finish

Figure 12:  Finish button

Continue

Figure 13:  Continue button

Step assembler instruction

Figure 14:  Step assembler instruction button

ffb Next assembler instruction

Figure 15:  Next assembler instruction button

Registers

Figure 16:  Registers button

Memory

Figure 17:  Memory button

Stack

Figure 18:  Stack button

Watch Expressions

Figure 19:  Watch Expressions button

Local Variables

Figure 20:  Local Variables button

Breakpoints

Figure 21:  Breakpoints button

Console

Figure 22:  Console button

Line address / Line number display 

Figure 23:  Program counter display frame and line number display frame

Down stack frame

Figure 24:  Down stackframe button

Up stack frame

Figure 25:  Up stackframe button

Go to bottom of stack

 Figure 26:  Go to bottom of stackframe button

Special display pane features

The following discussion details some special features to the display panes.

Using the mouse in the display pane

There are various uses of the mouse within the main display pane of the Source Window. The display pane is divided into two columns, as shown in Figure 27: Using the mouse in the window. The left column extends from the left edge of the display pane to the last character of the line number. The right column extends from the last character of the line number to the right edge of the display pane. Within each column, the mouse has a different set of effects.
Figure 27:  Using the mouse in the window 
         Left display column          |         Right display column 


Right display column

Figure 28:  Pop-up window for expressions
    Add lis to Watch
      Brings up the Watch Expressions window and adds a variable expression (the 'lis' variable, in this instance) to the list of expressions in the window.

Left display column

      When the cursor is in the left column and it is over an executable line (marked on the far left by a minus sign), it changes into a circle. When the cursor is in this state, events have the following results:
    Continue to here
      This causes the program to run up to this location, ignoring any breakpoints. Like the temporary breakpoint, this menu selection is displayed as an orange square. This selection disables all other breakpoints. When a breakpoint has been disabled, it turns from red or orange to black.
      The debugger might be expected to execute to a given location, stopping at all encountered breakpoints. This menu item currently forces execution to this location without stopping at any encountered breakpoints.
    Set breakpoint here
      This sets a breakpoint on the current executable line. This has the same action as left clicking on the minus sign.
Figure 30: Pop-up menu for deleting breakpoints
    Delete Breakpoint
      This deletes the breakpoint on the current executable line. This has the same action as left clicking on the red square.

Below the horizontal scroll bar

There are four display and selection fields below the horizontal scroll bar: the status text box, the drop-down list box, the function drop-down combo box and the code display drop-down list box
Figure 31: Status text box
In the area immediately below the scroll bar, a text box displays the current status of the debugger (in the status box for the window depicted in Figure 31: Status text box, the message reads "GDB running on process -458363" for current status.
Figure 32: Drop-down list box
     
The drop-down list box displays all the source (.c) and header (.h) files associated with the executable. Files may be selected by clicking in the list box, or by typing into the text field above the list. The drop-down list box displays all the functions in the currently selected source or header file. A function may be selected by clicking in the list box, or by typing into the text field above. For the function drop-down combo box, the ‘main.c’ file only contains the one ‘main’ function.
Figure 33: Function drop-down combo box
Figure 34: Code display drop-down list box
Select how the code in the Source Window is displayed, as shown with the selectable formats in Figure 34: Code display drop-down list box.
    SOURCE
      The source code is displayed in the Source Window.
    ASSEMBLY
      The assembly code is displayed in the Source Window.
    MIXED
      The source code and the assembly code are both displayed, interspersed in the Source Window.
    SRC+ASM
      The source code and the assembly code are both displayed in a double paned window. The source code is displayed in the Source Window and, in a pane below the source code pane, the assembly code is displayed.

Dialog boxes for the Source Window 

The following documentation describes the dialog boxes that are invoked from the Source Window, through the File and Preferences menu selections.

Load New Executable dialog box for the Source Window

The Load New Executable dialog box, as shown in Load New Executable dialog box window, is invoked by clicking the Open menu item in the file drop-down menu of the Source Window. This dialog box allows you to navigate through directories and select an executable file to be opened in the Source Window.
Figure 35: Load New Executable dialog box window

Page Setup dialog box for the Source Window

The Page Setup dialog box, as shown in Page Setup dialog box window, is invoked by clicking the Page Setup menu item in the File drop-down menu for the Source Window. This standard dialog box allows you to make page layout selections before printing a source file.
Figure 36: Page Setup dialog box window

Print dialog box for the Source Window

ThePrint dialog box window is invoked by clicking the Print Source menu item in the File drop-down menu of the Source Window. This dialog box allows you to select a printer and make other print specific selections, before printing a source file. 
Figure 37: Print dialog box window

Target selection from the Source Window

The Target Selection dialog box is invoked by clicking the Target Settings menu item in the File drop-down menu of the Source Window. This dialog box allows you to select the target you wish to run the executable on, and make other run-specific selections.
Figure 38: Target Selection dialog box window
     
    Connection
      The Connection group contains the target drop-down list box for target selection and two other fields for setting target-specific parameters.
    Target
      The contents of this list box depend upon the specific GDB debugger configuration you have received. For a native configuration, the list contains Exec (for native execution), Remote/Serial (serial connection to a remote target) and Remote/TCP (TCP connection to a remote target).
      If GDB has been configured to include a specific hardware simulator, the target Exec will be replaced by target, sim. The names of specific hardware targets may also be included in the list, with serial, TCP or both methods of connection, depending upon the hardware.
    Baud Rate/Hostname
      When a serial connection to a remote target is selected the baud rate may be set. When a TCP connection to a remote target is selected, this list box turns into a text edit field, renamed "Hostname," allowing for specifying of a host name.
    Port
      For both serial and TCP connections to remote targets, the port must be de ffb signated. For serial connection, port specifies the serial port on the host machine. For TCP connections, port specifies the port number on the remote target.
    Run until 'main'
      Set a breakpoint at main and run until that breakpoint is reached. This is checked by default.
    Set breakpoint at 'exit'

    Set a breakpoint at the call to the 'exit' routine. This is checked by default.

    Display Download Dialog

      In addition to using the status-bar, display more extensive download status information in a dialog box. This is particularly useful when doing a serial download to a remote target. This is unchecked by default.
    More Options / Fewer Options

    Toggles to display or hide the Run Options at the bottom of the dialog box, as shown in Target Selection window's Run Options features.
Figure 39: Target Selection window's Run Options features
     
    Run Options
      The four check boxes in this group set-up the actions taken, when the Run button is clicked.
    Attach to Target
      Connects to a remote target.
    Download Program
      Downloads an executable to a remote target.
    Continue from Last Stop
      Continues execution from wherever the executable, on a remote target, left off.
    Run Program
      Begins execution of an executable.

Global Preferences dialog box for the Source window

The Global Preferences dialog box, as shown in Global Preferences dialog box window, is invoked by clicking the Global menu item in the Preferences drop-down menu of the Source Window. This dialog box allows you to select the font and the type size, for displaying text.
Figure 40: Global Preferences dialog box window
    Figure 41: Windows-style icon set
    Figure 42: Basic icon set
    Fonts
      The fields in this group allow for custom selection of font family and size.
    Fixed Font
      This drop-down list box allows you to select the font for the source code display panes
    Default Font
      This drop-down list box allows you to select the font for use in list boxes, buttons and other controls.
    Status bar Font
      This drop-down list box allows you to select the font for the statusbar.

Source Preferences dialog box for the Source window

The Source Preferences dialog box, as shown in Source Preferences dialog box, is invoked by clicking the Source menu item in the Preferences drop-down menu of the Source Window.
Figure 43: Source Preferences dialog box
    Colors
      Single left-clicking any of the colored squares opens the Choose color dialog box. The Choose color dialog box allows the display colors to be modified by the user.
    Debug Mode
      Unless GDB has been configured to enable the setting of tracepoints, this radio button has no effect.
    Variable Balloons
      If Variable Balloons is on, a balloon appears displaying the value of a variable, when the mouse is placed over the variable in the Source Window. The default is on.

Stack window

The Stack window displays the current state of the call Stack, as shown by Stack window, where each line represents a stack frame.
Figure 44: Stack window
Clicking a frame selects that frame, indicated by the background of the frame turning yellow, as shown in Clicking a stack frame. The Source Window automatically updates to display the line, corresponding to the selected frame. If the frame points to an assembly instruction, the Source Window changes to display assembly code. The background of the corresponding line in the Source Window also changes to yellow.
Figure 45: Clicking a stack frame

Registers window

The  Registers window dynamically displays the registers and their content. The documentation for Register menu for the Register window discusses changing the properties of registers.
Figure 46: Registers window
        • A single left click on a register will select it. 
        • A double click on a register allows the content of the register to be edited. 
Hitting the escape key (Esc) will abort the editing.

Register menu for the Register window

Figure 47: Register menu
    Edit
      This menu item has the same effect as double clicking a register. The content of the selected register may be changed. This menu item is only active when a register has been selected.
    Format
      This menu item calls another pop-up menu, as shown in Register format menu, allowing the content of the selected r ffb egister to be displayed in Hexadecimal, Decimal, Natural, Binary, Octal, and Raw formats.
    Remove from Display
      This menu item removes the selected register from the window. All registers are displayed if the window is closed and reopened. This menu item is only active when a register has been selected.
    Display All Registers
      This menu item displays all the registers. This menu item is only active when one or more registers have been removed from display.
Figure 48: Register format menu
     
Hexadecimal (Hex) is the default display format.
    Remove from Display
      This menu item removes the selected register from the window. All registers are displayed if the window is closed and reopened. This menu item is only active when a register has been selected.
    Display All Registers
      This menu item displays all the registers. This menu item is only active when one or more registers have been removed from display.

Memory window

The Memory window, as shown in Memory window, dynamically displays the state of memory. 
Figure 49: Memory window
     
A memory location can be selected by double clicking the left mouse button with the cursor in the window. The contents of a selected memory location can be edited.
Address menu for the Memory window shows the Address menu.

Address menu for the Memory window

Figure 50: Address menu for the Memory window
    Auto Update
      The contents of the Memory window are automatically updated whenever the target's state changes. T ffb his is the default setting.
    Update Now
      Forces the immediate update of the Memory window's view of the target's memory.
    Preferences
      This menu item brings up the Memory Preferences dialog box.

Memory Preferences dialog box for the Memory window

The Memory Preferences dialog box for the Memory window makes it possible to set memory options. 
Figure 51: Memory Preferences dialog box for the Memory window
    Size
      Selection of the size of the individual cells displayed.
    Format
      Selection of the format of the memory display.
    Number of Bytes
      Sets the number of bytes displayed in the Memory window.
    Bytes Per Row
      Sets the number of bytes displayed per row.
    Display ASCII
      Choose to display a string representation of the memory. 
    Control Char
      Choose the character used to display non-ASCII characters. The default character is the period.

Watch Expressions window

The Watch Expressions window displays the name and current value of user-specified expressions.
Figure 52: Watch Expressions window
      • Single clicking on an expression selects that expression. 
      • Right clicking in the display pane, while an expression is selected, calls an expression-specific Watch menu, as shown and described with Watch menu in t ffb he Watch Expressions window.
Figure 53: Watch menu in the Watch Expressions window
Figure 54: Watch menu for the Watch Expressions window
    Edit
      Allows the value in the expression to be edited.
      Hitting the escape key (Esc) will abort the editing. 
    Format
Figure 55: Value formats for the Watch Expressions window
By default, pointers are displayed in hexadecimal and all other expressions are displayed as decimal.
    Remove
      Removes the selected expression from the watch list.

Add Watch button for the Watch Expressions window

An expression can be typed into the text edit field at the bottom of the dialog box, as shown in the screen on the left in Using the Add Watch button for the Watch Expressions window. By pressing the Add Watch button or hitting the Enter key, the expression is added to the list, as shown in the resulting addition to the window on the right in Using the Add Watch button for the Watch Expressions window. Invalid expressions are ignored. 
Figure 56 : Using the Add Watch button for the Watch Expressions window
 

Watch ffb ing registers with the Watch Expressions window

GDB allows registers to be added to the Watch Expressions window, by typing register convenience variables into the text edit field. Every register has a corresponding convenience variable. The register convenience variables consist of a dollar sign followed by the register name. The convenience variable for the program counter is $pc, for example. The convenience variable for the frame pointer is $fp.

Casting pointers in the Watch Expressions window

Pointer values may be cast to other types and watched, represented as the type to which the pointer was cast. For example, by typing "(struct _foo *) bar" in the text edit field, the bar pointer is cast as a struct _foo pointer.

Local Variables window

The Local Variables window displays the current value of all local variables. 
Figure 57: Local Variables window
      • Single clicking the mouse with the cursor over a variable selects the variable.
      • Double clicking the mouse with the cursor in the Local Variables window puts the variable into edit mode.
      • Single clicking the mouse with the cursor on the plus sign to the left of a structure variable displays the elements of that structure. Compare the variable structure in the window in Local Variables window with the results in Displaying the elements of a variable structure.
      • Single clicking the mouse with the cursor on the minus sign to the left of an open structure closes the display of the structure elements.
Figure 58: Displaying the elements of a variable structure 

Variable menu for the Local Variables window

Figure 59: Variable menu for the Local Variables window
    Edit
      Allows the value of a selected variable to be edited.
      Hitting the Escape key (Esc) will abor ffb t the editing.
    Format
      This menu item brings up another pop-up menu, as shown in Variable format menu, allowing the value of the selected variable to be displayed in the Hexadecimal, Decimal, Binary and Octal formats.
Figure 60: Variable format menu
By default, pointers are displayed in hexadecimal and all other expressions are displayed as decimal.

Breakpoints window

The Breakpoints window displays all breakpoints that are currently set. 
Figure 61: Breakpoints window
      • Single clicking with the mouse with the cursor over a check-box for the information displayed for a breakpoint selects that breakpoint.
      • Single clicking with the mouse with the cursor over a checked check box of a breakpoint disables the breakpoint. The check disappears and the red square in the Source Window turns black.
      • Single clicking with the mouse with the cursor over an empty check box of a disabled breakpoint re-enables the breakpoint. The check reappears and the black square in the Source Window turns red.

Breakpoint menu for the Breakpoints window

Figure 62: Breakpoint menu for the Breakpoints window
    Normal
    Temporary
      This pair of menu items toggles between the normal and temporary setting of the selected breakpoint. A normal breakpoint remains valid no matter how many times it is hit. A temporary breakpoint is removed automatically the first time it is hit. A single check mark for either setting shows the state of the selected breakpoint.
Figure 63: Results of setting breakpoints
    Enabled
    Disabled
      This pair of menu items toggles the enabled or disabled state of the selected breakpoint. The single check mark between them shows the state of the selected breakpoint.
    Remove
      This menu item removes the selected breakpoint.

Global menu for the Breakpoints window

Figure 64: Global menu for the Breakpoints window
    Disable All
      Disables all breakpoints.
    Enable All
      Enables all breakpoints.
    Remove All
      Removes all breakpoints.

Console window

The Console window  contains the command prompt for GDB, the GNUPro debugger, allowing access to the debugger through the command-line interface. (gdb) is the prompt for the debugger.
Figure 56: Console window

Help window

The Help window is invoked by clicking the Help Topics menu selection in the Help drop-down menu of the Source Window. The Help window offers HTML based navigable help by topic.
Figure 66: Help window
See also the discussions for File menu for the Help window an a32 d Topics menu for the Help window.

File menu for the Help window

Figure 67: File menu for the Help window
    Back
      Moves back one HTML help page, relative to previous forward page movements.
    Forward
      Moves forward one HTML help page, relative to previous back page movement.
    Home
      Returns to the HTML help "Table of Contents" home page.
    Close
      Closes the Help window.

Topics menu for the Help window

Selecting a menu item invokes the Help topic's contents, as shown in Topics menu for the Help window.
Figurer 68: Topics menu for the Help window
Each menu item represents a help topic. When a menu item is selected, the content of the Help window changes to reflect the listed topic.
0