f78
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.
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
Closes the GDBTk program.
Run
Download
Downloads a program to a board (if connected).
Runs the executable program.
View
Control
Step
Steps to next executable line of source code. Steps into
called functions.
Steps to next executable line of source code in current
file. Steps over called functions.
Finishes execution of the current frame. If clicked while
in a function, it finishes the function and returns to the line that called
the function.
Continues execution until a breakpoint, watchpoint or
other exception is encountered; or execution is complete.
Steps to next assembler instruction. Steps into subroutines.
Steps to next assembler instruction. Executes subroutines
and steps to the subsequent instruction.
Preferences
Help
Links to the GNUPro Tools
web page.
Displays About GDBTk
window, containing product version number, copyright and Cygnus contact
information.
Toolbar
buttons
Run / Stop
The Run
button runs the executable. During execution the button turns into the
Stop button. If you click on the Run
button with no executable loaded, you invoke the Target
Selection dialog box. See Target
selection from the Source Window.
The Stop button will interrupt
the program, provided that the underlying hardware and protocol support
such interruptions. Many monitors that are connected to boards cannot interrupt
programs on those boards, so the Stop button has no functionality.
Step
Steps to next executable line
of source code. Steps into called functions.
Next
Steps to next executable line
of source code in the current file. Steps over called functions.
Finish
Finishes execution of the
current frame.
If clicked while in a function,
it finishes the function and returns to the line that called the function.
Continue
Continues execution until
a breakpoint, watchpoint or other exception is encountered; or execution
is complete.
Step assembler
instruction
Invokes Step
assembler instruction. Steps into
subroutines.
ffb
Next assembler
instruction
Steps to Next
assembler instruction. Executes
subroutines and steps to the following instruction.
Registers
Memory
Stack
Watch Expressions
Local Variables
Breakpoints
Console
The Console
button brings up the Console
window, which features a command line interface to GDB, the GNUPro
debugger.
Line address /
Line number display
The left-hand read-only frame
displays the program counter (pc) of the
current frame, while the program is running.
The right-hand read-only frame
displays the line number, which contains the pc,
while the program is running.
Down stack frame
Moves down the stack frame
one level.
Up stack frame
Moves up the stack frame one
level.
Go to bottom of
stack
Moves to the bottom of the
stack frame.
Special display pane features
The following
discussion details some special features to the display
panes.
-
When the executable is running,
the location of the current program counter is displayed as a line with
a green background
-
When the executable has finished
running, the background color changes to violet (browsing mode).
-
When looking at a stack backtrace,
the background color changes to golden yellow
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.
Left display column
| Right display column
Right
display column
-
By holding the cursor over a global
or local variable, the current value of that variable is displayed.
-
By holding the cursor over a pointer
to a structure or class, the type of structure or class is displayed and
the address of the structure or class is displayed.
-
By double clicking an expression,
it is selected.
-
By right clicking while an expression
is selected, a pop-up menu appears. The selected expression appears in
both menu selections. In Figure
28: Pop-up window for expressions, the selected variable was the 'lis'expression.
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.
Brings up the Memory
window, which displays a memory dump at an expression, in this instance,
the 'lis'expression.
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:
-
A
left click sets a breakpoint at the current line. The breakpoint appears
as a red square in place of the minus sign.
-
A left click on any existing breakpoint
or temporary breakpoint removes that breakpoint.
-
A right click brings up another
pop-up menu for setting breakpoints.
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.
Set
temporary breakpoint here
This sets a temporary breakpoint on the current executable
line. A temporary breakpoint is displayed as an orange square. The temporary
breakpoint is automatically removed when it is hit.
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.
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.
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
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.
The assembly code is displayed in the Source
Window.
The source code and the assembly code are both displayed,
interspersed in the Source Window.
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.
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.
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.
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.
Connection
The Connection group
contains the target drop-down list box for target selection and two other
fields for setting target-specific parameters.
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.
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.
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.
Set a breakpoint at main
and run until that breakpoint is reached. This is checked by default.
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.
Run
Options
The four check boxes in this group set-up the actions
taken, when the Run button is clicked.
Connects to a remote target.
Downloads an executable to a remote target.
Continues execution from wherever the executable, on
a remote target, left off.
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.
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.
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.
Unless GDB has been configured to enable the setting
of tracepoints, this radio button has no effect.
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.
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.
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.
-
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
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.
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.
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.
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
Auto
Update
The contents of the Memory
window are automatically updated whenever the target's state changes. T
ffb
his
is the default setting.
Forces the immediate update of the Memory
window's view of the target's memory.
This menu item brings up the Memory
Preferences dialog box.
Memory Preferences
dialog box for the Memory window
Size
Selection of the size of the individual cells displayed.
Selection of the format of the memory display.
Sets the number of bytes displayed in the Memory
window.
Sets the number of bytes displayed per row.
Choose to display a string representation of the memory.
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.
-
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.
Edit
Allows the value in the expression to be edited.
Hitting
the escape key (Esc)
will abort the editing.
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.
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.
-
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.
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.
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.
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.
-
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
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.
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.
This menu item removes the selected breakpoint.
Global menu for
the Breakpoints window
Disable
All
Disables 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.
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.
File menu for the
Help window
Back
Moves back one HTML help page, relative to previous forward
page movements.
Moves forward one HTML help page, relative to previous
back page movement.
Returns to the HTML help "Table
of Contents" home page.
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.
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