Open Bug 1961529 Opened 26 days ago Updated 17 days ago

Allow to add breakpoints to console evaluated source in the debugger

Categories

(DevTools :: Debugger, enhancement, P3)

Firefox 139
enhancement

Tracking

(Not tracked)

People

(Reporter: 709922234, Unassigned)

References

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:139.0) Gecko/20100101 Firefox/139.0

Steps to reproduce:

  • open webconsole
  • input script, e.d: class A { #a = 1; a(b) { b.#a }} new A().a()
  • When an error occurs, click stack to debug and add breakpoints;
  • Re-input the code for debugging

Actual results:

Some errors cannot be clicked on stack to open debugger. Debugger cannot be paused at breakpoints.

Expected results:

Can be debugged

Similar to chrome

Component: Untriaged → Debugger
Product: Firefox → DevTools
Type: enhancement → defect
Depends on: 1962358

Regarding the malfunctioning links, I filed Bug 1962358 to take care of the fact that the error message location wasn't working.
Then there's the case of the error object stacktrace, which is constructed from error.stack string, and thus doesn't hold proper source ids.


Making breakpoints to work would require some changes in the Debugger. At the moment, every evaluation is creating a different source. Adding a breakpoint on such already evaluated source won't be triggered when a new source is created from evaluation. We would need to somehow have a Map of the evaluated sources by the text content (and the context the evaluation occurred in).

Alternatively, we have Bug 1869292 on file to add the ability to set breakpoints from the console multiline input that would make this possible.

For now, the workaround is to add a debugger statement in the evaluated expression so the debugger would pause on the source when hitting the statement.

See Also: → 1869292
Status: UNCONFIRMED → NEW
Type: defect → enhancement
Ever confirmed: true
Priority: -- → P3
Summary: The script in console cannot be debugged → Allow to add breakpoints to console evaluated source in the debugger

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #3)

Then there's the case of the error object stacktrace, which is constructed from error.stack string, and thus doesn't hold proper source ids.

Filed Bug 1963547 for this

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: