406 Chapter 18 Debugging Programs
month = 11,
day = 16,
year = 2004
}
(gdb)
Here, the function foois as defined in Program 18.5.
You can assign values to an array or structure by listing them inside a set of curly
braces, as follows:
(gdb) print array
$14 = {1, 2, 3, 4, 5}
(gdb) set var array = {100, 200}
(gdb) print array
$15 = {100, 200, 0, 0} Unspecified values set to zero
(gdb) print today
$16 = {
month = 10,
day = 11,
year = 2004
}
(gdb) set var today={8, 8, 2004}
(gdb) print today
$17 = {
month = 8,
day = 8,
year = 2004
}
(gdb)
Getting Help with gdbCommands
You can use the built-in helpcommand to get information about various commands or
types of commands (called classesby gdb).
The command help,without any arguments, lists all the available classes:
(gdb) help
List of classes of commands:
aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack