Specifications

CHAPTER 12
254
Breakpoint 1, myFunc() at file1.mxml:5
5ta1.text = "Clicked";
(fdb)
To see all breakpoints and their numbers, use the info breakpoints command. This will also tell you if a break-
point is unresolved.
You can use the commands command to periodically print out values of objects and variables whenever fdb
encounters a particular breakpoint. The following example prints out the value of ta1.text (referred to as
$1),
executes the
where command, and then continues when it encounters the buttons click handler breakpoint:
(fdb) commands 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just 'end'.
>print ta1.text
>where
>continue
>end
(fdb) cont
Breakpoint 1, myFunc() at file1.mxml:5
5ta1.text = "Clicked";
$1 = ""
#0 [MovieClip 1].myFunc(event=undefined) at file1.mxml:5
#1 [MovieClip 1].handler(event=[Object 18127]) at file1.mxml:15
Breakpoints are not specific to a single SWF file. If you set a breakpoint in a file that is common to multiple SWF
files, fdb applies the breakpoint to all SWF files.
For example, suppose you have four SWF files loaded and each of those SWF files contains the same version of an
ActionScript file, view.as. To set a breakpoint in the
init() function of the view.as file, you need to set only a
single breakpoint in one of the view.as files. When fdb encounters any of the
init() functions, it triggers the
break.
Accessing commands from a file
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: