Changeset 169221 in webkit


Ignore:
Timestamp:
May 22, 2014 2:40:21 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

REGRESSION(r154797): Debugger crashes when stepping over an uncaught exception.
<https://webkit.org/b/133182>

Reviewed by Oliver Hunt.

Source/JavaScriptCore:
Before r154797, we used to clear the VM exception before calling into the
debugger. After r154797, we don't. This patch will restore this clearing
of the exception before calling into the debugger.

Also added assertions after returning from calls into the debugger to
ensure that the debugger did not introduce any exceptions.

  • interpreter/Interpreter.cpp:

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

  • Fixed the assertion here. Interpreter::debug() should never be called with a pending exception. Debugger callbacks for exceptions should be handled by Interpreter::unwind() and Interpreter::unwindCallFrame().

LayoutTests:

  • inspector-protocol/debugger/regress-133182-expected.txt: Added.
  • inspector-protocol/debugger/regress-133182.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169202 r169221  
     12014-05-22  Mark Lam  <mark.lam@apple.com>
     2
     3        REGRESSION(r154797): Debugger crashes when stepping over an uncaught exception.
     4        <https://webkit.org/b/133182>
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * inspector-protocol/debugger/regress-133182-expected.txt: Added.
     9        * inspector-protocol/debugger/regress-133182.html: Added.
     10
    1112014-05-22  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r169184 r169221  
     12014-05-22  Mark Lam  <mark.lam@apple.com>
     2
     3        REGRESSION(r154797): Debugger crashes when stepping over an uncaught exception.
     4        <https://webkit.org/b/133182>
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Before r154797, we used to clear the VM exception before calling into the
     9        debugger.  After r154797, we don't.  This patch will restore this clearing
     10        of the exception before calling into the debugger.
     11
     12        Also added assertions after returning from calls into the debugger to
     13        ensure that the debugger did not introduce any exceptions.
     14
     15        * interpreter/Interpreter.cpp:
     16        (JSC::unwindCallFrame):
     17        (JSC::Interpreter::unwind):
     18        (JSC::Interpreter::debug):
     19        - Fixed the assertion here.  Interpreter::debug() should never be called
     20          with a pending exception.  Debugger callbacks for exceptions should be
     21          handled by Interpreter::unwind() and Interpreter::unwindCallFrame().
     22
    1232014-05-21  Filip Pizlo  <fpizlo@apple.com>
    224
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r169139 r169221  
    448448
    449449    if (Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger()) {
     450        ClearExceptionScope scope(&callFrame->vm());
    450451        if (callFrame->callee())
    451452            debugger->returnEvent(callFrame);
    452453        else
    453454            debugger->didExecuteProgram(callFrame);
     455        ASSERT(!callFrame->hadException());
    454456    }
    455457
     
    701703        exceptionValue = jsNull();
    702704
    703     if (exceptionValue.isObject()) {
     705    if (exceptionValue.isObject())
    704706        isTermination = isTerminatedExecutionException(asObject(exceptionValue));
    705     }
    706707
    707708    ASSERT(callFrame->vm().exceptionStack().size());
     
    727728
    728729        debugger->exception(callFrame, exceptionValue, hasHandler);
     730        ASSERT(!callFrame->hadException());
    729731    }
    730732
     
    12261228    if (!debugger)
    12271229        return;
    1228     ASSERT(callFrame->codeBlock()->hasDebuggerRequests() || callFrame->hadException());
     1230
     1231    ASSERT(callFrame->codeBlock()->hasDebuggerRequests());
     1232    ASSERT(!callFrame->hadException());
    12291233
    12301234    switch (debugHookID) {
    12311235        case DidEnterCallFrame:
    12321236            debugger->callEvent(callFrame);
    1233             return;
     1237            break;
    12341238        case WillLeaveCallFrame:
    12351239            debugger->returnEvent(callFrame);
    1236             return;
     1240            break;
    12371241        case WillExecuteStatement:
    12381242            debugger->atStatement(callFrame);
    1239             return;
     1243            break;
    12401244        case WillExecuteProgram:
    12411245            debugger->willExecuteProgram(callFrame);
    1242             return;
     1246            break;
    12431247        case DidExecuteProgram:
    12441248            debugger->didExecuteProgram(callFrame);
    1245             return;
     1249            break;
    12461250        case DidReachBreakpoint:
    12471251            debugger->didReachBreakpoint(callFrame);
    1248             return;
    1249     }
     1252            break;
     1253    }
     1254    ASSERT(!callFrame->hadException());
    12501255}   
    12511256
Note: See TracChangeset for help on using the changeset viewer.