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


> From: webdoubl...@hotmail.com
> To: dev@flex.apache.org
> Subject: RE: [FDB] Integration
> Date: Sun, 25 May 2014 15:07:15 +0100
> 
> FYI, looking at the pratical usage on IDEs, I changed my mind relative to the 
> fact that breaking in all instances shouldn't be the default behavior, until 
> nobody has objections, I will then implement the default behavior as breaking 
> in all existed and newly created instances of a worker, anyway, I add the 
> possibility to indicate the worker id inb the break / clear commands, in that 
> case, the function will be applied on the worker id only (aka the instance of 
> the worker), an other option to touch a particular breakpoint will be to use 
> delete break <BP NUMBER>, the commands will be smart enought to let you do 
> without to change the active worker.
> 
> Frédéric THOMAS
> 
> > From: aha...@adobe.com
> > To: dev@flex.apache.org
> > Subject: Re: [FDB] Integration
> > Date: Sun, 25 May 2014 04:01:05 +0000
> > 
> > Awesome!
> > 
> > On 5/24/14 6:12 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> > 
> > >To keep you in touch of the progress, with those 2 issues [1] [2] fixed
> > >we can already debug workers using FDB or IntelliJ for simple cases (1
> > >instance of your Workers), I attached a compiled FDB to the last issue
> > >for testing puroposes or if some of you want to play with.
> > >
> > >I'm about to allow to set / remove breakpoints on the same file/line in
> > >all worker instances in a once when FDB will be launch with the extended
> > >worker option (easier to use from an IDE too), I'll keep you in touch as
> > >I progress.
> > >
> > >Frédéric THOMAS
> > >
> > >[1] https://issues.apache.org/jira/browse/FLEX-34332
> > >[2]https://issues.apache.org/jira/browse/FLEX-34333
> > >                                                           
> > >
> > >> From: webdoubl...@hotmail.com
> > >> To: dev@flex.apache.org
> > >> Subject: RE: [FDB] Integration
> > >> Date: Fri, 23 May 2014 13:46:03 +0100
> > >> 
> > >> Hi guys,
> > >> 
> > >> Just to tell you I open a ticket for AIR
> > >>https://bugbase.adobe.com/index.cfm?event=bug&id=3765216 to have the
> > >>fixes I did fixed for AIR FDB too, not sure they will do it though.
> > >> 
> > >> I will push the work I did on the develop branch next week if there's
> > >>no objections.
> > >> 
> > >> 
> > >> 
> > >> Frédéric THOMAS
> > >> 
> > >> > From: webdoubl...@hotmail.com
> > >> > To: dev@flex.apache.org
> > >> > Subject: RE: [FDB] Integration
> > >> > Date: Sat, 3 May 2014 19:15:23 +0100
> > >> > 
> > >> > Resolved another issue [1], so, the last FDB is there.
> > >> > 
> > >> > Frédéric THOMAS
> > >> > 
> > >> > [1] https://issues.apache.org/jira/browse/FLEX-34297
> > >> > 
> > >> > > From: webdoubl...@hotmail.com
> > >> > > To: dev@flex.apache.org
> > >> > > Subject: RE: [FDB] Integration
> > >> > > Date: Sat, 3 May 2014 16:49:30 +0100
> > >> > > 
> > >> > > Hi,
> > >> > > 
> > >> > > I just pushed 2 commits for the issues [1] [2], I would appreciate
> > >>if someone have time to do more testing, I will add the compiled FDB in
> > >>few minutes.
> > >> > > 
> > >> > > Thanks,
> > >> > > Frédéric THOMAS
> > >> > > 
> > >> > > [1] https://issues.apache.org/jira/browse/FLEX-34295
> > >> > > [2] https://issues.apache.org/jira/browse/FLEX-34296
> > >> > > 
> > >> > > > From: webdoubl...@hotmail.com
> > >> > > > To: dev@flex.apache.org
> > >> > > > Subject: RE: [FDB] Integration
> > >> > > > Date: Thu, 1 May 2014 14:43:51 +0100
> > >> > > > 
> > >> > > > Oups, thanks, done !!
> > >> > > > 
> > >> > > > Frédéric THOMAS
> > >> > > > 
> > >> > > > > From: aha...@adobe.com
> > >> > > > > To: dev@flex.apache.org
> > >> > > > > Subject: Re: [FDB] Integration
> > >> > > > > Date: Thu, 1 May 2014 13:35:35 +0000
> > >> > > > > 
> > >> > > > > Hi Fred, the DebuggableWorker class code looks fine.  The file
> > >>should
> > >> > > > > probably have an Apache Header instead of what it has now.
> > >> > > > > 
> > >> > > > > -Alex
> > >> > > > > 
> > >> > > > > On 5/1/14 6:21 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com>
> > >>wrote:
> > >> > > > > 
> > >> > > > > >Alex,
> > >> > > > > >
> > >> > > > > >I pushed the commit in the FDBWorkers branch, if you want to
> > >>have a look
> > >> > > > > >before I merge it in Develop, that's won't be now but still.
> > >> > > > > >This is the JIRA
> > >>https://issues.apache.org/jira/browse/FLEX-34294 if you
> > >> > > > > >want to check the code via the "Source" tab instead in few
> > >>minutes.
> > >> > > > > >
> > >> > > > > >Thanks for your help !
> > >> > > > > >
> > >> > > > > >Frédéric THOMAS
> > >> > > > > >
> > >> > > > > >> From: aha...@adobe.com
> > >> > > > > >> To: dev@flex.apache.org
> > >> > > > > >> Subject: Re: [FDB] Integration
> > >> > > > > >> Date: Wed, 30 Apr 2014 20:38:50 +0000
> > >> > > > > >> 
> > >> > > > > >> I think core.swc is supposed to contain stuff you can use in
> > >>AS3
> > >> > > > > >>projects
> > >> > > > > >> w/o pulling in all of the other Flex stuff.  Maybe it can go
> > >>there?
> > >> > > > > >> 
> > >> > > > > >> On 4/30/14 1:08 PM, "Frédéric THOMAS"
> > >><webdoubl...@hotmail.com> wrote:
> > >> > > > > >> 
> > >> > > > > >> >Alex,
> > >> > > > > >> >
> > >> > > > > >> >Too much time on it, the reason why it didn't stop in the
> > >>worker is
> > >> > > > > >> >because the compiled worker didn't included the base worker
> > >>class,
> > >> > > > > >>better
> > >> > > > > >> >that than what I thought :P
> > >> > > > > >> >
> > >> > > > > >> >Also, it's going to work for Flex projects but not for pure
> > >>AS3
> > >> > > > > >>projects
> > >> > > > > >> >if I put that base class in the existing libs, should we
> > >>create an
> > >> > > > > >>other
> > >> > > > > >> >lib that pure AS3 project could reference ? how do you see
> > >>it could be
> > >> > > > > >> >better ?
> > >> > > > > >> >
> > >> > > > > >> >Is it a good solution for IDEs ?
> > >> > > > > >> >
> > >> > > > > >> >Frédéric THOMAS
> > >> > > > > >> >
> > >> > > > > >> >> From: webdoubl...@hotmail.com
> > >> > > > > >> >> To: dev@flex.apache.org
> > >> > > > > >> >> Subject: RE: [FDB] Integration
> > >> > > > > >> >> Date: Wed, 30 Apr 2014 20:17:29 +0100
> > >> > > > > >> >> 
> > >> > > > > >> >> It is not even that, even if I stop in the main thread,
> > >>switch to the
> > >> > > > > >> >>worker and try to stop it, it doesn't want, digging
> > >>into....
> > >> > > > > >> >> 
> > >> > > > > >> >> Frédéric THOMAS
> > >> > > > > >> >> 
> > >> > > > > >> >> > From: webdoubl...@hotmail.com
> > >> > > > > >> >> > To: dev@flex.apache.org
> > >> > > > > >> >> > Subject: RE: [FDB] Integration
> > >> > > > > >> >> > Date: Wed, 30 Apr 2014 19:47:33 +0100
> > >> > > > > >> >> > 
> > >> > > > > >> >> > What I did and 1st surprised I thought it was the
> > >>"halt" command to
> > >> > > > > >> >>debug, not even, it was in the main loop and the trick is,
> > >>I had to
> > >> > > > > >>code
> > >> > > > > >> >>to stop only on the main thread, it doesn't work with the
> > >>current
> > >> > > > > >> >>implementation, well, not so but at the end, given once it
> > >>is halted
> > >> > > > > >>we
> > >> > > > > >> >>can switch to another one, halt it and so on.
> > >> > > > > >> >> > 
> > >> > > > > >> >> > So, at the IDE point of view, I'm scared that the users
> > >>can only
> > >> > > > > >>halt
> > >> > > > > >> >>in the main thread even using a base Worker and the fix I
> > >>found, now I
> > >> > > > > >> >>wonder if we need to raise a bug in the FlashPlayer ?
> > >> > > > > >> >> > It doesn't answer to the requested message sent to a
> > >>worker:
> > >> > > > > >> >>simpleRequestResponseMessageIsolate(DMessage.OutStopDebug,
> > >> > > > > >> >>DMessage.InBreakAtExt, every, isolateId);
> > >> > > > > >> >> > 
> > >> > > > > >> >> > Frédéric THOMAS
> > >> > > > > >> >> > 
> > >> > > > > >> >> > > From: aha...@adobe.com
> > >> > > > > >> >> > > To: dev@flex.apache.org
> > >> > > > > >> >> > > Subject: Re: [FDB] Integration
> > >> > > > > >> >> > > Date: Wed, 30 Apr 2014 17:02:01 +0000
> > >> > > > > >> >> > >
> > >> > > > > >> >> > > Looks right.  Maybe capabilities.isDebugger isn't
> > >>true or
> > >> > > > > >> >>setInterval
> > >> > > > > >> >> > > doesn't work?
> > >> > > > > >> >> > >
> > >> > > > > >> >> > > You've got a new debugger, step through it. ;-)
> > >> > > > > >> >> > >
> > >> > > > > >> >> > > -Alex
> > >> > > > > >> >> > >
> > >> > > > > >> >> > > On 4/30/14 9:58 AM, "Frédéric THOMAS"
> > >><webdoubl...@hotmail.com>
> > >> > > > > >> >>wrote:
> > >> > > > > >> >> > >
> > >> > > > > >> >> > > >I created a base class that the workers extend but
> > >>doesn't seem
> > >> > > > > >>to
> > >> > > > > >> >>work,
> > >> > > > > >> >> > > >did I miss something ?
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >/**
> > >> > > > > >> >> > > > * User: DoubleFx Date: 30/04/2014 Time: 17:34
> > >> > > > > >> >> > > > */
> > >> > > > > >> >> > > >package {
> > >> > > > > >> >> > > >import flash.display.Sprite;
> > >> > > > > >> >> > > >import flash.system.Capabilities;
> > >> > > > > >> >> > > >import flash.utils.setInterval;
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >public class DebugWorker extends Sprite {
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >    public function DebugWorker() {
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >        // Stick a timer here so that we will
> > >>execute script
> > >> > > > > >>every
> > >> > > > > >> >>1.5s
> > >> > > > > >> >> > > >        // no matter what.
> > >> > > > > >> >> > > >        // This is strictly for the debugger to be
> > >>able to halt.
> > >> > > > > >> >> > > >        // Note: isDebugger is true only with a
> > >>Debugger Player.
> > >> > > > > >> >> > > >        if (Capabilities.isDebugger == true) {
> > >> > > > > >> >> > > >            setInterval(debugTickler, 1500);
> > >> > > > > >> >> > > >        }
> > >> > > > > >> >> > > >    }
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >    /**
> > >> > > > > >> >> > > >     *  @private
> > >> > > > > >> >> > > >     *  This is here so we get the this pointer set
> > >>to
> > >> > > > > >>Application.
> > >> > > > > >> >> > > >     */
> > >> > > > > >> >> > > >    private function debugTickler():void {
> > >> > > > > >> >> > > >        // We need some bytes of code in order to
> > >>have a place
> > >> > > > > >>to
> > >> > > > > >> >>break.
> > >> > > > > >> >> > > >        var i:int = 0;
> > >> > > > > >> >> > > >    }
> > >> > > > > >> >> > > >}
> > >> > > > > >> >> > > >}
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >Frédéric THOMAS
> > >> > > > > >> >> > > >
> > >> > > > > >> >> > > >> From: aha...@adobe.com
> > >> > > > > >> >> > > >> To: dev@flex.apache.org
> > >> > > > > >> >> > > >> Subject: Re: [FDB] Integration
> > >> > > > > >> >> > > >> Date: Wed, 30 Apr 2014 16:18:04 +0000
> > >> > > > > >> >> > > >>
> > >> > > > > >> >> > > >>
> > >> > > > > >> >> > > >>
> > >> > > > > >> >> > > >> On 4/30/14 8:49 AM, "Frédéric THOMAS"
> > >> > > > > >><webdoubl...@hotmail.com>
> > >> > > > > >> >>wrote:
> > >> > > > > >> >> > > >>
> > >> > > > > >> >> > > >> >Could be a solution, you meant like the idleTimer
> > >>in
> > >> > > > > >> >>SystemManager ?
> > >> > > > > >> >> > > >> Actually, I was referring to debugTickler in
> > >>Application.as
> > >> > > > > >> >>(both mx and
> > >> > > > > >> >> > > >> spark).
> > >> > > > > >> >> > > >>
> > >> > > > > >> >> > > >> -Alex
> > >> > > > > >> >> > > >>
> > >> > > > > >> >> > > >                                      
> > >> > > > > >> >> > >
> > >> > > > > >> >> >                                          
> > >> > > > > >> >>                                    
> > >> > > > > >> >                                     
> > >> > > > > >> 
> > >> > > > > >                                        
> > >> > > > > 
> > >> > > >                                    
> > >> > >                                        
> > >> >                                          
> > >>                                            
> > >                                     
> > 
>                                         
                                          

Reply via email to