Closed Bug 1545103 Opened 5 years ago Closed 5 years ago

applyBreakpoint should no longer support fuzzy matches

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: jlast, Assigned: jlast)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Back in the day, applyBreakpoint supported setting breakpoints at imprecise column locations (beginning of a line, end of a line, in between entry points). Now that we have breakpoint positions coming from the server, I think we should assume that breakpoint positions are exact.

diff --git a/devtools/server/actors/source.js b/devtools/server/actors/source.js
index cf05f70fb2c8..5fd4cc659ff0 100644
--- a/devtools/server/actors/source.js
+++ b/devtools/server/actors/source.js
@@ -479,43 +479,12 @@ const SourceActor = ActorClassWithSpec(sourceSpec, {
       // offsets that correspond to the given line *and* column number.
       for (const [script, columnToOffsetMap] of columnToOffsetMaps) {
         for (const { columnNumber, offset } of columnToOffsetMap) {
+          // could this be `columnNumber == column`
           if (columnNumber >= column && columnNumber <= column + 1) {
             entryPoints.push({ script, offsets: [offset] });
           }
         }
       }
-
-      // If we don't find any matching entrypoints,
-      // then we should see if the breakpoint comes before or after the column offsets.
-      if (entryPoints.length === 0) {
-        // It's not entirely clear if the scripts that make it here can come
-        // from a variety of sources. This function allows filtering by URL
-        // so it seems like it may be possible and we are erring on the side
-        // of caution by handling it here.
-        const closestScripts = findClosestScriptBySource(
-          columnToOffsetMaps.map(pair => pair[0]),
-          line,
-          column,
-        );
-
-        const columnToOffsetLookup = new Map(columnToOffsetMaps);
-        for (const script of closestScripts) {
-          const columnToOffsetMap = columnToOffsetLookup.get(script);
-
-          if (columnToOffsetMap.length > 0) {
-            const firstColumnOffset = columnToOffsetMap[0];
-            const lastColumnOffset = columnToOffsetMap[columnToOffsetMap.length - 1];
-
-            if (column < firstColumnOffset.columnNumber) {
-              entryPoints.push({ script, offsets: [firstColumnOffset.offset] });
-            }
-
-            if (column > lastColumnOffset.columnNumber) {
-              entryPoints.push({ script, offsets: [lastColumnOffset.offset] });
-            }
-          }
-        }
-      }
     }

     setBreakpointAtEntryPoints(actor, entryPoints);
Priority: -- → P2
Pushed by jlaster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3240b92c5566
applyBreakpoint should no longer support fuzzy matches. r=loganfsmyth
Pushed by jlaster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/30b70a449280
applyBreakpoint should no longer support fuzzy matches.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Assignee: nobody → jlaster
Flags: needinfo?(jlaster)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: