Closed
Bug 1545103
Opened 5 years ago
Closed 5 years ago
applyBreakpoint should no longer support fuzzy matches
Categories
(DevTools :: Debugger, defect, P2)
DevTools
Debugger
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);
Assignee | ||
Updated•5 years ago
|
Priority: -- → P2
Assignee | ||
Comment 1•5 years ago
|
||
Pushed by jlaster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3240b92c5566 applyBreakpoint should no longer support fuzzy matches. r=loganfsmyth
Comment 3•5 years ago
|
||
Backed out changeset 3240b92c5566 (Bug 1545103) for failures in test_setBreakpoint-at-the-beginning-of-a-minified-fn.js
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=241431981&repo=autoland&lineNumber=2155
Backout: https://hg.mozilla.org/integration/autoland/rev/7ad24b68c09ea5ac0d4ac7b329223829e1f4d44c
Flags: needinfo?(jlaster)
Assignee | ||
Comment 4•5 years ago
|
||
Pushed by jlaster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/30b70a449280 applyBreakpoint should no longer support fuzzy matches.
Comment 6•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox68:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Updated•5 years ago
|
Assignee: nobody → jlaster
Assignee | ||
Updated•5 years ago
|
Flags: needinfo?(jlaster)
You need to log in
before you can comment on or make changes to this bug.
Description
•