Changeset 207444 in webkit
- Timestamp:
- Oct 17, 2016 5:36:12 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207440 r207444 1 2016-10-17 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Add toggles for debugger pauses at console.assert failures 4 https://bugs.webkit.org/show_bug.cgi?id=139542 5 <rdar://problem/19281600> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/debugger/pause-on-assert.html: 10 * inspector/debugger/pause-reason.html: 11 These tests need to enable pause on assertions. 12 13 * inspector/debugger/setPauseOnAssertions-expected.txt: Added. 14 * inspector/debugger/setPauseOnAssertions.html: Added. 15 Specific tests for the new protocol method. 16 1 17 2016-10-17 Ryan Haddad <ryanhaddad@apple.com> 2 18 -
trunk/LayoutTests/inspector/debugger/pause-on-assert.html
r199592 r207444 9 9 InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true}); 10 10 InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError); 11 InspectorProtocol.sendCommand("Debugger.setPauseOnAssertions", {enabled: true}, InspectorProtocol.checkForError); 11 12 12 13 var step = null; -
trunk/LayoutTests/inspector/debugger/pause-reason.html
r202783 r207444 48 48 49 49 WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false; 50 WebInspector.debuggerManager.assertionsBreakpoint.disabled = false; 50 51 51 52 WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) { -
trunk/Source/JavaScriptCore/ChangeLog
r207437 r207444 1 2016-10-17 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Add toggles for debugger pauses at console.assert failures 4 https://bugs.webkit.org/show_bug.cgi?id=139542 5 <rdar://problem/19281600> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/agents/InspectorDebuggerAgent.h: 10 * inspector/agents/InspectorDebuggerAgent.cpp: 11 (Inspector::InspectorDebuggerAgent::disable): 12 (Inspector::InspectorDebuggerAgent::setPauseOnAssertions): 13 Toggle pause on assertions state. Default is disabled, 14 and disable it when frontends disconnect. 15 16 (Inspector::InspectorDebuggerAgent::handleConsoleAssert): 17 Instead of using the PauseOnAllExceptions state, use this 18 new state specific to assertions. 19 20 * inspector/protocol/Debugger.json: 21 New protocol method to toggle pausing on assertions. 22 1 23 2016-10-17 Yusuke Suzuki <utatane.tea@gmail.com> 2 24 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r207267 r207444 114 114 m_listener->debuggerWasDisabled(); 115 115 116 m_pauseOnAssertionFailures = false; 117 116 118 m_enabled = false; 117 119 } … … 194 196 void InspectorDebuggerAgent::handleConsoleAssert(const String& message) 195 197 { 196 if (m_ scriptDebugServer.pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions)198 if (m_pauseOnAssertionFailures) 197 199 breakProgram(DebuggerFrontendDispatcher::Reason::Assert, buildAssertPauseReason(message)); 198 200 } … … 627 629 if (m_scriptDebugServer.pauseOnExceptionsState() != pauseState) 628 630 errorString = ASCIILiteral("Internal error. Could not change pause on exceptions state"); 631 } 632 633 void InspectorDebuggerAgent::setPauseOnAssertions(ErrorString&, bool enabled) 634 { 635 m_pauseOnAssertionFailures = enabled; 629 636 } 630 637 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
r206653 r207444 78 78 void stepOut(ErrorString&) final; 79 79 void setPauseOnExceptions(ErrorString&, const String& pauseState) final; 80 void setPauseOnAssertions(ErrorString&, bool enabled) final; 80 81 void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown, Inspector::Protocol::OptOutput<int>* savedResultIndex) final; 81 82 void setOverlayMessage(ErrorString&, const String*) override; … … 169 170 bool m_hasExceptionValue { false }; 170 171 bool m_didPauseStopwatch { false }; 172 bool m_pauseOnAssertionFailures { false }; 171 173 }; 172 174 -
trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json
r202717 r207444 238 238 { 239 239 "name": "setPauseOnExceptions", 240 "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>.", 240 241 "parameters": [ 241 242 { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." } 242 ], 243 "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>." 243 ] 244 }, 245 { 246 "name": "setPauseOnAssertions", 247 "description": "Set pause on assertions state. Assertions are console.assert assertions.", 248 "parameters": [ 249 { "name": "enabled", "type": "boolean" } 250 ] 244 251 }, 245 252 { -
trunk/Source/WebInspectorUI/ChangeLog
r207371 r207444 1 2016-10-17 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Add toggles for debugger pauses at console.assert failures 4 https://bugs.webkit.org/show_bug.cgi?id=139542 5 <rdar://problem/19281600> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Controllers/DebuggerManager.js: 10 (WebInspector.DebuggerManager.prototype.get assertionsBreakpoint): 11 (WebInspector.DebuggerManager.prototype.isBreakpointRemovable): 12 (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange): 13 New breakpoint and toggling behavior. 14 15 * Localizations/en.lproj/localizedStrings.js: 16 * UserInterface/Views/DebuggerSidebarPanel.js: 17 (WebInspector.DebuggerSidebarPanel): 18 (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement): 19 (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint): 20 (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements): 21 New breakpoint tree element behavior. 22 23 (WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie): 24 (WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie): 25 Sidebar restoration if it was selected. 26 27 * UserInterface/Images/Assertion.svg: Added. 28 * UserInterface/Images/gtk/Assertion.svg: Added. 29 * UserInterface/Views/BreakpointTreeElement.css: 30 (.breakpoint-assertion-icon .icon): 31 New sidebar icon for the global breakpoint. 32 1 33 2016-10-15 Joseph Pecoraro <pecoraro@apple.com> 2 34 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r206059 r207444 70 70 localizedStrings["All Resources"] = "All Resources"; 71 71 localizedStrings["All Storage"] = "All Storage"; 72 localizedStrings["All Uncaught Exceptions"] = "All Uncaught Exceptions";73 72 localizedStrings["Alternates"] = "Alternates"; 74 73 localizedStrings["An error occurred trying to load the resource."] = "An error occurred trying to load the resource."; … … 92 91 localizedStrings["Assertion Failed"] = "Assertion Failed"; 93 92 localizedStrings["Assertion Failed: %s"] = "Assertion Failed: %s"; 93 localizedStrings["Assertion Failures"] = "Assertion Failures"; 94 94 localizedStrings["Assertion with message: %s"] = "Assertion with message: %s"; 95 95 localizedStrings["Assertive"] = "Assertive"; … … 785 785 localizedStrings["Type information for variable: %s"] = "Type information for variable: %s"; 786 786 localizedStrings["Unable to determine path to property from root"] = "Unable to determine path to property from root"; 787 localizedStrings["Uncaught Exceptions"] = "Uncaught Exceptions"; 787 788 localizedStrings["Unchanged"] = "Unchanged"; 788 789 localizedStrings["Uncomment All Properties"] = "Uncomment All Properties"; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
r207371 r207444 48 48 this._allExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-exceptions", false); 49 49 this._allUncaughtExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-uncaught-exceptions", false); 50 this._assertionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-assertions", false); 50 51 51 52 let specialBreakpointLocation = new WebInspector.SourceCodeLocation(null, Infinity, Infinity); … … 55 56 56 57 this._allUncaughtExceptionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._allUncaughtExceptionsBreakpointEnabledSetting.value); 58 59 this._assertionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._assertionsBreakpointEnabledSetting.value); 60 this._assertionsBreakpoint.resolved = true; 57 61 58 62 this._breakpoints = []; … … 86 90 this._updateBreakOnExceptionsState(); 87 91 92 // COMPATIBILITY (iOS 10): DebuggerAgent.setPauseOnAssertions did not exist yet. 93 if (DebuggerAgent.setPauseOnAssertions) 94 DebuggerAgent.setPauseOnAssertions(this._assertionsBreakpointEnabledSetting.value); 95 88 96 this._ignoreBreakpointDisplayLocationDidChangeEvent = false; 89 97 … … 145 153 { 146 154 return this._allUncaughtExceptionsBreakpoint; 155 } 156 157 get assertionsBreakpoint() 158 { 159 return this._assertionsBreakpoint; 147 160 } 148 161 … … 187 200 isBreakpointRemovable(breakpoint) 188 201 { 189 return breakpoint !== this._allExceptionsBreakpoint && breakpoint !== this._allUncaughtExceptionsBreakpoint; 202 return breakpoint !== this._allExceptionsBreakpoint 203 && breakpoint !== this._allUncaughtExceptionsBreakpoint 204 && breakpoint !== this._assertionsBreakpoint; 190 205 } 191 206 … … 850 865 } 851 866 867 if (breakpoint === this._assertionsBreakpoint) { 868 if (!breakpoint.disabled && !this.breakpointsDisabledTemporarily) 869 this.breakpointsEnabled = true; 870 this._assertionsBreakpointEnabledSetting.value = !breakpoint.disabled; 871 DebuggerAgent.setPauseOnAssertions(this._assertionsBreakpointEnabledSetting.value); 872 return; 873 } 874 852 875 if (breakpoint.disabled) 853 876 this._removeBreakpoint(breakpoint); -
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css
r188837 r207444 51 51 } 52 52 53 .breakpoint-assertion-icon .icon { 54 content: url(../Images/Assertion.svg); 55 } 56 53 57 .breakpoint-paused-icon .icon { 54 58 content: url(../Images/PausedBreakpoint.svg); -
trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
r207359 r207444 108 108 109 109 this._allExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Exceptions")); 110 this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Uncaught Exceptions")); 111 this.suppressFilteringOnTreeElements([this._allExceptionsBreakpointTreeElement, this._allUncaughtExceptionsBreakpointTreeElement]); 110 this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("Uncaught Exceptions")); 111 this._assertionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.assertionsBreakpoint, WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName, WebInspector.UIString("Assertion Failures")); 112 113 this.suppressFilteringOnTreeElements([this._allExceptionsBreakpointTreeElement, this._allUncaughtExceptionsBreakpointTreeElement, this._assertionsBreakpointTreeElement]); 112 114 113 115 this.filterBar.placeholder = WebInspector.UIString("Filter List"); … … 151 153 this._breakpointsContentTreeOutline.appendChild(this._allUncaughtExceptionsBreakpointTreeElement); 152 154 155 // COMPATIBILITY (iOS 10): DebuggerAgent.setPauseOnAssertions did not exist yet. 156 if (DebuggerAgent.setPauseOnAssertions) 157 this._breakpointsContentTreeOutline.appendChild(this._assertionsBreakpointTreeElement); 158 153 159 this._scriptsContentTreeOutline = this.createContentTreeOutline(true); 154 160 this._scriptsContentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._treeSelectionDidChange, this); … … 282 288 } 283 289 290 if (representedObject === WebInspector.debuggerManager.assertionsBreakpoint) { 291 cookie[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey] = true; 292 return; 293 } 294 284 295 super.saveStateToCookie(cookie); 285 296 } … … 294 305 else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey]) 295 306 this._allUncaughtExceptionsBreakpointTreeElement.revealAndSelect(); 307 else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey]) 308 this._assertionsBreakpointTreeElement.revealAndSelect(); 296 309 else 297 310 super.restoreStateFromCookie(cookie, relaxedMatchDelay); … … 692 705 return false; 693 706 694 var wasTopResourceTreeElement = treeElement.previousSibling === this._a llUncaughtExceptionsBreakpointTreeElement;707 var wasTopResourceTreeElement = treeElement.previousSibling === this._assertionsBreakpointTreeElement || treeElement.previousSibling === this._allUncaughtExceptionsBreakpointTreeElement; 695 708 var nextSibling = treeElement.nextSibling; 696 709 … … 775 788 function isSpecialBreakpoint(treeElement) 776 789 { 777 return treeElement.representedObject === WebInspector.debuggerManager.allExceptionsBreakpoint || treeElement.representedObject === WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint; 790 return treeElement.representedObject === WebInspector.debuggerManager.allExceptionsBreakpoint 791 || treeElement.representedObject === WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint 792 || treeElement.representedObject === WebInspector.debuggerManager.assertionsBreakpoint; 778 793 } 779 794 … … 956 971 WebInspector.DebuggerSidebarPanel.DebuggerPausedStyleClassName = "paused"; 957 972 WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName = "breakpoint-exception-icon"; 973 WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName = "breakpoint-assertion-icon"; 958 974 WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName = "breakpoint-paused-icon"; 959 975 960 976 WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = "debugger-sidebar-panel-all-exceptions-breakpoint"; 961 977 WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey = "debugger-sidebar-panel-all-uncaught-exceptions-breakpoint"; 978 WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey = "debugger-sidebar-panel-assertions-breakpoint";
Note: See TracChangeset
for help on using the changeset viewer.