You can use the source command to read fdb commands from a file and execute them. This lets you write commands such as breakpoints once and use them repeatedly when debugging the same application in different sessions or across different applications.
The source command has the following syntax:
(fdb) source file
The value of file can be a filename for a file in the current working directory or an absolute path to a remote file. To determine the current working directory, use the pwd command.
The following examples read in the mycommands.txt file from different locations:
(fdb) source mycommands.txt (fdb) source mydir\mycommands.txt (fdb) source c:\mydir\mycommands.txt
The print command displays values of members such as variables, objects, and properties. This command excludes functions, static variables, constants, and inaccessible member variables (such as the members of an Array).
The print command uses the following syntax:
print [variable_name | object_name[.] | property]
The print command prints the value of the specified variable, object, or property. You can specify the name or name.property to narrow the results. If fdb can determine the type of the entity, fdb displays the type.
If you specify the print command on an object, fdb displays a numeric identifier for the object.
To list all the properties of an object, use trailing dot-notation syntax. The following example prints all the properties of the object myButton:
(fdb) print myButton
To print the value of a single variable, use dot-notation syntax, as the following example shows:
(fdb) print myButton.label
Use the what command to view the context of a variable. The what command has the following syntax:
(fdb) what variable
Use the display command to add an expression to the autodisplay list. Every time debugging stops, fdb prints the list of expressions in the autodisplay list. The display command has the following syntax:
(fdb) display [expression]
The expression is the same as the arguments for the print command, as the following example shows:
(fdb) display myButton.color
To view all expressions on the autodisplay list, use the info display command.
To remove an expression from the autodisplay list, use the undisplay command. The undisplay command has the following syntax:
(fdb) undisplay [list_num]
Use the undisplay command without an argument to remove all entries on the autodisplay list. Specify one or more list_num options separated by spaces to remove numbered entries from the autodisplay list.
You can temporarily disable autodisplay expressions by using the disable display command. The disable display command has the following syntax:
(fdb) disable display [display_num]
Specify one or more space-separated numbers as options to disable only those entries in the autodisplay list.
To re-enable the display list, use the enable display command, which has the same syntax as the disable display command.