Ignore:
Timestamp:
Oct 2, 2015, 8:18:19 PM (10 years ago)
Author:
Matt Baker
Message:

Web Inspector: Add breakpoint option to ignore n times before stopping
https://bugs.webkit.org/show_bug.cgi?id=147664

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

  • debugger/Breakpoint.h:

(JSC::Breakpoint::Breakpoint):
Added ignoreCount and hitCount fields. Cleaned up initializers.

  • debugger/Debugger.cpp:

(JSC::Debugger::hasBreakpoint):
If a breakpoint matches the current text position, increment breakpoint hit count and
compare with ignore count before testing the breakpoint condition.

  • inspector/ScriptBreakpoint.h:

(Inspector::ScriptBreakpoint::ScriptBreakpoint):
Added ignoreCount field. Cleaned up initializers.

  • inspector/ScriptDebugServer.cpp:

(Inspector::ScriptDebugServer::setBreakpoint):
Added ignoreCount field.

  • inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::buildObjectForBreakpointCookie):
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
(Inspector::InspectorDebuggerAgent::setBreakpoint):
(Inspector::InspectorDebuggerAgent::continueToLocation):
(Inspector::InspectorDebuggerAgent::didParseSource):
Plumbing for ignoreCount property.

  • inspector/protocol/Debugger.json:

Added optional ignoreCount property to BreakpointOptions object.

Source/WebInspectorUI:

  • Localizations/en.lproj/localizedStrings.js:

New strings for breakpoint popover labels.

  • UserInterface/Controllers/BreakpointPopoverController.js:

(WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
Add ignoreCount UI to popover, if backend support exists. UI based on same
feature in Xcode's breakpoint editing dialog.
(WebInspector.BreakpointPopoverController.prototype._popoverIgnoreInputChanged):
User input sanity checks on numeric input.

  • UserInterface/Controllers/DebuggerManager.js:

Listen for changes to breakpoint ignoreCount property.

  • UserInterface/Models/Breakpoint.js:

(WebInspector.Breakpoint):
(WebInspector.Breakpoint.prototype.get ignoreCount):
(WebInspector.Breakpoint.prototype.set ignoreCount):
New property for ignoreCount.
(WebInspector.Breakpoint.prototype.get options):
Added ignoreCount to options object.
(WebInspector.Breakpoint.prototype.get info):
Added ignoreCount to info object.

  • UserInterface/Views/BreakpointPopoverController.css:

(#edit-breakpoint-popover-ignore):
New styles for breakpoint popover.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Breakpoint.h

    r184291 r190542  
    3636struct Breakpoint : public DoublyLinkedListNode<Breakpoint> {
    3737    Breakpoint()
    38         : id(noBreakpointID)
    39         , sourceID(noSourceID)
    40         , line(0)
    41         , column(0)
    42         , autoContinue(false)
    4338    {
    4439    }
    4540
    46     Breakpoint(SourceID sourceID, unsigned line, unsigned column, const String& condition, bool autoContinue)
    47         : id(noBreakpointID)
    48         , sourceID(sourceID)
     41    Breakpoint(SourceID sourceID, unsigned line, unsigned column, const String& condition, bool autoContinue, unsigned ignoreCount)
     42        : sourceID(sourceID)
    4943        , line(line)
    5044        , column(column)
    5145        , condition(condition)
    5246        , autoContinue(autoContinue)
     47        , ignoreCount(ignoreCount)
    5348    {
    5449    }
     
    6156        , condition(other.condition)
    6257        , autoContinue(other.autoContinue)
     58        , ignoreCount(other.ignoreCount)
     59        , hitCount(other.hitCount)
    6360    {
    6461    }
    6562
    66     BreakpointID id;
    67     SourceID sourceID;
    68     unsigned line;
    69     unsigned column;
     63    BreakpointID id { noBreakpointID };
     64    SourceID sourceID { noSourceID };
     65    unsigned line { 0 };
     66    unsigned column { 0 };
    7067    String condition;
    71     bool autoContinue;
     68    bool autoContinue { false };
     69    unsigned ignoreCount { 0 };
     70    unsigned hitCount { 0 };
    7271
    7372    static const unsigned unspecifiedColumn = UINT_MAX;
Note: See TracChangeset for help on using the changeset viewer.