⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287776 in webkit


Ignore:
Timestamp:
Jan 7, 2022, 12:20:58 PM (5 years ago)
Author:
Patrick Angle
Message:

Uncaught Exception: Cannot step over because debugger is not paused
https://bugs.webkit.org/show_bug.cgi?id=234575

Reviewed by Devin Rousso.

Previously keyboard shortcuts for advancing the debugger did not check to make sure that the debugger was
actually paused before attempting to step. This led to an uncaught exception in engineering builds. We now
enable and disable these keyboard shortcuts based on the whether or not the debugger is currently paused.

  • UserInterface/Base/Main.js:
Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r287770 r287776  
     12022-01-07  Patrick Angle  <pangle@apple.com>
     2
     3        Uncaught Exception: Cannot step over because debugger is not paused
     4        https://bugs.webkit.org/show_bug.cgi?id=234575
     5
     6        Reviewed by Devin Rousso.
     7
     8        Previously keyboard shortcuts for advancing the debugger did not check to make sure that the debugger was
     9        actually paused before attempting to step. This led to an uncaught exception in engineering builds. We now
     10        enable and disable these keyboard shortcuts based on the whether or not the debugger is currently paused.
     11
     12        * UserInterface/Base/Main.js:
     13
    1142022-01-07  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r286844 r287776  
    133133    // Register for events.
    134134    WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, WI._debuggerDidPause, WI);
     135    WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Resumed, WI._debuggerDidResume, WI);
    135136    WI.domManager.addEventListener(WI.DOMManager.Event.InspectModeStateChanged, WI._inspectModeStateChanged, WI);
    136137    WI.domManager.addEventListener(WI.DOMManager.Event.DOMNodeWasInspected, WI._domNodeWasInspected, WI);
     
    343344    }
    344345
     346    WI._updateDebuggerKeyboardShortcuts();
     347
    345348    WI.settingsKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Comma, WI._handleSettingsKeyboardShortcut);
    346349
     
    16701673{
    16711674    WI.showSourcesTab({showScopeChainSidebar: WI.settings.showScopeChainOnPause.value});
     1675    WI._updateDebuggerKeyboardShortcuts();
    16721676
    16731677    InspectorFrontendHost.bringToFront();
     1678};
     1679
     1680WI._debuggerDidResume = function(event)
     1681{
     1682    WI._updateDebuggerKeyboardShortcuts();
     1683};
     1684
     1685WI._updateDebuggerKeyboardShortcuts = function()
     1686{
     1687    let paused = WI.debuggerManager.paused;
     1688
     1689    WI.stepOverKeyboardShortcut.disabled = !paused;
     1690    WI.stepIntoKeyboardShortcut.disabled = !paused;
     1691    WI.stepOutKeyboardShortcut.disabled = !paused;
     1692    WI.stepOverAlternateKeyboardShortcut.disabled = !paused;
     1693    WI.stepIntoAlternateKeyboardShortcut.disabled = !paused;
     1694    WI.stepOutAlternateKeyboardShortcut.disabled = !paused;
     1695
     1696    // COMPATIBILITY (iOS 13.4): Debugger.stepNext did not exist.
     1697    if (InspectorBackend.hasCommand("Debugger.stepNext")) {
     1698        WI.stepNextKeyboardShortcut.disabled = !paused;
     1699        WI.stepNextAlternateKeyboardShortcut.disabled = !paused;
     1700    }
    16741701};
    16751702
Note: See TracChangeset for help on using the changeset viewer.