Closed Bug 1865005 Opened 1 year ago Closed 1 year ago

Use 1-based column number in tracer

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox122 fixed)

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: arai, Assigned: arai)

Details

Attachments

(1 file)

derived from https://phabricator.services.mozilla.com/D193270

tracer has been using 0-based column number for URL, which is received by DevToolsStartup.sys.mjs.
bug 1862693 switches the Debugger API (script.getOffsetMetadata here) from 0-based to 1-based, while letting tracer keep using 0-based.
this bug is to switch the tracer and the consumer in DevToolsStartup.sys.mjs to use 1-based column number.

https://searchfox.org/mozilla-central/rev/21001eee69767de5db95952154d49f01b72318ba/devtools/server/tracer/tracer.jsm#294-296,308,312,314-316,318

const { lineNumber, columnNumber } = script.getOffsetMetadata(
  frame.offset
);
...
const href = `${script.source.url}:${lineNumber}:${columnNumber}`;
...
const urlLink = `\x1B]8;;${href}\x1B\\${href}\x1B]8;;\x1B\\`;
...
const message = `${padding}[${
  frame.implementation
}]—> ${urlLink} - ${formatDisplayName(frame)}`;
...
dump(this.prefix + message + "\n");

https://searchfox.org/mozilla-central/rev/21001eee69767de5db95952154d49f01b72318ba/devtools/startup/DevToolsStartup.sys.mjs#410,423,436,439,445,484

checkForDebuggerLink(cmdLine) {
...
  const urlParam = cmdLine.getArgument(urlFlagIdx + 1);
...
  let match = urlParam.match(/^(?<url>\w+:.+):(?<line>\d+):(?<column>\d+)$/);
...
    match = urlParam.match(/^(?<url>\w+:.+):(?<line>\d+)?$/);
...
  const { url, line, column } = match.groups;
...
    parseInt(column || 0, 10),

The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Debugger
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/a4f3e7625abf Use 1-based column number in tracer and DevToolsStartup command line handling. r=ochameau,devtools-reviewers
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/fefa2e429bdc Use 1-based column number in tracer and DevToolsStartup command line handling. r=ochameau,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: