`

使用Flex Debugger 命令行 工具

    博客分类:
  • Flex
阅读更多
 

使用Flex Debugger  命令行 工具

 

    如果你想调试你的应用程序的话,你可以使用Flex Builder进行本地或远程进行调试,但是如果你的机子上没有装Flex Builder的话,你就可以使用命令行 工具 fdb,来进行调试。

 

   为了能够被调试,你首先要做的就是要编译一个debug 版本的swf,这个debug版本的 swf 包含了调试信息,然后你就可以使用一般在C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin\fdb.exe (window xp)的 fdb进行调试。

 

   (fdb) help

   (fdb) tutorial

   (fdb) run

   (fdb) set $ invokegetters = 0

   (fdb) set  $listsize= 0

Command

Description

continue

Continues running the application.

file [file]

Specifies an application to be debugged, without starting it. This command does not cause the application to start; use the run command without an argument to start debugging the application.

finish

Continues until the function exits.

next [N]

Continues to the next source line in the application. The optional argument N means do this N times or until the program stops for some other reason.

quit

Exits from the debug session.

run [file]

Starts a debugging session by running the specified file. To run the application that the file command previously specified, execute the run command without any options.

The run command starts the application in a browser or stand-alone Flash Player.

step [N]

Steps into the application. The optional argument N means do this N times or until the program stops for some other reason.

These commands are nonblocking, which means that when they return, the client has at least begun the operation, but it has not necessarily finished it.


 

The following example shows a sample application after it starts:

(fdb) continue 
[trace] ComboBase: y = undefined text_mc.bl = undefined
[trace] ComboBase: y = undefined text_mc.bl = undefined
[trace] ComboBase: y = undefined text_mc.bl = undefined
[trace] ComboBase: y = undefined text_mc.bl = undefined
[trace] ComboBase: y = undefined text_mc.bl = undefined
[trace] ComboBase: y = undefined text_mc.bl = undefined
[trace] ComboBase: y = undefined text_mc.bl = undefined
[trace] RadioButtonGroup.addInstance: instance = _level0._VBox0._Accordion0._For
m2._FormItem3._RadioButton1 data = undefined label = 2005
[trace] RadioButtonGroup.addInstance: instance = _level0._VBox0._Accordion0._For
m2._FormItem3._RadioButton2 data = undefined label = 2004
[trace] RadioButtonGroup.addInstance: instance = _level0._VBox0._Accordion0._For
m2._FormItem3._RadioButton3 data = undefined label = 2005
[trace] RadioButtonGroup.addInstance: instance = _level0._VBox0._Accordion0._For
m2._FormItem3._RadioButton4 data = undefined label = 2006
[trace] ComboBase: y = 0 text_mc.bl = 12
[trace] ComboBase: y = 0 text_mc.bl = 12
[trace] ComboBase: y = 0 text_mc.bl = 12
[trace] ComboBase: y = 0 text_mc.bl = 14
 

 

    设置断点:

Command

Description

break [args]

Sets a breakpoint at the specified line or function. The argument can be a line number or function name. With no arguments, the break command sets a breakpoint at the currently stopped line (not the currently listed line).

If you specify a line number, fdb breaks at the start of code for that line. If you specify a function name, fdb breaks at the start of code for that function.

clear [args]

Clears a breakpoint at the specified line or function. The argument can be a line number or function name.

If you specify a line number, fdb clears a breakpoint in that line. If you specify a function name, fdb clears a breakpoint at the beginning of that function.

With no argument, fdb clears a breakpoint in the line that the selected frame is executing in.

Compare the delete command, which clears breakpoints by number.

commands [breakpoint]

Sets commands to execute when the specified breakpoint is encountered. If you do not specify a breakpoint, the commands are applied to the last breakpoint.

condition bnum [expression]

Specifies a condition that must be met to stop at the given breakpoint. The fdb debugger evaluates expression when the bnum breakpoint is reached. If the value is true or nonzero, fdb stops at the breakpoint. Otherwise, fdb ignores the breakpoint and continues execution.

To remove the condition from the breakpoint, do not specify an expression.

You can use conditional breakpoints to stop on all events of a particular type. For example, to stop on every initialize event, use the following commands:

(fdb) break UIEvent:dispatch Breakpoint 18 at 0x16cb3: file UIEventDispatcher.as, line 190 (fdb) condition 18 (eventObj.type == 'initialize')
delete [args]

Deletes breakpoints. Specify one or more comma- or space-separated breakpoint numbers to delete those breakpoints. To delete all breakpoints, do not provide an argument.

disable breakpoints [bp_num]

Disables breakpoints. Specify one or more space-separated numbers as options to disable only those breakpoints.

enable breakpoints [bp_num]

Enables breakpoints that were previously disabled. Specify one or more space-separated numbers as options to enable only those breakpoints.

 

 

The following example sets a breakpoint on the myFunc()

method, which is triggered when the user clicks a button:

 

 

(fdb) break myFunc

Breakpoint 1 at 0x401ef:file file1.mxml, line 5

(fdb) continue

Breakpoint 1, myFunc() at file1.mxml:5

5ta1.text = "Clicked";

(fdb)
 

 

(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
 

 

  

(fdb) bt

 

 

 

 

 

分享到:
评论

相关推荐

    flex编译

    1. **Flex SDK**:Adobe Flex SDK是一套用于构建Flex应用程序的免费工具集,包含了编译器、模拟器和命令行工具,允许开发者使用MXML和ActionScript进行开发。 2. **MXML**:MXML是一种声明式语言,用于定义Flex应用...

    经过修改的flex商城

    开发者可以使用Flash Builder这样的集成开发环境,或者命令行工具进行开发。 6. **电子商务功能**: Flex商城可能包含了常见的电商功能,如商品浏览、购物车、结账流程、订单管理、用户账户系统等。这些功能需要与...

    Flex代码检查PMD

    1. `ant-1.7.0.jar`:Apache Ant是一个Java库和命令行工具,用于驱动构建过程。在这里,它可能被用来自动化PMD的执行和报告生成。 2. `pmd-4.2.2.jar`:这是PMD的核心库,包含了用于分析Java代码的规则和引擎。 3....

    flash as3 调试工具

    3. **fdb (Flash Debugger)**:这是一个命令行工具,适用于那些喜欢使用终端进行调试的开发者。通过fdb,你可以连接到正在运行的SWF,设置断点,查看变量,以及控制程序执行。 4. **Flash Player Debugger**:这是...

    如何安装postgresQL-Unix1

    3. **安装Flex和Bison**:Flex是词法分析器生成器,Bison是语法分析器生成器,这两个工具在编译源码时用于解析SQL语句。分别通过`apt-get install flex`和`apt-get install bison`进行安装。 4. **修改文件权限**:...

    Linux_x86_64_gcc环境相关依赖库.zip

    在编译和调试过程中,GDB(GNU Debugger)是另一个重要的工具,它允许程序员调试他们的C/C++程序,检查内存状态,设置断点,步进执行等。在CentOS中,安装GDB可以使用: ```bash sudo yum install -y gdb ``` 确保...

    gostack_1.3:[GoStack] 1.3 Conceitos做React Native

    在开始开发之前,你需要安装Node.js、npm(Node包管理器)以及React Native命令行工具。然后创建一个新的React Native项目,通过`react-native init ProjectName`命令初始化。此外,为了在模拟器或真机上运行应用,...

Global site tag (gtag.js) - Google Analytics