Skip to content
  • achicu@adobe.com's avatar
    Web Inspector: Crash when closing the Inspector while debugging an exception... · ff170404
    achicu@adobe.com authored
    Web Inspector: Crash when closing the Inspector while debugging an exception inside a breakpoint condition.
    https://bugs.webkit.org/show_bug.cgi?id=124078
    
    Reviewed by Joseph Pecoraro.
    
    Source/JavaScriptCore:
    
    The crash would happen because the Debugger is not designed to support nested
    breaks. For example, when the debugger handles a breakpoint and the Inspector
    executes a console command that would hit the breakpoint again, the Debugger
    will just ignore the breakpoint.
    
    There were no checks for conditions and actions. Because of that conditions and actions
    could trigger exceptions and breakpoints. This patch disables that functionality as it
    cannot be supported without a bigger rewrite of the code.
    
    * debugger/Debugger.cpp:
    (JSC::TemporaryPausedState::TemporaryPausedState):
    (JSC::TemporaryPausedState::~TemporaryPausedState):
    (JSC::Debugger::hasBreakpoint):
    (JSC::Debugger::pauseIfNeeded):
    * debugger/Debugger.h:
    
    LayoutTests:
    
    Checking that the debugger will not crash nor stall when exceptions are throw while the debugger
    is already paused. The cases when that can happen include breakpoint conditions, actions, eval
    or runtime object inspection.
    
    The current behavior was to ignore the exceptions or breakpoints while executing "console commands"
    when the debugger was already paused. I'm extending this mechanism to breakpoint conditions and
    actions as the Debugger is not designed to support nested "debugger breaks".
    
    * http/tests/inspector-protocol/resources/protocol-test.js:
    (closeTest): Avoid having internals.closeDummyInspectorFrontend and testRunner.notifyDone
    in the same function. The debugger will not have a chance to exit the temporary EventLoop
    before loading the next test.
    * inspector-protocol/debugger/breakpoint-action-detach-expected.txt: Added.
    * inspector-protocol/debugger/breakpoint-action-detach.html: Added.
    * inspector-protocol/debugger/breakpoint-action-with-exception-expected.txt: Added.
    * inspector-protocol/debugger/breakpoint-action-with-exception.html: Added.
    * inspector-protocol/debugger/breakpoint-condition-detach-expected.txt: Added.
    * inspector-protocol/debugger/breakpoint-condition-detach.html: Added.
    * inspector-protocol/debugger/breakpoint-condition-with-exception-expected.txt: Added.
    * inspector-protocol/debugger/breakpoint-condition-with-exception.html: Added.
    * inspector-protocol/debugger/breakpoint-eval-with-exception-expected.txt: Added.
    * inspector-protocol/debugger/breakpoint-eval-with-exception.html: Added.
    * inspector-protocol/debugger/breakpoint-inside-conditons-and-actions-expected.txt: Added.
    * inspector-protocol/debugger/breakpoint-inside-conditons-and-actions.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ff170404