Closed Bug 1862693 Opened 1 year ago Closed 1 year ago

Use 1-origin column number in debugger API

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

After bug 1862692, we can rewrite the Debugger API to use 1-origin column number, and rewrite the DevTools Debugger code to directly use the 1-origin column number, instead of performing the conversion there.

Blocks: 1862814
See Also: → 1863878

There's one problem around bug 1863878.
wasm debugger had been using column 1, which had been treated as "1 in 0-origin", but it doesn't have to become "2 in 1-origin",
so the conversion should be done only when the script/source isn't "wasm".
the related debugger code will have the conditional conversion code until the entire debugger internal gets migrated to 1-origin.

This includes the following API:

  • Debugger.Object.prototype.createSource
    • startColumn field of the parameter object
  • Debugger.Script.prototype.startColumn
    • return value
  • Debugger.Script.prototype.getPossibleBreakpoints
    • minColumn and maxColumn property of the query
    • columnNumber property of the returned array elements
  • Debugger.Script.prototype.getOffsetMetadata
    • columnNumber property of the returned array elements
  • Debugger.Script.prototype.getOffsetLocation
    • columnNumber property of the returned array elements
  • Debugger.Script.prototype.getAllColumnOffsets
    • columnNumber property of the returned array elements
  • Debugger.Script.prototype.getOffsetsCoverage
    • columnNumber property of the returned array elements
  • Debugger.Source.prototype.startColumn
    • return value

This patch modifies DevTools code to convert the column number from/to 1-origin,
while keep using 0-origin on their side.

One exception is the WASM's column number, which had been using 1-origin 1.
Each consumer in DevTools handles the WASM case, and the code can be removed
once DevTools internal also switches to 1-origin column number.

Blocks: 1864783
See Also: → 1864786
Duplicate of this bug: 1864783
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/39867b503289 Use 1-origin column number in debugger API. r=iain,ochameau,devtools-reviewers
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/e2b664dff2c2 Use 1-origin column number in debugger API. r=iain,ochameau,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Regressions: 1866504
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: