flashsdk 1.0.13.pre → 1.0.14.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +2 -4
  3. data/VERSION +1 -1
  4. data/lib/flashplayer/specification.rb +39 -35
  5. data/lib/flashplayer/system_mixins.rb +2 -5
  6. data/lib/flashplayer/task.legacy.rb +1 -1
  7. data/lib/flashsdk/adl.rb +5 -2
  8. data/lib/flashsdk/adt.rb +1 -2
  9. data/lib/flashsdk/amxmlc.rb +1 -2
  10. data/lib/flashsdk/compc.rb +0 -1
  11. data/lib/flashsdk/compiler_base.rb +111 -61
  12. data/lib/flashsdk/fcsh.rb +65 -0
  13. data/lib/flashsdk/fcsh_client.rb +36 -0
  14. data/lib/flashsdk/fdb.rb +767 -0
  15. data/lib/flashsdk/generators/class_generator.rb +37 -12
  16. data/lib/flashsdk/generators/flash_helper.rb +119 -23
  17. data/lib/flashsdk/module.rb +99 -1
  18. data/lib/flashsdk/mxmlc.rb +34 -8
  19. data/lib/flashsdk.rb +2 -0
  20. data/lib/flex3.rb +10 -9
  21. data/lib/flex4.rb +29 -0
  22. data/test/fixtures/sdk/fdb +62 -0
  23. data/test/fixtures/sdk/mxmlc +54 -0
  24. data/test/unit/adl_test.rb +1 -3
  25. data/test/unit/adt_test.rb +2 -3
  26. data/test/unit/amxmlc_test.rb +4 -2
  27. data/test/unit/class_generator_test.rb +1 -1
  28. data/test/unit/compc_test.rb +1 -2
  29. data/test/unit/fcsh_test.rb +35 -0
  30. data/test/unit/fdb_test.rb +49 -0
  31. data/test/unit/flash_helper_test.rb +21 -5
  32. data/test/unit/flashplayer_log_file_test.rb +2 -2
  33. data/test/unit/flashplayer_mm_config_test.rb +1 -1
  34. data/test/unit/flashplayer_module_test.rb +1 -1
  35. data/test/unit/flashplayer_task_test.rb +2 -2
  36. data/test/unit/flashplayer_trust_test.rb +1 -1
  37. data/test/unit/flex_generator_test.rb +1 -1
  38. data/test/unit/mxmlc_test.rb +27 -5
  39. data/test/unit/project_generator_test.rb +1 -1
  40. data/test/unit/test_helper.rb +3 -1
  41. data/test-stderr.log +1 -0
  42. data/test-stdout.log +58 -0
  43. metadata +15 -9
  44. data/lib/flashsdk/compc_legacy.rb +0 -149
  45. data/lib/flashsdk/mxmlc_legacy.rb +0 -135
  46. data/mate +0 -0
@@ -0,0 +1,767 @@
1
+
2
+ module FlashSDK
3
+
4
+ ##
5
+ # The FDB task provides an interface to the Flash Debugger.
6
+ #
7
+ # In order to use this tool, you'll need to compile a SWF
8
+ # file with +--debug=true+, and be prepared to open it
9
+ # in a debug Flash Player. You can open the SWF using
10
+ # the desktop debug Flash Player for your platform using
11
+ # the FlashSDK::FlashPlayer task, or you can open the
12
+ # SWF manually on the desktop or the browser - as long
13
+ # as you run it in a Debug Flash Player.
14
+ #
15
+ class FDB < Sprout::Daemon
16
+
17
+ set :default_prefix, '-'
18
+
19
+ ##
20
+ # The default gem name
21
+ set :pkg_name, 'flex4'
22
+
23
+ ##
24
+ # The default gem version
25
+ set :pkg_version, '>= 4.1.0.pre'
26
+
27
+ ##
28
+ # The default executable target
29
+ set :executable, :fdb
30
+
31
+ set :prompt, /^\(fdb\) |\(y or n\) /
32
+
33
+ ##
34
+ # Print a backtrace of all stack frames
35
+ add_action :backtrace
36
+ add_action_alias :bt, :backtrace
37
+ add_action_alias :where, :backtrace
38
+
39
+ ##
40
+ # Set a breakpoint at specified line or function
41
+ #
42
+ # @example Sets a breakpoint at line 87 of the current file.
43
+ # break 87
44
+ #
45
+ # @example Sets a breakpoint at line 56 of myapp.mxml
46
+ # break myapp.mxml:56
47
+ #
48
+ # @example Sets a breakpoint at line 29 of file #3
49
+ # break #3:29
50
+ #
51
+ # @example Sets a breakpoint at function doThis() in the current file
52
+ # break doThis
53
+ #
54
+ # @example Sets a breakpoint at function doThat() in file myapp.mxml
55
+ # break myapp.mxml:doThat
56
+ #
57
+ # @example Sets a breakpoint at function doOther() in file #3
58
+ # break #3:doOther
59
+ #
60
+ # @example Sets a breakpoint at the current execution address in the
61
+ # current stack frame. This is useful for breaking on return
62
+ # to a stack frame.
63
+ # break
64
+ #
65
+ # To see file names and numbers, do 'info sources' or 'info files'.
66
+ # To see function names, do 'info functions'.
67
+ # Abbreviated file names and function names are accepted if unambiguous.
68
+ # If line number is specified, break at start of code for that line.
69
+ # If function is specified, break at start of code for that function.
70
+ # See 'commands' and 'condition' for further breakpoint control.
71
+ add_action :break, Strings
72
+
73
+ ##
74
+ # Halt when an exception is thrown. This only affects caught
75
+ # exceptions -- that is, exceptions that are going to be handled
76
+ # by a "catch" block. Uncaught exceptions always halt in the
77
+ # debugger.
78
+ #
79
+ # Use the "delete" command to delete a catchpoint.
80
+ #
81
+ # Examples:
82
+ #
83
+ # catch *
84
+ #
85
+ # Halts when any exception is thrown.
86
+ #
87
+ # catch ReferenceError
88
+ #
89
+ # Halts whenever a ReferenceError is thrown
90
+ #
91
+ add_action :catch, String
92
+ add_action_alias :ca, :catch
93
+
94
+ ##
95
+ #
96
+ # Display the name and number of the current file
97
+ # or change the current file.
98
+ # Examples:
99
+ #
100
+ # cf
101
+ #
102
+ # Displays the name and number of the current file.
103
+ #
104
+ # cf myapp.mxml
105
+ #
106
+ # Changes the current file to myapp.mxml.
107
+ #
108
+ # cf #29
109
+ #
110
+ # Changes the current file to file #29.
111
+ # To see file names and numbers, do 'info sources' or 'info files'.
112
+ # Abbreviated file names are accepted if unambiguous.
113
+ # Listing a file with 'list' also makes that file the current file.
114
+ #
115
+ add_action :cf, String
116
+
117
+ ##
118
+ # Clear breakpoint at specified line or function.
119
+ # Examples:
120
+ #
121
+ # clear 87
122
+ #
123
+ # Clears the breakpoint at line 87 of the current file.
124
+ #
125
+ # clear myapp.mxml:56
126
+ #
127
+ # Clears the breakpoint at line 56 of myapp.mxml.
128
+ #
129
+ # clear #3:29
130
+ #
131
+ # Clears the breakpoint at line 29 of file #3.
132
+ #
133
+ # clear doThis
134
+ #
135
+ # Clears the breakpoint at function doThis() in the current file.
136
+ #
137
+ # clear myapp.mxml:doThat
138
+ #
139
+ # Clears the breakpoint at function doThat() in file myapp.mxml.
140
+ #
141
+ # clear #3:doOther
142
+ #
143
+ # Clears the breakpoint at function doOther() in file #3.
144
+ #
145
+ # clear
146
+ #
147
+ # Clears breakpoint of the current line in the current file.
148
+ # To see file names and numbers, do 'info sources' or 'info files'.
149
+ # To see function names, do 'info functions'.
150
+ # Abbreviated file names and function names are accepted if unambiguous.
151
+ # If line number is specified, all breakpoints in that line are cleared.
152
+ # If function is specified, breakpoints at beginning of function are cleared.
153
+ add_action :clear, Strings
154
+ add_action_alias :cl, :clear
155
+
156
+ ##
157
+ # Continue execution after stopping at a breakpoint
158
+ # Specify breakpoint number N to break only if COND is true.
159
+ # Usage is `condition N COND', where N is an integer and COND is an
160
+ # expression to be evaluated whenever breakpoint N is reached.
161
+ add_action :condition, String
162
+
163
+ ##
164
+ # Provide an affirmative response to a confirmation screen.
165
+ #
166
+ # See also: unconfirm
167
+ add_action :confirm
168
+
169
+ ##
170
+ # Continue execution after stopping at breakpoint.
171
+ # This command takes no arguments.
172
+ add_action :continue
173
+ add_action_alias :c, :continue
174
+
175
+ ##
176
+ # Set commands to be executed when a breakpoint is hit.
177
+ # Give breakpoint number as argument after `commands`.
178
+ # With no argument, the targeted breakpoint is the last one set.
179
+ # The commands themselves follow starting on the next line.
180
+ # Type a line containing "end" to indicate the end of them.
181
+ # Give "silent" as the first line to make the breakpoint silent;
182
+ # then no output is printed when it is hit, except what the commands print.
183
+ #
184
+ # Example:
185
+ #
186
+ # (fdb) commands
187
+ # Type commands for when breakpoint 1 is hit, one per line.
188
+ # End with a line saying just 'end'.
189
+ # >w
190
+ # >end
191
+ add_action :commands, String
192
+
193
+ ##
194
+ # Delete one or more breakpoints.
195
+ #
196
+ # Examples:
197
+ #
198
+ # delete
199
+ #
200
+ # Deletes all breakpoints.
201
+ #
202
+ # delete 2 5
203
+ #
204
+ # Deletes breakpoints #2 and #5.
205
+ #
206
+ # To see breakpoint numbers, do 'info breakpoints'.
207
+ add_action :delete, Strings
208
+ add_action_alias :d, :delete
209
+
210
+ ##
211
+ # Modify the list of directories in which fdb searches for source files.
212
+ #
213
+ # Examples:
214
+ #
215
+ # directory
216
+ #
217
+ # Restores list to the default, which is the directory in which the source
218
+ # file was compiled into object code, followed by the current working
219
+ # directory.
220
+ #
221
+ # directory C:\MySource (Windows)
222
+ # directory /MySource (Mac)
223
+ #
224
+ # Adds the specified directory to the beginning of the list of directories
225
+ # which will be searched for source. When looking for the source for class
226
+ # mypackage.MyClass, for example, the debugger would look for both
227
+ # C:\MySource\mypackage\MyClass.as and C:\MySource\MyClass.as.
228
+ #
229
+ # directory C:\Dir1;C:\Dir2 (Windows -- use ';' as separator)
230
+ # directory /Dir1:/Dir2 (Mac -- use ':' as separator)
231
+ #
232
+ # Adds several directories to the beginning of the list of directories
233
+ # which will be searched for source.
234
+ #
235
+ # To see the current list, do 'show directories'.
236
+ add_action :directory, Path
237
+ add_action_alias :dir, :directory
238
+
239
+ ##
240
+ # Disable one or more breakpoints or auto-display expressions.
241
+ #
242
+ # Examples:
243
+ #
244
+ # disable
245
+ #
246
+ # disable breakpoints
247
+ #
248
+ # Disables all breakpoints.
249
+ #
250
+ # disable 2 5
251
+ #
252
+ # disable breakpoints 2 5
253
+ #
254
+ # Disables breakpoints #2 and #5.
255
+ #
256
+ # disable display
257
+ #
258
+ # Disables all auto-display expressions.
259
+ #
260
+ # disable display 1 3
261
+ #
262
+ # Disables auto-display expressions #1 and #3.
263
+ #
264
+ # To see breakpoint numbers, do 'info breakpoints'.
265
+ # To see auto-display expression numbers, do 'info display'.
266
+ add_action :disable, String
267
+ add_action_alias :disab, :disable
268
+
269
+ ##
270
+ # (ActionScript 2 only; not supported when debugging ActionScript 3)
271
+ #
272
+ # Disassemble a specified portion of source code.
273
+ # The default is the current listing line.
274
+ # Arguments supported are the same as with the list command
275
+ #
276
+ # Examples:
277
+ #
278
+ # disassemble 87
279
+ #
280
+ # Disassembles line 87 in the current file.
281
+ #
282
+ # disassemble 87 102
283
+ # disassembles lines 87 to 102 in current file.
284
+ # disassemble doThis
285
+ #
286
+ # Disassembles the function doThis() in the current file.
287
+ #
288
+ # In addition to using simple line numbers as above, you can specify lines
289
+ # in additional ways:
290
+ #
291
+ # myapp.mxml
292
+ # Line 1 in myapp.mxml.
293
+ # myapp.mxml:doThat
294
+ # The first line of function doThat() in myapp.mxml.
295
+ # myapp.mxml:56
296
+ # Line 56 in myapp.mxml.
297
+ # #3
298
+ # Line 1 in file #3.
299
+ # #3:doOther
300
+ # The line in file #3 where the function doOther() begins.
301
+ # #3:29
302
+ # Line 29 in file #3.
303
+ add_action :disassemble, String
304
+ add_action_alias :disas, :disassemble
305
+
306
+ ##
307
+ # Add an auto-display expression
308
+ # Add an expression to the list of auto-display expressions.
309
+ #
310
+ # Example:
311
+ #
312
+ # display employee.name
313
+ #
314
+ # Add 'employee.name' to the list of auto-display expressions.
315
+ # Every time fdb stops, the value of employee.name will be displayed.
316
+ # The argument for this command is similar to that for 'print'.
317
+ # To see the list of auto-display expressions and their numbers,
318
+ # do 'info display'.
319
+ #
320
+ # NOTE: Removed because the base class adds this param for some reason.
321
+ # Investigate duplicate add_action calls.
322
+ #add_action :display, String
323
+ #add_action_alias :disp, :display
324
+
325
+ ##
326
+ # Enable breakpoints or auto-display expressions
327
+ add_action :enable
328
+ add_action_alias :e, :enable
329
+
330
+ ##
331
+ # Specify an application to be debugged, without starting it.
332
+ #
333
+ # Examples:
334
+ #
335
+ # file http://www.mysite.com/myapp.mxml
336
+ #
337
+ # Specify an MXML application to be debugged.
338
+ #
339
+ # file myapp.swf
340
+ #
341
+ # Specify a local SWF file to be debugged, in the current directory.
342
+ # In this case myapp.swd (the file containing the debugging information)
343
+ # must also exist in the current directory.
344
+ #
345
+ # This command does not actually cause the application to start;
346
+ # use the 'run' command with no argument to start debugging the application.
347
+ #
348
+ # Instead of using 'file <target>' and then 'run', you can simply specify the
349
+ # application to be debugged as an argument of 'run':
350
+ #
351
+ # run http://mysite.com/myapp.mxml
352
+ # run myapp.swf
353
+ #
354
+ # You can also specify the application to be debugged
355
+ # as a command-line argument when you start fdb:
356
+ #
357
+ # fdb http://www.mysite.com/myapp.mxml
358
+ #
359
+ # fdb myapp.swf
360
+ #
361
+ # In this case you do not need to use either 'file' or 'run'.
362
+ # If you 'run' without specifying an application to debug,
363
+ # (fdb)
364
+ #
365
+ # will wait for any application to connect to it.
366
+ add_action :file, File, { :hidden_name => true }
367
+ add_action_alias :fil, :file
368
+
369
+ ##
370
+ # Execute until current function returns.
371
+ # This command takes no arguments.
372
+ add_action :finish
373
+ add_action_alias :f, :finish
374
+
375
+ ##
376
+ # Specify how fdb should handle a fault in the Flash Player.
377
+ #
378
+ # Examples:
379
+ #
380
+ # handle recursion_limit stop
381
+ #
382
+ # When a recursion_limit fault occurs, display message in fdb
383
+ # and stop as if at breakpoint.
384
+ #
385
+ # handle all print nostop
386
+ #
387
+ # When any kind of fault occurs, display message in fdb but don't stop.
388
+ # First argument is a fault name or 'all'.
389
+ # Additional arguments are actions that apply to that fault.
390
+ # To see fault names, do 'info handle'.
391
+ #
392
+ # Actions are print/noprint and stop/nostop.
393
+ # 'print' means print a message if this fault happens.
394
+ # 'stop' means reenter debugger if this fault happens. Implies 'print'.
395
+ add_action :handle, String
396
+ add_action_alias :han, :handle
397
+
398
+ ##
399
+ # Display help on FDB commands
400
+ # New to fdb? Do 'tutorial' for basic info.
401
+ # List of fdb commands:
402
+ # bt (bt) Print backtrace of all stack frames
403
+ # break (b) Set breakpoint at specified line or function
404
+ # catch (ca) Halt when an exception is thrown
405
+ # cf (cf) Display the name and number of the current file
406
+ # clear (cl) Clear breakpoint at specified line or function
407
+ # condition (cond) Apply/remove conditional expression to a breakpoint
408
+ # continue (c) Continue execution after stopping at breakpoint
409
+ # commands (com) Sets commands to execute when breakpoint hit
410
+ # delete (d) Delete breakpoints or auto-display expressions
411
+ # directory (dir) Add a directory to the search path for source files
412
+ # disable (disab) Disable breakpoints or auto-display expressions
413
+ # disassemble (disas) Disassemble source lines or functions
414
+ # display (disp) Add an auto-display expressions
415
+ # enable (e) Enable breakpoints or auto-display expressions
416
+ # file (fil) Specify application to be debugged.
417
+ # finish (f) Execute until current function returns
418
+ # handle (han) Specify how to handle a fault
419
+ # help (h) Display help on fdb commands
420
+ # home (ho) Set listing location to where execution is halted
421
+ # info (i) Display information about the program being debugged
422
+ # kill (k) Kill execution of program being debugged
423
+ # list (l) List specified function or line
424
+ # next (n) Step program
425
+ # print (p) Print value of variable EXP
426
+ # pwd (pw) Print working directory
427
+ # quit (q) Exit fdb
428
+ # run (r) Start debugged program
429
+ # set (se) Set the value of a variable
430
+ # source (so) Read fdb commands from a file
431
+ # step (s) Step program until it reaches a different source line
432
+ # tutorial (t) Display a tutorial on how to use fdb
433
+ # undisplay (u) Remove an auto-display expression
434
+ # viewswf (v) Set or clear filter for file listing based on swf
435
+ # watch (wa) Add a watchpoint on a given variable
436
+ # what (wh) Displays the context of a variable
437
+ # where (w) Same as bt
438
+ # Type 'help' followed by command name for full documentation.
439
+ add_action :help
440
+ add_action_alias :h, :help
441
+
442
+ ##
443
+ # Set listing location to where execution is halted
444
+ add_action :home, Path
445
+ add_action_alias :ho, :home
446
+
447
+ ##
448
+ # Generic command for showing things about the program being debugged.
449
+ # List of info subcommands:
450
+ # info arguments (i a) Argument variables of current stack frame
451
+ # info breakpoints (i b) Status of user-settable breakpoints
452
+ # info display (i d) Display list of auto-display expressions
453
+ # info files (i f) Names of targets and files being debugged
454
+ # info functions (i fu) All function names
455
+ # info handle (i h) How to handle a fault
456
+ # info locals (i l) Local variables of current stack frame
457
+ # info scopechain (i sc) Scope chain of current stack frame
458
+ # info sources (i so) Source files in the program
459
+ # info stack (i s) Backtrace of the stack
460
+ # info swfs (i sw) List of swfs in this session
461
+ # info targets(i t) Application being debugged
462
+ # info variables (i v) All global and static variable names
463
+ # Type 'help info' followed by info subcommand name for full documentation.
464
+ add_action :info, String
465
+ add_action_alias :i, :info
466
+
467
+ ##
468
+ # Kill execution of program being debugged
469
+ # This command takes no arguments.
470
+ add_action :kill
471
+ add_action_alias :k, :kill
472
+
473
+ ##
474
+ # List lines of code in a source file.
475
+ #
476
+ # Examples:
477
+ #
478
+ # list
479
+ #
480
+ # Lists ten more lines in current file after or around previous listing.
481
+ #
482
+ # list -
483
+ #
484
+ # Lists the ten lines in current file before a previous listing.
485
+ #
486
+ # list 87
487
+ #
488
+ # Lists ten lines in current file around line 87.
489
+ #
490
+ # list 87 102
491
+ #
492
+ # Lists lines 87 to 102 in current file.
493
+ #
494
+ # In addition to using simple line numbers as above, you can specify lines
495
+ # in seven additional ways:
496
+ #
497
+ # doThis
498
+ #
499
+ # The first line of function doThis() in the current file.
500
+ #
501
+ # myapp.mxml
502
+ #
503
+ # Line 1 in myapp.mxml.
504
+ #
505
+ # myapp.mxml:doThat
506
+ #
507
+ # The first line of function doThat() in myapp.mxml.
508
+ #
509
+ # myapp.mxml:56
510
+ #
511
+ # Line 56 in myapp.mxml.
512
+ #
513
+ # #3
514
+ #
515
+ # Line 1 in file #3.
516
+ #
517
+ # #3:doOther
518
+ #
519
+ # The line in file #3 where the function doOther() begins.
520
+ #
521
+ # #3:29
522
+ #
523
+ # Line 29 in file #3.
524
+ #
525
+ # To see file names and numbers, do 'info sources' or 'info files'.
526
+ # To see function names, do 'info functions'.
527
+ # Abbreviated file names and function names are accepted if unambiguous.
528
+ # Listing a file makes that file the current file. (See 'cf' command.)
529
+ add_action :list, String
530
+ add_action_alias :l, :list
531
+
532
+ ##
533
+ # Step program, proceeding through subroutine calls.
534
+ #
535
+ # next
536
+ #
537
+ # Step once.
538
+ #
539
+ # next 3
540
+ #
541
+ # Step 3 times, or until the program stops for another reason.
542
+ #
543
+ # Like the 'step' command as long as subroutine calls do not happen;
544
+ # when they do, the call is treated as one instruction.
545
+ add_action :next, String
546
+ add_action_alias :n, :next
547
+
548
+ ##
549
+ # Print value of variable or expression.
550
+ #
551
+ # Examples:
552
+ #
553
+ # print i
554
+ #
555
+ # Print the value of 'i'.
556
+ #
557
+ # print employee.name
558
+ #
559
+ # Print the value of 'employee.name'.
560
+ #
561
+ # print employee
562
+ #
563
+ # Print the value of the 'employee' Object.
564
+ #
565
+ # This may simplay display something like [Object 10378].
566
+ #
567
+ # print employee.
568
+ #
569
+ # Print the values of all the properties of the 'employee' Object.
570
+ #
571
+ # print *employee
572
+ #
573
+ # Print the values of all the properties of the 'employee' Object.
574
+ # The prefix * operator is the prefix alternative to the postfix . operator.
575
+ #
576
+ # print #10378.
577
+ #
578
+ # Print the values of all the properties of Object #10378.
579
+ # Variables accessible are those of the lexical environment of the selected
580
+ # stack frame, plus all those whose scope is global or an entire file.
581
+ add_action :print, String
582
+ add_action_alias :p, :print
583
+
584
+ ##
585
+ # Print the current working directory.
586
+ # This is the directory from which fdb was launched; it cannot be
587
+ # changed within fdb. The argument for 'run' and 'source' can be
588
+ # specified relative to this directory.
589
+ # This command takes no arguments.
590
+ add_action :pwd
591
+ add_action_alias :pw, :pwd
592
+
593
+ ##
594
+ # Exit FDB
595
+ add_action :quit
596
+ add_action_alias :q, :quit
597
+
598
+ ##
599
+ # Start a debugging session.
600
+ #
601
+ # Examples:
602
+ #
603
+ # run http://www.mysite.com/myapp.mxml
604
+ #
605
+ # Runs the specified MXML application.
606
+ #
607
+ # run myapp.swf
608
+ # run mydir\myapp.swf
609
+ # run c:\mydir\myapp.swf
610
+ #
611
+ # Runs the local SWF file myapp.swf, which can be specified
612
+ # either relative to the current directory (see 'pwd' command)
613
+ # or using an absolute path. In these cases, myapp.swd
614
+ # (the file containing the debugging information) must also
615
+ # exist in the same directory as myapp.swf.
616
+ #
617
+ # run
618
+ #
619
+ # Run the application previously specified by the 'file' command.
620
+ # If no application has been specified, fdb will wait for one
621
+ # to connect to it, and time out if none does so.
622
+ # 'run' will start the application in a browser or standalone Flash Player.
623
+ # As soon as the application starts, it will break into fdb so that you can
624
+ # set breakpoints, etc.
625
+ #
626
+ # On the Macintosh, the only supported form of the command is 'run' with no
627
+ # arguments. You must then manually launch the Flash player.
628
+ add_action :run, String
629
+ add_action_alias :r, :run
630
+
631
+ ##
632
+ # Set the value of a variable or a convenience variable.
633
+ # Convenience variables are variables that exist entirely
634
+ # within fdb; they are not part of your program.
635
+ # Convenience variables are prefixed with '$' and can
636
+ # be any name that does not conflict with any existing
637
+ # variable. For example, $myVar. Convenience variables
638
+ # are also used to control various aspects of fdb.
639
+ #
640
+ # The following convenience variables are used by fdb.
641
+ # $listsize - number of source lines to display for 'list'
642
+ # $columnwrap - column number on which output will wrap
643
+ # $infostackshowthis - if 0, does not display 'this' in stack backtrace
644
+ # $invokegetters - if 0, prevents fdb from firing getter functions
645
+ # $bpnum - the last defined breakpoint number
646
+ # $displayattributes - if 1, 'print var.' displays all attributes of members
647
+ # of 'var' (e.g. private, static)
648
+ #
649
+ # Examples:
650
+ #
651
+ # set i = 3
652
+ #
653
+ # Sets the variable 'i' to the number 3.
654
+ #
655
+ # set employee.name = "Susan"
656
+ #
657
+ # Sets the variable 'employee.name' to the string "Susan".
658
+ #
659
+ # set $myVar = 20
660
+ #
661
+ # Sets the convenience variable '$myVar' to the number 20
662
+ add_action :set, String
663
+ add_action_alias :se, :set
664
+
665
+ ##
666
+ # Read fdb commands from a file and execute them.
667
+ #
668
+ # source mycommands.txt
669
+ # source mydir\mycommands.txt
670
+ # source c:\mydir\mycommands.txt
671
+ #
672
+ # Reads mycommands.txt and executes the fdb commands in it.
673
+ # The file containing the commands can be specified either
674
+ # relative to the current directory (see 'pwd' command)
675
+ # or using an absolute path.
676
+ #
677
+ # The file .fdbinit is read automatically in this way when fdb is started.
678
+ # Only the current directory is searched for .fdbinit. This means that
679
+ # you can have set up multiple .fdbinit files for different projects.
680
+ add_action :source, File
681
+ add_action_alias :so, :source
682
+
683
+ ##
684
+ # Step program until it reaches a different source line.
685
+ #
686
+ # Examples:
687
+ #
688
+ # step
689
+ #
690
+ # Step once.
691
+ #
692
+ # step 3
693
+ #
694
+ # Step 3 times, or until the program stops for another reason.
695
+ add_action :step, Number
696
+ add_action_alias :s, :step
697
+
698
+ ##
699
+ # Display a tutorial on how to use fdb.
700
+ # This command takes no arguments.
701
+ add_action :tutorial
702
+ add_action_alias :t, :tutorial
703
+
704
+ ##
705
+ # Provide a negative response to a confirmation screen.
706
+ #
707
+ # See also: confirm
708
+ add_action :unconfirm
709
+
710
+ ##
711
+ # Remove one or more auto-display expressions.
712
+ #
713
+ # Examples:
714
+ #
715
+ # undisplay
716
+ #
717
+ # Remove all auto-display expressions.
718
+ #
719
+ # undisplay 2 7
720
+ #
721
+ # Remove auto-display expressions #2 and #7.
722
+ #
723
+ # To see the list of auto-display expressions and their numbers,
724
+ # do 'info display'.
725
+ add_action :undisplay, String
726
+ add_action_alias :u, :undisplay
727
+
728
+ ##
729
+ # Set or clear a filter for file listing based on SWF
730
+ add_action :viewswf
731
+ add_action_alias :v, :viewswf
732
+
733
+ ##
734
+ # Add a watchpoint on a given variable. The debugger will halt
735
+ # execution when the variable's value changes.
736
+ #
737
+ # Example:
738
+ #
739
+ # watch foo
740
+ #
741
+ add_action :watch, String
742
+ add_action_alias :wa, :watch
743
+
744
+ ##
745
+ # Displays the context in which a variable is resolved.
746
+ add_action :what
747
+ add_action_alias :wh, :what
748
+
749
+ end
750
+ end
751
+
752
+ ##
753
+ # Rake task helper that delegates to
754
+ # the FDB executable.
755
+ #
756
+ # fdb 'bin/SomeProject.swf' do |t|
757
+ # t.break << 'com/foo/bar/SomeClass.as:23'
758
+ # t.continue
759
+ # t.run
760
+ # end
761
+ #
762
+ def fdb *args, &block
763
+ fdb_tool = FlashSDK::FDB.new
764
+ fdb_tool.to_rake *args, &block
765
+ fdb_tool
766
+ end
767
+