{"id":23,"date":"2007-12-07T13:13:57","date_gmt":"2007-12-07T13:13:57","guid":{"rendered":"http:\/\/installingcats.com\/2007\/12\/07\/how-to-use-command-line-debugger-fdb-to-debug-flex-flash-on-mac-os-x\/"},"modified":"2007-12-07T13:13:57","modified_gmt":"2007-12-07T13:13:57","slug":"how-to-use-command-line-debugger-fdb-to-debug-flex-flash-on-mac-os-x","status":"publish","type":"post","link":"https:\/\/installingcats.com\/2007\/12\/07\/how-to-use-command-line-debugger-fdb-to-debug-flex-flash-on-mac-os-x\/","title":{"rendered":"How to use command line debugger fdb to debug Flex \/ Flash on Mac OS X"},"content":{"rendered":"
Debugging Flash \/ Adobe Flex 2 \/ ActionScript 3 code using fdb on Mac or Windows is not exactly a straightforward affair. The following are instructions on how to get fdb running for debugging flash files and how to debug flex through the command line tools.<\/p>\n
Preamble:<\/p>\n
sudo ln -s \/Applications\/Adobe Flex Builder 2\/Flex SDK 2\/lib\/fdb.jar \/usr\/local\/lib\/fdb.jar
\nsudo ln -s \/Applications\/Adobe Flex Builder 2\/Flex SDK 2\/bin\/fdb \/usr\/local\/bin\/fdb<\/p>\n
The following example debugs a flash file named salesforce-debug.swf. Note that you don’t debug your regular production compiled flash file, you debug, the “debug” version, which is automatically created for you when you compile your flash file or project. These files are normally located within the \/bin directory of your Flex project.
\nIf the following example, when you see prompts such as ‘$’ or ‘(fdb)’, do not mistake them for commands, those are my prompts and you should be typing what follows those prompts. Lines not preceded by either a bullet or prompts are output from the fdb program.<\/p>\n
To debug a Flash .swf using fdb on a Mac:<\/p>\n
$ fdb<\/p>\n
(fdb) file salesforce-debug.swf
\n(fdb) run
\nAttempting to launch and connect to Player using URL
\nsalesforce-debug.swf
\nPlayer connected; session starting.
\nSet breakpoints and then type ‘continue’ to resume the session.
\n[SWF] Users:ben:Documents:Flex Builder 2:salesforce:bin:salesforce-debug.swf – 1,101,498 bytes after decompression<\/p>\n
(fdb) break sfquery
\nBreakpoint 1 created, but not yet resolved.
\nThe breakpoint will be resolved when the corresponding file or function is loaded.<\/p>\n
(fdb) continue
\nAdditional ActionScript code has been loaded from a SWF or a frame.
\nTo see all currently loaded files, type ‘info files’.
\nResolved breakpoint 1 to salesforce.mxml:64<\/p>\n
(fdb) [hit the Enter button here at this blank prompt]<\/p>\n
[trace] Method name is: login
\n[trace] Method name is: login
\nBreakpoint 1, salesforce.mxml:64
\n64 private function sfquery():void {
\n(fdb)<\/p>\n
quit
\nDo you want to attempt to halt execution? (y or n)<\/p>\n
Attempting to halt.
\nTo help out, try nudging the Player (e.g. press a button)
\nExecution halted 00041994at 0xExecution halted 00041994 (268692)<\/p>\n