Closed Bug 1233474 Opened 10 years ago Closed 10 years ago

Slide breakpoints when we know we're in a function

Categories

(DevTools :: Debugger, defect)

40 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jlong, Unassigned)

References

Details

More discussion here: https://bugzilla.mozilla.org/show_bug.cgi?id=1230345#c17 In that bug we removed breakpoint sliding completely because the way we implemented it was pretty terrible: it wasn't uncommon for a breakpoint to slide all the way out-of-sight when the user was trying to set it on a top-level thing that was GCed. (GCed because they opened the debugger after using the page) I think it's still useful to do breakpoint sliding for non-sourcemapped sources in one specific situation: inside a top-level named function. If we are inside one, we know that that it most likely won't be GCed because it introduced a binding on the global scope. Actually, if we are inside *any* function then we should be able to do breakpoint sliding. Parent scripts keep their children alive. So if we are inside a function, we know that all nested scripts should be alive. We wouldn't ever slide "out" of a function. The basic problem is that sliding a breakpoint when you are at the top-level is terrible because we don't know when we are at the top-level or just at a place where all the scripts have been GCed and the top-level script is the only one available.
This is invalid; the bug linked above ended up implemented a valid sliding algorithm when we know we have scripts.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.