[Webkit-unassigned] [Bug 93473] Web Inspector: The front-end should provide the position in original source file when set a breakpoint

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 9 00:40:05 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=93473





--- Comment #4 from Peter Wang <peter.wang at torchmobile.com.cn>  2012-08-09 00:40:25 PST ---
(In reply to comment #3)
> (In reply to comment #0)
> > I'd like to discuss here, should we provide the the position in original source file when set a breakpoint. For example, a JS statement like this:
> > [space][space][space]var[space]a=1;
> > The position in original source file is (0,3), but now front-end send (0,0) when set a breakpoint, the heading spaces are removed.
> > To accommodate it, JSC has to add code to meet the same rules of removing leading space.
> > 
> I'm not sure about JSC but in case of V8 it was that we couldn't break at some statements, e.g. if you set a breakpoint at line "var c = a + b;" it could move to line "f();". The functionality was added for cases like this but it handles setting breakpoint at a space equally well by finding nearest statement.
> 
> function f() {}
> var a = 10;
> var b = Date.now();
> var c = a + b;
> f();
> 
> So basically we could only break at call stubs, branching operators and loops. That was improved some time ago but you should keep in mind that the breakpoint can move not only because of spaces.

Thank you for your comments. 
Things of JSC are different. Roughly speaking, JSC checks if there is a breakpoint before executing each statement. Taking this as example:
var a = 10;
[whitespace][whitespace]var b = Date.now();
[whitespace]var c = a + b;
f();
JSC knows the starting positions of every statements. Showing as (line,column), they are (0,0), (1,2), (2,1), and(3,0). JSC use them to match the breakpoint record to make sure if it should stop here. In old time JSC just check the "line" so can not support "Pretty Print" debug. Now JSC also records "column" during parsing. But there is still a problem, for above piece of JS code, if we set breakpoint for every statements, the positions set by front end are (0,0), (1,0), (2,0), and(3,0), since front-end ignores the leading whitespace. So I have to change the mechanism of JSC to follow the way of front-end. I'm just worry that every time the formatter of front-end is changed, JSC must have to follow.
I'm not sure if there is a standard of position of breakpoint. If not, could we just take the original position of statement as the position of breakpoint? So that JS engine and front-end can change their way of dealing with code independently.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list