2011-02-14 Pavel Podivilov <podivilov@chromium.org>
authorpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Feb 2011 16:40:10 +0000 (16:40 +0000)
committerpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Feb 2011 16:40:10 +0000 (16:40 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: use call frame column to determine execution line in source frame.
        https://bugs.webkit.org/show_bug.cgi?id=54001

        * http/tests/inspector/debugger-test.js:
        (initialize_DebuggerTest.InspectorTest.captureStackTrace):
2011-02-14  Pavel Podivilov  <podivilov@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: use call frame column to determine execution line in source frame.
        https://bugs.webkit.org/show_bug.cgi?id=54001

        * wtf/text/TextPosition.h:
        (WTF::ZeroBasedNumber::convertAsOneBasedInt):
2011-02-14  Pavel Podivilov  <podivilov@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: use call frame column to determine execution line in source frame.
        https://bugs.webkit.org/show_bug.cgi?id=54001

        - Make call frame line and column zero based
        - Set execution line in source frame based on call frame line:column
        - Determine currently hit breakpoint based on call frame line:column

        * bindings/js/JavaScriptCallFrame.cpp:
        (WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
        * bindings/js/JavaScriptCallFrame.h:
        (WebCore::JavaScriptCallFrame::create):
        (WebCore::JavaScriptCallFrame::line):
        (WebCore::JavaScriptCallFrame::column):
        (WebCore::JavaScriptCallFrame::update):
        * bindings/js/ScriptDebugServer.cpp:
        (WebCore::ScriptDebugServer::createCallFrameAndPauseIfNeeded):
        (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded):
        * bindings/v8/DebuggerScript.js:
        ():
        * inspector/front-end/BreakpointsSidebarPane.js:
        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype._debuggerPaused):
        * inspector/front-end/CallStackSidebarPane.js:
        (WebInspector.CallStackSidebarPane.prototype.update):
        * inspector/front-end/DebuggerModel.js:
        (WebInspector.DebuggerModel.prototype.continueToLocation):
        (WebInspector.DebuggerModel.prototype._pausedScript):
        (WebInspector.DebuggerModel.prototype._breakpointForCallFrame):
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype._debuggerPaused):
        (WebInspector.ScriptsPanel.prototype._clearCurrentExecutionLine):
        (WebInspector.ScriptsPanel.prototype._callFrameSelected):
        * inspector/front-end/SourceFrame.js:
        (WebInspector.SourceFrame.prototype._setTextViewerDecorations):
        (WebInspector.SourceFrame.prototype.setExecutionLocation):
        (WebInspector.SourceFrame.prototype.clearExecutionLocation):
        (WebInspector.SourceFrame.prototype._setExecutionLocation):
        (WebInspector.SourceFrame.prototype._breakpointAdded):
        (WebInspector.SourceFrame.prototype._continueToLine):
        (WebInspector.SourceFrame.prototype._originalLocationToTextViewerLineNumber):
2011-02-14  Pavel Podivilov  <podivilov@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: use call frame column to determine execution line in source frame.
        https://bugs.webkit.org/show_bug.cgi?id=54001

        * src/js/Tests.js:
        (.TestSuite.prototype._checkExecutionLine):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78482 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/debugger-test.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/text/TextPosition.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JavaScriptCallFrame.cpp
Source/WebCore/bindings/js/JavaScriptCallFrame.h
Source/WebCore/bindings/js/ScriptDebugServer.cpp
Source/WebCore/bindings/js/ScriptDebugServer.h
Source/WebCore/bindings/v8/DebuggerScript.js
Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
Source/WebCore/inspector/front-end/CallStackSidebarPane.js
Source/WebCore/inspector/front-end/DebuggerModel.js
Source/WebCore/inspector/front-end/ScriptsPanel.js
Source/WebCore/inspector/front-end/SourceFrame.js
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/js/Tests.js

index 797bf64..55ae28b 100644 (file)
@@ -1,3 +1,13 @@
+2011-02-14  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: use call frame column to determine execution line in source frame.
+        https://bugs.webkit.org/show_bug.cgi?id=54001
+
+        * http/tests/inspector/debugger-test.js:
+        (initialize_DebuggerTest.InspectorTest.captureStackTrace):
+
 2011-02-14  Pavel Feldman  <pfeldman@chromium.org>
 
         Not reviewed: chromium expectations update.
index 6efd919..422f5c6 100644 (file)
@@ -85,7 +85,7 @@ InspectorTest.captureStackTrace = function(callFrames)
         var script = WebInspector.debuggerModel.scriptForSourceID(frame.sourceID);
         var scriptOrResource = script.resource || script;
         var url = scriptOrResource && WebInspector.displayNameForURL(scriptOrResource.sourceURL || scriptOrResource.url);
-        var s = "    " + i + ") " + frame.functionName + " (" + url + ":" + frame.line + ")";
+        var s = "    " + i + ") " + frame.functionName + " (" + url + ":" + (frame.line + 1) + ")";
         InspectorTest.addResult(s);
     }
 };
index 12e0cfd..4af08d6 100644 (file)
@@ -1,3 +1,13 @@
+2011-02-14  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: use call frame column to determine execution line in source frame.
+        https://bugs.webkit.org/show_bug.cgi?id=54001
+
+        * wtf/text/TextPosition.h:
+        (WTF::ZeroBasedNumber::convertAsOneBasedInt):
+
 2011-02-13  Jeremy Moskovich  <jeremy@chromium.org>
 
         Reviewed by Adam Barth.
index 9f426ea..bb3ffa4 100644 (file)
@@ -89,7 +89,7 @@ public:
     ZeroBasedNumber() {}
 
     int zeroBasedInt() const { return m_value; }
-
+    int convertAsOneBasedInt() const { return m_value + 1; }
     OneBasedNumber convertToOneBased() const;
 
     bool operator==(ZeroBasedNumber other) { return m_value == other.m_value; }
index 5d2acb0..0ba525d 100644 (file)
@@ -1,3 +1,47 @@
+2011-02-14  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: use call frame column to determine execution line in source frame.
+        https://bugs.webkit.org/show_bug.cgi?id=54001
+
+        - Make call frame line and column zero based
+        - Set execution line in source frame based on call frame line:column
+        - Determine currently hit breakpoint based on call frame line:column
+
+        * bindings/js/JavaScriptCallFrame.cpp:
+        (WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
+        * bindings/js/JavaScriptCallFrame.h:
+        (WebCore::JavaScriptCallFrame::create):
+        (WebCore::JavaScriptCallFrame::line):
+        (WebCore::JavaScriptCallFrame::column):
+        (WebCore::JavaScriptCallFrame::update):
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::createCallFrameAndPauseIfNeeded):
+        (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded):
+        * bindings/v8/DebuggerScript.js:
+        ():
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype._debuggerPaused):
+        * inspector/front-end/CallStackSidebarPane.js:
+        (WebInspector.CallStackSidebarPane.prototype.update):
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel.prototype.continueToLocation):
+        (WebInspector.DebuggerModel.prototype._pausedScript):
+        (WebInspector.DebuggerModel.prototype._breakpointForCallFrame):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._debuggerPaused):
+        (WebInspector.ScriptsPanel.prototype._clearCurrentExecutionLine):
+        (WebInspector.ScriptsPanel.prototype._callFrameSelected):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._setTextViewerDecorations):
+        (WebInspector.SourceFrame.prototype.setExecutionLocation):
+        (WebInspector.SourceFrame.prototype.clearExecutionLocation):
+        (WebInspector.SourceFrame.prototype._setExecutionLocation):
+        (WebInspector.SourceFrame.prototype._breakpointAdded):
+        (WebInspector.SourceFrame.prototype._continueToLine):
+        (WebInspector.SourceFrame.prototype._originalLocationToTextViewerLineNumber):
+
 2011-02-14  Christian Dywan  <christian@lanedo.com>
 
         Reviewed by Gustavo Noronha Silva.
index cc6986a..ced7d85 100644 (file)
@@ -42,7 +42,7 @@ using namespace JSC;
 
 namespace WebCore {
     
-JavaScriptCallFrame::JavaScriptCallFrame(const DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, const TextPosition1& textPosition)
+JavaScriptCallFrame::JavaScriptCallFrame(const DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, const TextPosition0& textPosition)
     : m_debuggerCallFrame(debuggerCallFrame)
     , m_caller(caller)
     , m_sourceID(sourceID)
index 74e0a70..b693968 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore {
 
 class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame> {
 public:
-    static PassRefPtr<JavaScriptCallFrame> create(const JSC::DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, const TextPosition1& textPosition)
+    static PassRefPtr<JavaScriptCallFrame> create(const JSC::DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, const TextPosition0& textPosition)
     {
         return adoptRef(new JavaScriptCallFrame(debuggerCallFrame, caller, sourceID, textPosition));
     }
@@ -55,10 +55,11 @@ public:
     JavaScriptCallFrame* caller();
 
     intptr_t sourceID() const { return m_sourceID; }
-    int line() const { return m_textPosition.m_line.oneBasedInt(); }
-    int column() const { return m_textPosition.m_column.oneBasedInt(); }
+    const TextPosition0& position() const { return m_textPosition; }
+    int line() const { return m_textPosition.m_line.zeroBasedInt(); }
+    int column() const { return m_textPosition.m_column.zeroBasedInt(); }
 
-    void update(const JSC::DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, const TextPosition1& textPosition)
+    void update(const JSC::DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, const TextPosition0& textPosition)
     {
         m_debuggerCallFrame = debuggerCallFrame;
         m_textPosition = textPosition;
@@ -75,12 +76,12 @@ public:
     JSC::JSValue evaluate(const JSC::UString& script, JSC::JSValue& exception) const;
     
 private:
-    JavaScriptCallFrame(const JSC::DebuggerCallFrame&, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, const TextPosition1&);
+    JavaScriptCallFrame(const JSC::DebuggerCallFrame&, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, const TextPosition0&);
 
     JSC::DebuggerCallFrame m_debuggerCallFrame;
     RefPtr<JavaScriptCallFrame> m_caller;
     intptr_t m_sourceID;
-    TextPosition1 m_textPosition;
+    TextPosition0 m_textPosition;
     bool m_isValid;
 };
 
index aed2ad4..5c52dd7 100644 (file)
@@ -159,7 +159,7 @@ void ScriptDebugServer::removeBreakpoint(const String& breakpointId)
         it->second.remove(lineNumber + 1);
 }
 
-bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const
+bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, const TextPosition0& position) const
 {
     if (!m_breakpointsActivated)
         return false;
@@ -167,6 +167,9 @@ bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) co
     SourceIdToBreakpointsMap::const_iterator it = m_sourceIdToBreakpoints.find(sourceID);
     if (it == m_sourceIdToBreakpoints.end())
         return false;
+    int lineNumber = position.m_line.convertAsOneBasedInt();
+    if (lineNumber <= 0)
+        return false;
     LineToBreakpointMap::const_iterator breakIt = it->second.find(lineNumber);
     if (breakIt == it->second.end() || !breakIt->second.enabled)
         return false;
@@ -432,7 +435,7 @@ void ScriptDebugServer::setJavaScriptPaused(FrameView* view, bool paused)
 
 void ScriptDebugServer::createCallFrameAndPauseIfNeeded(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
 {
-    TextPosition1 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber), WTF::OneBasedNumber::base());
+    TextPosition0 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber).convertToZeroBased(), WTF::ZeroBasedNumber::base());
     m_currentCallFrame = JavaScriptCallFrame::create(debuggerCallFrame, m_currentCallFrame, sourceID, textPosition);
     pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
 }
@@ -443,7 +446,7 @@ void ScriptDebugServer::updateCallFrameAndPauseIfNeeded(const DebuggerCallFrame&
     if (!m_currentCallFrame)
         return;
 
-    TextPosition1 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber), WTF::OneBasedNumber::base());
+    TextPosition0 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber).convertToZeroBased(), WTF::ZeroBasedNumber::base());
     m_currentCallFrame->update(debuggerCallFrame, sourceID, textPosition);
     pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
 }
@@ -458,7 +461,7 @@ void ScriptDebugServer::pauseIfNeeded(Page* page)
 
     bool pauseNow = m_pauseOnNextStatement;
     pauseNow |= (m_pauseOnCallFrame == m_currentCallFrame);
-    pauseNow |= (m_currentCallFrame->line() > 0 && hasBreakpoint(m_currentCallFrame->sourceID(), m_currentCallFrame->line()));
+    pauseNow |= hasBreakpoint(m_currentCallFrame->sourceID(), m_currentCallFrame->position());
     if (!pauseNow)
         return;
 
index 428b254..e7e8502 100644 (file)
@@ -42,6 +42,7 @@
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
 #include <wtf/RefPtr.h>
+#include <wtf/text/TextPosition.h>
 
 namespace JSC {
 class DebuggerCallFrame;
@@ -100,7 +101,7 @@ private:
     ScriptDebugServer();
     ~ScriptDebugServer();
 
-    bool hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const;
+    bool hasBreakpoint(intptr_t sourceID, const TextPosition0& position) const;
     bool hasListenersInterestedInPage(Page*);
 
     void setJavaScriptPaused(const PageGroup&, bool paused);
index 1798352..0bed33d 100644 (file)
@@ -203,8 +203,6 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
 
     // Get location.
     var location  = frameMirror.sourceLocation();
-    var line = DebuggerScript._v8ToWebkitLineNumber(location.line);
-    var column = DebuggerScript._v8ToWebkitLineNumber(location.column);
 
     // Get this object.
     var thisObject = frameMirror.details_.receiver();
@@ -251,8 +249,8 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
 
     return {
         "sourceID": sourceID,
-        "line": line,
-        "column": column,
+        "line": location.line,
+        "column": location.column,
         "functionName": functionName,
         "type": "function",
         "thisObject": thisObject,
@@ -263,11 +261,6 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
     };
 }
 
-DebuggerScript._v8ToWebkitLineNumber = function(line)
-{
-    return line + 1;
-};
-
 return DebuggerScript;
 
 })();
index 0a47bf8..0c46463 100644 (file)
@@ -143,10 +143,10 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = {
 
     _debuggerPaused: function(event)
     {
-        var breakpointId = this._breakpointIdForDebuggerPausedEvent(event.data);
-        if (!breakpointId)
+        var breakpoint = event.data.breakpoint;
+        if (!breakpoint)
             return;
-        var breakpointItem = this._items[breakpointId];
+        var breakpointItem = this._items[breakpoint.id];
         if (!breakpointItem)
             return;
         breakpointItem.element.addStyleClass("breakpoint-hit");
@@ -236,14 +236,6 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = {
         element.addEventListener("click", clickHandler, false);
     },
 
-    _breakpointIdForDebuggerPausedEvent: function(details)
-    {
-        var callFrame = details.callFrames[0];
-        var breakpoint = WebInspector.debuggerModel.findBreakpoint(callFrame.sourceID, callFrame.line);
-        if (breakpoint)
-            return breakpoint.id;
-   },
-
     _removeBreakpoint: function(breakpointId)
     {
         WebInspector.debuggerModel.removeBreakpoint(breakpointId);
index 503e5f4..e9cfc64 100644 (file)
@@ -29,14 +29,14 @@ WebInspector.CallStackSidebarPane = function()
 }
 
 WebInspector.CallStackSidebarPane.prototype = {
-    update: function(callFrames, eventType, eventData)
+    update: function(details)
     {
         this.bodyElement.removeChildren();
 
         this.placards = [];
         delete this._selectedCallFrame;
 
-        if (!callFrames) {
+        if (!details) {
             var infoElement = document.createElement("div");
             infoElement.className = "info";
             infoElement.textContent = WebInspector.UIString("Not Paused");
@@ -44,6 +44,7 @@ WebInspector.CallStackSidebarPane.prototype = {
             return;
         }
 
+        var callFrames = details.callFrames;
         var title;
         var subtitle;
         var script;
@@ -81,10 +82,10 @@ WebInspector.CallStackSidebarPane.prototype = {
             this.bodyElement.appendChild(placard.element);
         }
 
-        if (WebInspector.debuggerModel.findBreakpoint(callFrames[0].sourceID, callFrames[0].line))
+        if (details.breakpoint)
             this._scriptBreakpointHit();
-        else if (eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint)
-            this._nativeBreakpointHit(eventData);
+        else if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint)
+            this._nativeBreakpointHit(details.eventData);
     },
 
     get selectedCallFrame()
@@ -94,9 +95,6 @@ WebInspector.CallStackSidebarPane.prototype = {
 
     set selectedCallFrame(x)
     {
-        if (this._selectedCallFrame === x)
-            return;
-
         this._selectedCallFrame = x;
 
         for (var i = 0; i < this.placards.length; ++i) {
index 1bf1e47..3384c34 100644 (file)
@@ -71,9 +71,9 @@ WebInspector.DebuggerModel.prototype = {
         InspectorBackend.disableDebugger();
     },
 
-    continueToLine: function(sourceID, lineNumber)
+    continueToLocation: function(sourceID, lineNumber, columnNumber)
     {
-        InspectorBackend.continueToLocation(sourceID, lineNumber, 0);
+        InspectorBackend.continueToLocation(sourceID, lineNumber, columnNumber);
     },
 
     setBreakpoint: function(url, lineNumber, columnNumber, condition, enabled)
@@ -173,17 +173,6 @@ WebInspector.DebuggerModel.prototype = {
         return breakpoints;
     },
 
-    findBreakpoint: function(sourceID, lineNumber)
-    {
-        for (var id in this._breakpoints) {
-            var locations = this._breakpoints[id].locations;
-            for (var i = 0; i < locations.length; ++i) {
-                if (locations[i].sourceID == sourceID && locations[i].lineNumber + 1 === lineNumber)
-                    return this._breakpoints[id];
-            }
-        }
-    },
-
     reset: function()
     {
         this._paused = false;
@@ -286,6 +275,7 @@ WebInspector.DebuggerModel.prototype = {
     {
         this._paused = true;
         this._callFrames = details.callFrames;
+        details.breakpoint = this._breakpointForCallFrame(details.callFrames[0]);
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerPaused, details);
     },
 
@@ -296,6 +286,23 @@ WebInspector.DebuggerModel.prototype = {
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerResumed);
     },
 
+    _breakpointForCallFrame: function(callFrame)
+    {
+        function match(location)
+        {
+            if (location.sourceID != callFrame.sourceID)
+                return false;
+            return location.lineNumber === callFrame.line && location.columnNumber === callFrame.column;
+        }
+        for (var id in this._breakpoints) {
+            var breakpoint = this._breakpoints[id];
+            for (var i = 0; i < breakpoint.locations.length; ++i) {
+                if (match(breakpoint.locations[i]))
+                    return breakpoint;
+            }
+        }
+    },
+
     _parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType)
     {
         var script = new WebInspector.Script(sourceID, sourceURL, "", lineOffset, columnOffset, length, undefined, undefined, scriptWorldType);
index 4f556cd..3b24d45 100644 (file)
@@ -377,7 +377,7 @@ WebInspector.ScriptsPanel.prototype = {
 
         WebInspector.currentPanel = this;
 
-        this.sidebarPanes.callstack.update(callFrames, event.data.eventType, event.data.eventData);
+        this.sidebarPanes.callstack.update(event.data);
         this.sidebarPanes.callstack.selectedCallFrame = callFrames[0];
 
         window.focus();
@@ -666,7 +666,7 @@ WebInspector.ScriptsPanel.prototype = {
     _clearCurrentExecutionLine: function()
     {
         if (this._executionSourceFrame)
-            this._executionSourceFrame.clearExecutionLine();
+            this._executionSourceFrame.clearExecutionLocation();
         delete this._executionSourceFrame;
     },
 
@@ -688,7 +688,7 @@ WebInspector.ScriptsPanel.prototype = {
 
         this._executionSourceFrame = this._sourceFrameForScriptOrResource(scriptOrResource);
         if (this._executionSourceFrame)
-            this._executionSourceFrame.setExecutionLine(currentFrame.line);
+            this._executionSourceFrame.setExecutionLocation(currentFrame.line, currentFrame.column);
     },
 
     _changeVisibleFile: function(event)
index abc2051..6b4b3b3 100644 (file)
@@ -222,8 +222,8 @@ WebInspector.SourceFrame.prototype = {
         this._addExistingMessagesToSource();
         this._updateDiffDecorations();
 
-        if (this._executionLine)
-            this.setExecutionLine(this._executionLine);
+        if (this._executionLocation)
+            this._setExecutionLocation();
 
         this._breakpointIdToTextViewerLineNumber = {};
         this._textViewerLineNumberToBreakpointId = {};
@@ -361,22 +361,26 @@ WebInspector.SourceFrame.prototype = {
         msg._resourceMessageRepeatCountElement.textContent = WebInspector.UIString(" (repeated %d times)", msg.repeatCount);
     },
 
-    setExecutionLine: function(lineNumber)
+    setExecutionLocation: function(lineNumber, columnNumber)
     {
-        this._executionLine = lineNumber;
-        if (!this._textViewer)
-            return;
-        var textViewerLineNumber = this._content.actualLocationToSourceFrameLineNumber(this._executionLine - 1, 0);
-        this._textViewer.addDecoration(textViewerLineNumber, "webkit-execution-line");
+        this._executionLocation = { lineNumber: lineNumber, columnNumber: columnNumber };
+        if (this._textViewer)
+            this._setExecutionLocation();
     },
 
-    clearExecutionLine: function()
+    clearExecutionLocation: function()
     {
-        if (!this._textViewer)
-            return;
-        var textViewerLineNumber = this._content.actualLocationToSourceFrameLineNumber(this._executionLine - 1, 0);
-        this._textViewer.removeDecoration(textViewerLineNumber, "webkit-execution-line");
-        delete this._executionLine;
+        if (this._textViewer) {
+            var textViewerLineNumber = this._content.actualLocationToSourceFrameLineNumber(this._executionLocation.lineNumber, this._executionLocation.columnNumber);
+            this._textViewer.removeDecoration(textViewerLineNumber, "webkit-execution-line");
+        }
+        delete this._executionLocation;
+    },
+
+    _setExecutionLocation: function()
+    {
+        var textViewerLineNumber = this._content.actualLocationToSourceFrameLineNumber(this._executionLocation.lineNumber, this._executionLocation.columnNumber);
+        this._textViewer.addDecoration(textViewerLineNumber, "webkit-execution-line");
     },
 
     _updateDiffDecorations: function()
@@ -863,7 +867,7 @@ WebInspector.SourceFrame.prototype = {
     {
         var location = this._content.sourceFrameLineNumberToActualLocation(lineNumber);
         if (location.sourceID)
-            WebInspector.debuggerModel.continueToLine(location.sourceID, location.lineNumber);
+            WebInspector.debuggerModel.continueToLocation(location.sourceID, location.lineNumber, location.columnNumber);
     },
 
     _doubleClick: function(event)
index 1cb0068..dae068a 100644 (file)
@@ -1,3 +1,13 @@
+2011-02-14  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: use call frame column to determine execution line in source frame.
+        https://bugs.webkit.org/show_bug.cgi?id=54001
+
+        * src/js/Tests.js:
+        (.TestSuite.prototype._checkExecutionLine):
+
 2011-02-11  Zhenyao Mo  <zmo@google.com>
 
         Reviewed by Kenneth Russell.
index f155e08..bb8fa60 100644 (file)
@@ -616,7 +616,7 @@ TestSuite.prototype.evaluateInConsole_ = function(code, callback)
  */
 TestSuite.prototype._checkExecutionLine = function(sourceFrame, lineNumber, lineContent)
 {
-    this.assertEquals(lineNumber, sourceFrame._executionLine, "Unexpected execution line number.");
+    this.assertEquals(lineNumber, sourceFrame._executionLocation.lineNumber + 1, "Unexpected execution line number.");
     this.assertEquals(lineContent, sourceFrame._textModel.line(lineNumber - 1), "Unexpected execution line text.");
 }