Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [atf-dev] Browser Window is always disabled when suspended at a js breakpoint

Thanks Adam for the insight. 

So I guess the ATF debugger implementation likely assumes that the browser window will stay disabled and enabling it could cause some unexpected behavior. 

Thanks again,
Greg

On 7/23/07, Adam L. Peller <adam@xxxxxxxxxx> wrote:
Greg,

I haven't been involved in the debugger implementation for a while,
but iirc this line was required because if you did not disable the
browser window, the user clicking on the "suspended" browser could
actually kick off DOM events and spur _javascript_ code.  I believe this
is the same pattern used by Venkman, which at the time was the only
other debugger using the jsd APIs.

I think we may have had to do several different things to actually
achieve the suspended state, including putting some blocking code on
the stack.  Unfortunately, this made it impossible to allow debugging
in multiple browsers.  I don't believe Venkman or the jsd API really
supported this at the time.

Regards,
Adam

> Snippet taken from
> org.eclipse.atf.mozilla.ide.debug.internal.model.JSDebugThread.java lines
> 482-489.  This happens in the "onExecute" hook function.
> nsIBaseWindow window =
> (nsIBaseWindow)getDebugTarget().getProcess().getAdapter(nsIBaseWindow.class
> );
> try {
>     // Prevent user from taking further actions within the browser while
> suspended
>     window.setEnabled(false);
> } catch (XPCOMException xpcome) {
>     if (xpcome.errorcode != Mozilla.NS_ERROR_NOT_IMPLEMENTED)
>         throw xpcome;
> }
>
> This is the code I'm referring too which will disable the Browsre window
> that the currently paused _javascript_ thread is executing in.  If I simply
> comment out that line, then the browser works as expected.  So it seems that
> a deliberate decision was made to "turn off" the browser window where the
> current _javascript_ debugger is suspended at.
>
> Any thoughts?  I think my 2 questions that I posted before will make more
> sense now if you look at that snippet I posted.
>
> Thanks for your response,
> Greg
>
> On 7/23/07, Robert Goodman <goodmanr@xxxxxxxxxx> wrote:
> >
> >
> > Greg
> >
> > ATF isn't doing anything to disable the other browser. The behavior you
> > described seems to be a limitation of the Mozilla debug interface and the
> > fact that everything  in eclipse is running in the same process. We have
> > tried to work around the problem but don't have a solution yet. The hang is
> > occurring in the XULRunner browser. One of the thing we want to do, but
> > haven't had time is pull XULRunner into the c debugger and see if we can
> > find why the hang is occurring. This may gives us some hints on how to work
> > around the problem.
> >
> >    Thanks
> >      Bob
> >
> > Robert Goodman
> > goodmanr@xxxxxxxxxx
> >
> >
> >
> >  *"Greg Amerson" <gamerson@xxxxxxxxx>*
> > Sent by: atf-dev-bounces@xxxxxxxxxxx
> >
> > 07/23/2007 12:47 PM  Please respond to
> > AJAX Toolkit Framework discussion <atf-dev@xxxxxxxxxxx>
> >
> >   To
> > atf-dev@xxxxxxxxxxx  cc
> >
> >  Subject
> > [atf-dev] Browser Window is always disabled when suspended at a js
> >  breakpoint
> >
> >
> >
> >
> >
> >
> > Hello,
> >
> > Nice job on the current _javascript_ debugger implementation.  Its been
> > awhile since I have looked at it and it now has some really nice stuff in
> > there.  I've been getting up-to-speed with how it interacts with the Mozilla
> > browser when stepping through _javascript_ code.  One thing I noticed is that
> > when you are suspended at a _javascript_ breakpoint, all user-input is
> > disabled for the associated browser window.  I found this in the code at
> > JSDebugThread.java line 485.  In a comment it states that the user is
> > being prevented from further actions within the browser while suspended.
> >
> > There are 2 questions that I have regarding this behavior, that I would
> > like some feedback on:
> > 1.        What was the reasoning or what discussion led to this policy
> > decision of always disabling the browser window?
> >
> > 2.        Are there any other factors in the _javascript_ debugger that make
> > the window browser being disabled a requirement?
> > One reason I asked #2 is because, lets say, that I wanted to change it so
> > the browser window is always enabled.  Would there be any side-effects or
> > other consequences of that choice?
> >
> > Thanks again guys for making this _javascript_ debugger implementation
> > available for us to have these discussions.  I appreciate any response.
> >
> > Greg_______________________________________________
> > atf-dev mailing list
> > atf-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/atf-dev
> >
> >
> > _______________________________________________
> > atf-dev mailing list
> > atf-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/atf-dev
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: https://dev.eclipse.org/mailman/listinfo/atf-dev/attachments/20070723/41828c56/attachment.html
>
> ------------------------------
>
> _______________________________________________
> atf-dev mailing list
> atf-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/atf-dev
>
>
> End of atf-dev Digest, Vol 16, Issue 13
> ***************************************
>
_______________________________________________
atf-dev mailing list
atf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/atf-dev


Back to the top