[Webkit-unassigned] [Bug 53003] Web Inspector: [JSC] implement setting breakpoints by line:column

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 11 01:03:16 PDT 2012


--- Comment #26 from Pavel Feldman <pfeldman at chromium.org>  2012-06-11 01:03:14 PST ---
(From update of attachment 145731)
View in context: https://bugs.webkit.org/attachment.cgi?id=145731&action=review

>>> Source/WebCore/ChangeLog:6
>>> +        RIM PR https://bugzilla.qnx.com/bugzilla/show_bug.cgi?id=152507 depends on this bug.
>> What is RIM PR?
> It's Problem Report of the BlackBerry Browser. Our Browser cannot support "Pretty print" mode of JS debugging because of this bug of webkit.

Ok, it sounds like we should disable setting breakpoints on formatted scripts in JSC for now.

>>> Source/WebCore/bindings/js/ScriptDebugServer.cpp:171
>>> +            m_lastHitScriptBreakpoints.append(breaksVector.at(i));
>> So at first, you will go here and consider that you should stop on breakpoint no matter whether its position matches the breakpoint column? This looks wrong.
>> If you set a breakpoint in the formatted script (which originally was a single javascript line), it will map to say line 1, column 42. Then every statement regardless of the offset will be finding this breakpoint and stopping on it.
> The information in breaksVector is accurate since it come from Frontend. In the webpage of Inspector the script calculates the breakpoint's position and sends message, finally the setBreakpoints is invoked and save it in breaksVector. 
> The problem is that in hasBreakpoints we only know which line we are. So we using m_lastHitScriptBreakpoints to calculate which breakpoint in this line should be toggled. And this breakpoint also should be recorded as recent toggled breakpoints.

I don't understand how it works though. Consider following JavaScript snippet:
var a = 0; var b = 0; var c = a + b;

in formatted mode, it is:
var a = 0;
var b = 0;
var c = a + b;  <-- now set breakpoint in this line

it ends up line = 0; column = 22;

JSC starts interpretation of "var a = 0;" at [0, 0] and hasBreakpoint request is made with line 0. You fetch all breakpoints for this line including the one we set above. Then you get to this place of code (since j == hitBreaksCount == 0) and stop on that breakpoint. As a result, instead of stopping on "var c = a + b" you stop on "var a = 0".

What do I miss here?

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