
Altering Execution
Motorola
GNU Debugger (GDB)
For More Information On This Product,
Go to: www.freescale.com
D-45
D.11 Altering Execution
Once you think you have find an error in the program, you might want to find out for
certain whether correcting the apparent error would lead to correct results in the rest of the
run. You can find the answer by experiment, using the GDB features for altering execution
of the program.
For example, you can store new values into variables or memory locations, give the
program a signal, restart it at a different address, or even return prematurely from a
function to its caller.
Table D-22. Symbol-File Commands
Command
Description
whatis exp
Print the data type of expression exp. exp is not actually evaluated, and any
side-effecting operations (such as assignments or function calls) inside it do not
take place. See section Expressions.
whatis
Print the data type of $, the last value in the value history.
info address symbol
Describe where the data for symbol is stored. For a register variable, this says
which register it is kept in. For a non-register local variable, this prints the
stack-frame offset at which the variable is always stored.
Note the contrast with ‘print &symbol’, which does not work at all for a register
variables, and for a stack local variable prints the exact address of the current
instantiation of the variable.
ptype typename
Print a description of data type typename typename may be the name of a type,
or for C code it may have the form ‘struct struct-tag, ‘union union-tag or ‘enum
enum-tag.
info sources
Print the names of all source files in the program for which there is debugging
information.
info functions
Print the names and data types of all defined functions.
info functions regexp
Print the names and data types of all defined functions whose names contain a
match for regular expression regexp. Thus, ‘info fun step’ finds all functions
whose names include ‘step’; ‘info fun ^step’ finds those whose names start with
‘step’.
info variables
Print the names and data types of all variables that are declared outside of
functions (i.e., except for local variables).
info variables regexp
Print the names and data types of all variables (except for local variables) whose
names contain a match for regular expression regexp.
info types
Print all data types that are defined in the program.
info types regexp
Print all data types that are defined in the program whose names contain a match
for regular expression regexp.
printsyms filename
Write a complete dump of the debugger’s symbol data into the file filename.
F
Freescale Semiconductor, Inc.
n
.