Closed Bug 1461897 Opened 7 years ago Closed 6 years ago

Can we remove 'innermost' query for Debugger.findScripts?

Categories

(DevTools :: Debugger, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1550440
Future

People

(Reporter: arai, Unassigned)

References

Details

'innermost' query is used only in tests. https://searchfox.org/mozilla-central/rev/2b9779c59390ecc47be7a70d99753653d8eb5afc/js/src/doc/Debugger/Debugger.md#397-400 which is supposed to be used when setting breakpoint https://bugzilla.mozilla.org/show_bug.cgi?id=733461#c1 but the filtering is done in caller side (JS) https://searchfox.org/mozilla-central/rev/00dd116638001772fe354b081353b73f1cad405d/devtools/server/actors/source.js#816-823 it would be nice to figure out the reason why we're doing it on caller now, and use innermost query if it's faster, or remove innermost if it's not necessary.
In the long run, I would like to completely redesign the interface for setting breakpoints, so that findScripts isn't necessary at all. The behavior of findScripts depends on GC timing, which is very bad to expose to JS; JS should never care when GC happens. Instead, the Debugger API would have a proper Debugger.Breakpoint object, and SpiderMonkey itself would track down JSScripts and LazyScripts and take care of inserting breakpoints at the right point in the bytecode. The server would never need to collect them or iterate over them. Changing the server to use innermost might be helpful in the short term, but if we can get by with what we have now, it's probably unnecessary. Deleting the feature for the time being would be reasonable. We can always revert the change if we find we need it later.
Target Milestone: --- → Future
Product: Firefox → DevTools
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.