Ignore:
Timestamp:
Apr 14, 2020, 7:35:04 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Debugger: add a Step next that steps by expression
https://bugs.webkit.org/show_bug.cgi?id=210324

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Step next is a hybrid of Step over and Step into which continues execution to the next pause
opportunity within the current (or ancestor) call frame. It is especially useful when trying
to debug minified code, such as trying to continue to c() in a() && b() && c();, where
Step over would continue to the next statement (i.e. after the ;) and Step in would
continue to the first line inside a() (and would require a Step out to get back).

  • inspector/protocol/Debugger.json:
  • inspector/agents/InspectorDebuggerAgent.h:
  • inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::InspectorDebuggerAgent::stepNext): Added.

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

(JSC::Debugger::stepNextExpression): Added.
(JSC::Debugger::atExpression):
(JSC::Debugger::clearNextPauseState):

Source/WebInspectorUI:

Step next is a hybrid of Step over and Step into which continues execution to the next pause
opportunity within the current (or ancestor) call frame. It is especially useful when trying
to debug minified code, such as trying to continue to c() in a() && b() && c();, where
Step over would continue to the next statement (i.e. after the ;) and Step in would
continue to the first line inside a() (and would require a Step out to get back).

  • UserInterface/Controllers/DebuggerManager.js:

(WI.DebuggerManager.prototype.stepNext): Added.

  • UserInterface/Base/Main.js:

(WI.contentLoaded):
(WI.debuggerStepNext): Added.

  • UserInterface/Views/SourcesNavigationSidebarPanel.js:

(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Images/StepNext.svg: Added.

LayoutTests:

  • inspector/debugger/stepping/stepNext.html: Added.
  • inspector/debugger/stepping/stepNext-expected.txt: Added.
  • inspector/debugger/stepping/stepInto.html:
  • inspector/debugger/stepping/stepInto-expected.txt:
  • inspector/debugger/stepping/stepOut.html:
  • inspector/debugger/stepping/stepOut-expected.txt:
  • inspector/debugger/stepping/stepOver.html:
  • inspector/debugger/stepping/stepOver-expected.txt:

Renamed functions for clarity and added additional test cases from other commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r255887 r260113  
    610610}
    611611
     612void Debugger::stepNextExpression()
     613{
     614    if (!m_isPaused)
     615        return;
     616
     617    m_pauseOnCallFrame = m_currentCallFrame;
     618    m_pauseOnStepNext = true;
     619    setSteppingMode(SteppingModeEnabled);
     620    notifyDoneProcessingDebuggerEvents();
     621}
     622
    612623void Debugger::stepIntoStatement()
    613624{
     
    804815    }
    805816
    806     // Only pause at the next expression with step-in and step-out, not step-over.
    807     bool shouldAttemptPause = m_pauseAtNextOpportunity || m_pauseOnStepOut;
     817    // Only pause at the next expression with step-in, step-next, and step-out.
     818    bool shouldAttemptPause = m_pauseAtNextOpportunity || m_pauseOnStepNext || m_pauseOnStepOut;
    808819
    809820    PauseReasonDeclaration reason(*this, PausedAtExpression);
     
    911922    m_pauseOnCallFrame = nullptr;
    912923    m_pauseAtNextOpportunity = false;
     924    m_pauseOnStepNext = false;
    913925    m_pauseOnStepOut = false;
    914926    m_afterBlackboxedScript = false;
Note: See TracChangeset for help on using the changeset viewer.