Ignore:
Timestamp:
Sep 12, 2013, 9:27:55 AM (12 years ago)
Author:
[email protected]
Message:

Change debug hooks to pass sourceID and position info via the DebuggerCallFrame.
https://bugs.webkit.org/show_bug.cgi?id=121214.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

  • debugger/Debugger.h:
  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::sourceId):
(JSC::DebuggerCallFrame::clear):

  • debugger/DebuggerCallFrame.h:

(JSC::DebuggerCallFrame::DebuggerCallFrame):
(JSC::DebuggerCallFrame::line):
(JSC::DebuggerCallFrame::column):

  • interpreter/Interpreter.cpp:

(JSC::unwindCallFrame):
(JSC::Interpreter::unwind):
(JSC::Interpreter::debug):

Source/WebCore:

No new tests.

Also changed the Inspector's JavaScriptCallFrame to get the sourceID and
position info from its DebuggerCallFrame instead of caching those values.

  • bindings/js/JavaScriptCallFrame.cpp:

(WebCore::JavaScriptCallFrame::JavaScriptCallFrame):

  • bindings/js/JavaScriptCallFrame.h:

(WebCore::JavaScriptCallFrame::create):
(WebCore::JavaScriptCallFrame::invalidate):
(WebCore::JavaScriptCallFrame::sourceID):
(WebCore::JavaScriptCallFrame::position):
(WebCore::JavaScriptCallFrame::line):
(WebCore::JavaScriptCallFrame::column):
(WebCore::JavaScriptCallFrame::update):

  • bindings/js/ScriptDebugServer.cpp:

(WebCore::ScriptDebugServer::createCallFrame):
(WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded):
(WebCore::ScriptDebugServer::callEvent):
(WebCore::ScriptDebugServer::atStatement):
(WebCore::ScriptDebugServer::returnEvent):
(WebCore::ScriptDebugServer::exception):
(WebCore::ScriptDebugServer::willExecuteProgram):
(WebCore::ScriptDebugServer::didExecuteProgram):
(WebCore::ScriptDebugServer::didReachBreakpoint):

  • bindings/js/ScriptDebugServer.h:
  • bindings/js/WorkerScriptDebugServer.cpp:

(WebCore::WorkerScriptDebugServer::willExecuteProgram):

  • bindings/js/WorkerScriptDebugServer.h:

Source/WebKit/mac:

  • webview/WebScriptDebugger.h:
  • WebView/WebScriptDebugger.mm:

(WebScriptDebugger::WebScriptDebugger):
(WebScriptDebugger::callEvent):
(WebScriptDebugger::atStatement):
(WebScriptDebugger::returnEvent):
(WebScriptDebugger::exception):
(WebScriptDebugger::willExecuteProgram):
(WebScriptDebugger::didExecuteProgram):
(WebScriptDebugger::didReachBreakpoint):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r155494 r155622  
    398398
    399399    if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) {
    400         DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
     400        int line = codeBlock->ownerExecutable()->lastLine();
     401        DebuggerCallFrame debuggerCallFrame(callFrame, line, 0, exceptionValue);
    401402        if (callFrame->callee())
    402             debugger->returnEvent(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->lastLine(), 0);
     403            debugger->returnEvent(debuggerCallFrame);
    403404        else
    404             debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->lastLine(), 0);
     405            debugger->didExecuteProgram(debuggerCallFrame);
    405406    }
    406407
     
    655656        // Afterwards, the values are put back to continue processing this error.
    656657        ClearExceptionScope scope(&callFrame->vm());
    657         DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue);
     658        int line = codeBlock->lineNumberForBytecodeOffset(bytecodeOffset);
     659        int column = codeBlock->columnNumberForBytecodeOffset(bytecodeOffset);
     660        DebuggerCallFrame debuggerCallFrame(callFrame, line, column, exceptionValue);
    658661
    659662        bool hasHandler;
     
    666669        }
    667670
    668         debugger->exception(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), 0, hasHandler);
     671        debugger->exception(debuggerCallFrame, hasHandler);
    669672    }
    670673
     
    12541257    switch (debugHookID) {
    12551258        case DidEnterCallFrame:
    1256             debugger->callEvent(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), firstLine, column);
     1259            debugger->callEvent(DebuggerCallFrame(callFrame, firstLine, column));
    12571260            return;
    12581261        case WillLeaveCallFrame:
    1259             debugger->returnEvent(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), lastLine, column);
     1262            debugger->returnEvent(DebuggerCallFrame(callFrame, lastLine, column));
    12601263            return;
    12611264        case WillExecuteStatement:
    1262             debugger->atStatement(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), firstLine, column);
     1265            debugger->atStatement(DebuggerCallFrame(callFrame, firstLine, column));
    12631266            return;
    12641267        case WillExecuteProgram:
    1265             debugger->willExecuteProgram(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), firstLine, column);
     1268            debugger->willExecuteProgram(DebuggerCallFrame(callFrame, firstLine, column));
    12661269            return;
    12671270        case DidExecuteProgram:
    1268             debugger->didExecuteProgram(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), lastLine, column);
     1271            debugger->didExecuteProgram(DebuggerCallFrame(callFrame, lastLine, column));
    12691272            return;
    12701273        case DidReachBreakpoint:
    1271             debugger->didReachBreakpoint(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), lastLine, column);
     1274            debugger->didReachBreakpoint(DebuggerCallFrame(callFrame, lastLine, column));
    12721275            return;
    12731276    }
Note: See TracChangeset for help on using the changeset viewer.