Closed Bug 1572596 Opened 6 years ago Closed 6 years ago

Resurrect GC'ed sources when attaching the debugger

Categories

(DevTools :: Debugger, enhancement, P2)

enhancement

Tracking

(firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox70 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

(Whiteboard: [debugger-reserve])

Attachments

(4 files)

Attached patch WIPSplinter Review

As described in bug 1571592, the debugger should be able to show sources that were loaded into its target but have since been GC'ed along with all their contents. The strategy here is to keep track of the URLs that have been loaded into each non-system-zone realm, so that the debugger can query the information later even if it wasn't attached when the URL was loaded. The attached patch makes this change, limiting the number of URLs to 100 per realm and the URL length to 1024 to keep memory from getting out of control if there are lots of URLs or very long URLs (like data URLs). The URLs are purged on compacting GCs, which happen when there is memory pressure or the user has been idle a while, and shouldn't affect typical debugger use cases.

This patch is a WIP because for sources in HTML files it scans the file for potential inline scripts using some simple regexps. I'm going to try a little harder to see if this can be avoided.

Blocks: dbg-70
Status: NEW → ASSIGNED
Whiteboard: [debugger-reserve]
Pushed by bhackett@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/aaaa162990a6 Part 1 - Add source URLs slot to global objects which is cleared on shrinking GC, r=jonco. https://hg.mozilla.org/integration/autoland/rev/492f6f5065e2 Part 2 - Add debugger APIs to get the URLs associated with debuggee realms, and to create new sources, r=jimb. https://hg.mozilla.org/integration/autoland/rev/6b12a87f2d4a Part 3 - Resurrect any sources missing from the debuggee source URLs when attaching the debugger, r=loganfsmyth.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Regressions: 1577273
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: