Adobe Flex 3 Help

Debugging with the web-tier compiler

The web-tier compiler has the following debugging-related features:

  • Detects a query string parameter that you use to invoke the debugger compiler
  • Controls the number of lines in the output that occur before and after an error or warning
  • Logs access and error messages

Invoking the debugger compiler

You can compile a debug version of your Flex application when you are using the web-tier compiler. You do this by appending ?debug=true to the end of the query string; for example:

http://www.myhost.com/myApps/Main.mxml?debug=true

You cannot disable this behavior of the web-tier compiler.

Adding ?debug=true to your query string instructs the compiler to include debugging information in the final SWF file output. As a result, you can set breakpoints and use other features of the fdb command-line debugger or the Flex Builder visual debugger.

To debug the application, you launch the fdb command line debugger and then launch your application in the browser with ?debug=true on the query string. The application connects to the running debugger.

You must have a debugger version of Flash Player to compile the application with debug information in it.

For more information on using fdb, see Using the Command-Line Debugger.

Customizing error output

You can select the number of lines of code to show in the browser before and after an error or warning. You do this in the Configuration screen of the installer.

The default value is 1. The value can be any nonnegative integer. If you set the value to 10, the compiler displays 10 lines of code before and after the location of a syntax error when the error is displayed in the browser.

If you want to change the number of lines after you have installed the web-tier compiler, you set the value of the lines_in_context property in the compiler.conf file. The following example sets the value to 10:

lines_in_context=10

You can disable warnings by setting ?warnings=false in the request string.

For more information on editing the compiler.conf file, see Configuring the web-tier compiler.

Using the web-tier compiler log files

The web-tier compiler generates its own set of access and error log files. The compiler writes to these log files in the /logs subdirectory of the module installation directory:

  • module_install_dir/logs/access.log
  • module_install_dir/logs/error.log

The access log records the date, time, and path for each MXML file that the web-tier compiler compiles. The following is an example of the access log file after the file MyBasicProject.mxml was compiled repeatedly:

[2007/03/02 16:13:08]C:/Documents and Settings/knizia/workspace/MyBasicProject/MyBasicProject.mxml
[2007/03/02 16:13:24]C:/Documents and Settings/knizia/workspace/MyBasicProject/MyBasicProject.mxml
[2007/03/02 16:13:47]C:/Documents and Settings/knizia/workspace/MyBasicProject/MyBasicProject.mxml
[2007/03/02 16:13:57]C:/Documents and Settings/knizia/workspace/MyBasicProject/MyBasicProject.mxml
[2007/03/02 16:15:32]C:/Documents and Settings/knizia/workspace/MyBasicProject/MyBasicProject.mxml

The error log records the date and time of any errors, plus the line of code that triggered the error, and the line number. The following is an example entry in the error log file:

[2007/03/02 16:15:34] [/MyBasicProject] error: Attribute name "s" must be followed by the ' = ' character. @ 11

The error log records only the line of code that triggered the error and not any lines of code above or below it, regardless of the value of the lines_in_context property.