Sounds awesome!
Trying to support original buggy fdb from closed-source Adobe AIR SDK was a real headache for me. Now I start thinking about including your fdb into IntelliJ IDEA installation or just asking IDE users to use debugger from upcoming Apache Flex SDK. I'll play with your fdb today/tomorrow and give more feedback then. Looks like support at IntelliJ side can be rescheduled for the nearest weeks.

Alexander

On 27.05.2014 17:58, Frédéric THOMAS wrote:
Hi guys,

Done !!
see https://issues.apache.org/jira/browse/FLEX-34334  for the compiled FDB

I changed completly what I did in the previous fixes to follow the original 
coding intention, I mean 1 BP for a file/line (or function) and 1 location per 
worker (swf), so, it means, 1 BP could be set for many workers and not 1 BP / 
worker as I did before.

I also extended the syntaxt of the "break" and "clear" commands to accept worker id as 
supplementary info prefixing it with "@"(ex: @3:#MyFile.as:56, @3:MyF*:56, @3:MyFi*:MyFunction)
Adding the worker id will drive the command to be executed only for that 
worker, if the BP hasn't been created and the worker id is provided, the BP 
won't be propagated, allowing to have a BP for only 1 particular worker 
instance.

A commented example using FDB here [1]

@Alexander
I tried it in IntelliJ, it works very well, indeed, I wasn't able to set  or remove a BP for a 
particular worker instance because IJ doesn't support the new notation yet and uses only 
"delete" which remove the all BP, "clear" needs to be used for a particular 
instance.

It would be nice to have you feedback.

Now, I think that IJ could add a combo on the top of the Frame list and in the extended panel for a 
BP, add "all" - "thread" as done in Java :-)

Thanks,
Frédéric THOMAS

[1]
Apache fdb (Flash Player Debugger) [build development]
Copyright 2013 The Apache Software Foundation. All rights reserved.
(fdb) run
Waiting for Player to connect
Player connected; session starting.
Set breakpoints and then type 'continue' to resume the session.
(fdb) info workers
Main Thread 0 - Suspended (Active)
[SWF] MP3Worker.swf - 181 081 bytes after decompression
(fdb) where
#0   this = [Object 75659105, class='global'].global$init() at <null>:0
(fdb) info files
---
DebuggableWorker.as#1
mx_internal.as#3
IFlexAsset.as#5
ByteArrayAsset.as#6
---
MP3Worker.as#2
Workers.as#4

***************************************
Set a breakpoint on a partial file name, this breakpoint does not include any 
worker id info, it will then be propagated if there are more workers running, 
not the case at the moment
***************************************
(fdb) break Deb*:56
***************************************
The info relative to the BP does not include worker info, this is because I 
didn't modify the property files at the moment.
***************************************
Breakpoint 1: file DebuggableWorker.as, line 56
***************************************
Set a breakpoint on a partial file name, this breakpoint does not include any 
worker id info, it will then be propagated if there are more workers running 
and at the moment, because is not in our file list, be resolve later.
Propagated means: propagated to all existing workers.
Resolve later means: As soon as a corresponding file/line (or function name) 
will be found, it will be resolved.
***************************************
(fdb) break Back*:28
Breakpoint 2 created, but not yet resolved.
The breakpoint will be resolved when the corresponding file or function is 
loaded.
(fdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00000000 in debugTickler() at 
DebuggableWorker.as:56 (Worker 0)
2   breakpoint     keep y   0x00000000 Back*:28 (not yet resolved)
(fdb) c
[WorkerCreate] 1
Breakpoint 1: file DebuggableWorker.as, line 56
Additional ActionScript code has been loaded from a SWF or a frame.
To see all currently loaded files, type 'info files'.
Active worker has changed to worker 1

Resolved breakpoint 2 to onMainToBack() at BackWorker.as:28

Set additional breakpoints as desired, and then type 'continue'.
***************************************
A worker has been created and our files have been resolved and propagated.
The BP 1 has now 2 location, in worker 1 and 2
***************************************
(fdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00000000 in debugTickler() at 
DebuggableWorker.as:56 (Worker 0 / 1)
2   breakpoint     keep y   0x00000000 in onMainToBack() at BackWorker.as:28 
(Worker 1)
[SWF] MP3Worker.swf - 528 227 bytes after decompression
Resolved breakpoint 2 to onMainToBack() at BackWorker.as:28

Set additional breakpoints as desired, and then type 'continue'.
(fdb) c

Active worker has changed to worker 0
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c

Active worker has changed to worker 1
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
  ***************************************
  Break and Clear accept worker info in the form @<worker id>, when pass, only 
the indicated worker is affected by the command
  We are asking here to clear the BP of this file only in worker 0 (main thread)
  ***************************************
(fdb) clear @0:Deb*:56
Active worker has changed to worker Main Thread
Active worker has changed to worker 1
***************************************
The result of info break tells that it has been clear from worker 0 but not 
from 1
***************************************
(fdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00000000 in debugTickler() at 
DebuggableWorker.as:56 (Worker 1)
         breakpoint already hit 3 time(s)
2   breakpoint     keep y   0x00000000 in onMainToBack() at BackWorker.as:28 
(Worker 1)
(fdb) c
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c

***************************************
Because the function where we break is called very often, there is an extra 
break, that's an edge case, usually, it won't break again.
***************************************
Active worker has changed to worker 0
Execution halted, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c

Active worker has changed to worker 1
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
  ***************************************
  Ask to break in a particualar worker, actually, the breakpoint already exist 
as we created it before without giving any info relative to the worker 
(Dev*:56), it has then been created to be propagated, so, even though now, we 
give and info relative to the worker, it will simply create a new location (aka 
in the requested worker)
  ***************************************
(fdb) break @0:Deb*:56
Active worker has changed to worker Main Thread
Breakpoint 1: file DebuggableWorker.as, line 56
Active worker has changed to worker 1
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
  ***************************************
  That's what shows the info break
  ***************************************
(fdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00000000 in debugTickler() at 
DebuggableWorker.as:56 (Worker 1 / 0)
         breakpoint already hit 7 time(s)
2   breakpoint     keep y   0x00000000 in onMainToBack() at BackWorker.as:28 
(Worker 1)
(fdb) c
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c

Active worker has changed to worker 0
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c

Active worker has changed to worker 1
Breakpoint 1, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
  ***************************************
  delete break <BP Number> remove the BP in all workers
  ***************************************
(fdb) delete break 1
Active worker has changed to worker 1
(fdb) info break
Num Type           Disp Enb Address    What
2   breakpoint     keep y   0x00000000 in onMainToBack() at BackWorker.as:28 
(Worker 1)
(fdb) c

***************************************
Still an extra break for the reason mentioned before
***************************************
Active worker has changed to worker 0
Execution halted, debugTickler() at DebuggableWorker.as:56
  56            var i:int = 0;
(fdb) c
***************************************
And then, normal execution until we halt
***************************************
halt
Do you want to attempt to halt execution? (y or n) y
Attempting to halt.
To help out, try nudging the Player (e.g. press a button)
Execution halted in 'MP3Worker.swf' at 0xffffffff (-1)
***************************************
no needs of the 2 BP
***************************************
(fdb) delete break 2
Active worker has changed to worker 1
Active worker has changed to worker Main Thread
Execution halted in 'MP3Worker.swf' at 0xffffffff (-1)
***************************************
info break emptied
***************************************
(fdb) info break
Num Type           Disp Enb Address    What
(fdb) show break
Stopped in 'MP3Worker.swf' at 0xffffffff (-1) due to StopRequest
(fdb) info workers
Main Thread 0 - Suspended (Active)
Worker 1 - Running
***************************************
Now, we are creating a new worker specifying the worker id, it will not be 
propagated.
***************************************
(fdb) break @0:Deb*:56
Breakpoint 3: file DebuggableWorker.as, line 56
***************************************
Info break shows that despite we have 2 workers runnning, it has been set only 
in the requested one.
***************************************
(fdb) info break
Num Type           Disp Enb Address    What
3   breakpoint     keep y   0x00000000 in debugTickler() at 
DebuggableWorker.as:56 (Worker 0)
(fdb) delete 3
(fdb) info break
Num Type           Disp Enb Address    What
(fdb) quit
The program is running.  Exit anyway? (y or n) y

Process finished with exit code 0



Reply via email to