Bug 93519 - Web Inspector: implement WorkerScriptDebugServer
Summary: Web Inspector: implement WorkerScriptDebugServer
Status: RESOLVED DUPLICATE of bug 164136
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 92652 (view as bug list)
Depends on: 95334 95341
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-08 14:11 PDT by Hanna
Modified: 2016-11-17 14:37 PST (History)
14 users (show)

See Also:


Attachments
Patch (12.79 KB, patch)
2012-08-30 05:40 PDT, Peter Wang
no flags Details | Formatted Diff | Diff
The test case why we need to skip "sourceParsed" in "Parser.h" (568 bytes, application/x-gzip)
2012-09-27 04:32 PDT, Peter Wang
no flags Details
Snapshot of of the worker inspector problem caused by "sourceParsed" in "Parser.h" (34.75 KB, image/png)
2012-09-27 04:34 PDT, Peter Wang
no flags Details
Patch (13.72 KB, patch)
2012-09-27 05:00 PDT, Peter Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hanna 2012-08-08 14:11:44 PDT
WorkerScriptDebugServer is declared but not implemented in jsc, without it the worker inspector frontend is faulty
Comment 1 Hanna 2012-08-08 14:12:39 PDT
*** Bug 92652 has been marked as a duplicate of this bug. ***
Comment 2 Peter Wang 2012-08-29 06:41:43 PDT
The bug 95334 and 95341 are the existing defects that cause the worker inspector for JSC unable to work, so I put them in the independent bug record to make it easier to be reviewed. 
The patch for implementation of "WorkerScriptDebugServer" will be uploaded soon.
Comment 3 Peter Wang 2012-08-30 05:40:35 PDT
Created attachment 161450 [details]
Patch
Comment 4 Yury Semikhatsky 2012-09-24 08:44:26 PDT
Comment on attachment 161450 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=161450&action=review

> Source/JavaScriptCore/parser/Parser.h:1039
> +    if (debugger && !debugger->isWorkerDebugger() && !ParsedNode::scopeIsFunction)

How does inspector get notified about parsed scripts in case of worker if is is skipped here?

> Source/WebCore/bindings/js/ScriptDebugServer.cpp:447
> +void ScriptDebugServer::blockToWaitInstruction(bool& stop)

I'd call it runEventLoopWhilePaused

> Source/WebCore/bindings/js/ScriptDebugServer.h:117
> +    virtual void blockToWaitInstruction(bool& stop);

m_doneProcessingDebuggerEvents is a protected field, no need to pass a reference to it as an argument.

> Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp:71
> +    m_workerContext->script()->attachDebugger(this);

This should happen only when first listener is added. We should probably simplify the API as I am not aware of any cases when we may have more than one listener.

> Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp:81
> +    m_workerContext->script()->detachDebugger(this);

This should only occur when there are no listeners.

> Source/WebCore/bindings/js/WorkerScriptDebugServer.h:48
> +    bool isWorkerDebugger() { return true; }

This method should be marked virtual.
Comment 5 Peter Wang 2012-09-27 04:29:45 PDT
(In reply to comment #4)
> (From update of attachment 161450 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=161450&action=review
> 
> > Source/JavaScriptCore/parser/Parser.h:1039
> > +    if (debugger && !debugger->isWorkerDebugger() && !ParsedNode::scopeIsFunction)
> 
> How does inspector get notified about parsed scripts in case of worker if is is skipped here?
The "JSC::WorkerScriptDebugServer::addListener" invokes "recompileAllJSFunctions" which will make "JSC::Debugger::sourceParsed" to be called.
Actually, if we don't skip here, worker inspector will have a problem in some case(refer to the attachement).
> > Source/WebCore/bindings/js/ScriptDebugServer.cpp:447
> > +void ScriptDebugServer::blockToWaitInstruction(bool& stop)
> 
> I'd call it runEventLoopWhilePaused
ok.
> > Source/WebCore/bindings/js/ScriptDebugServer.h:117
> > +    virtual void blockToWaitInstruction(bool& stop);
> 
> m_doneProcessingDebuggerEvents is a protected field, no need to pass a reference to it as an argument.
ok, thx. 
> > Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp:71
> > +    m_workerContext->script()->attachDebugger(this);
> 
> This should happen only when first listener is added. We should probably simplify the API as I am not aware of any cases when we may have more than one listener.
yes, but JSC really needs interface "addListener" to inform of recompilation. 
> > Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp:81
> > +    m_workerContext->script()->detachDebugger(this);
> 
> This should only occur when there are no listeners.
ok 
> > Source/WebCore/bindings/js/WorkerScriptDebugServer.h:48
> > +    bool isWorkerDebugger() { return true; }
> 
> This method should be marked virtual.
ok.
Comment 6 Peter Wang 2012-09-27 04:32:01 PDT
Created attachment 165974 [details]
The test case why we need to skip "sourceParsed" in "Parser.h"
Comment 7 Peter Wang 2012-09-27 04:34:13 PDT
Created attachment 165975 [details]
Snapshot of of the worker inspector problem caused by "sourceParsed" in "Parser.h"
Comment 8 Peter Wang 2012-09-27 05:00:23 PDT
Created attachment 165978 [details]
Patch
Comment 9 Peter Wang 2012-10-18 22:51:36 PDT
However, the subject of this bug is confused, so I open a new bug#99801 to make it clear that what I'm going to do.
So this bug should be closed.
Comment 10 Andreas Kling 2014-02-05 10:58:52 PST
Comment on attachment 165978 [details]
Patch

Clearing review flag on patches from before 2014. If this patch is still relevant, please reset the r? flag.
Comment 11 Joseph Pecoraro 2016-11-17 14:37:13 PST

*** This bug has been marked as a duplicate of bug 164136 ***