Status

enhancement
RESOLVED INVALID
4 years ago
10 months ago

People

(Reporter: sebo, Unassigned)

Tracking

(Blocks 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
The script view should indicate whether a line is executable, i.e. were the user can set a breakpoint.

Firebug implements this by making the line number green and bold (vs. gray and normal weight for non-executable lines).

Sebastian
I believe Firebug is the only tool that does this. Every other tool allows setting a breakpoint in every line and Firefox in particular will try to guess the best possible location and slide the breakpoint there, if setting a breakpoint at the current line is not possible. So if this feature is implemented, it should be behind a pref that Firebug can toggle, when enabled.
(Reporter)

Comment 2

4 years ago
(In reply to Panos Astithas [:past] from comment #1)
> I believe Firebug is the only tool that does this.

So far yes, and Firebug users like that feature as it indicates where they can set a breakpoint.

> Every other tool allows > setting a breakpoint in every line and Firefox in particular will try to
> guess the best possible location and slide the breakpoint there, if setting
> a breakpoint at the current line is not possible.

Right, though this fails on scripts embedded into HTML. Example:
1. Open the DevTools on this page
2. Switch to the Debugger panel
3. Select 'show_bug.cgi' from the sources
4. Set a breakpoint at line 3 (<html lang="en">) or line 50 (empty line within JavaScript code)

=> The breakpoint won't be auto-corrected.

Also the auto-correction may not always be obvious. E.g. if you try to set a breakpoint on a non-executable line within the global scope, it will be moved to the first executable line there, which may be far down after different function declarations.
An indication that you cannot set a breakpoint at that specific line helps a bit in this case.

> So if this feature is implemented, it should be behind a pref that Firebug can toggle, when enabled.

FWIW the backend API for this is already available as of bug 795917.

Sebastian
I am closing this bug since it should really belong in the debugger.html github issues.

You can find it here: https://github.com/devtools-html/debugger.html/issues/3482
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID

Updated

10 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.