Closed Bug 738480 Opened 13 years ago Closed 13 years ago

Debugger.prototype.findScripts does not find non-compileAndGo scripts

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: jorendorff, Assigned: jimb)

References

Details

(Whiteboard: [chrome-debug])

Attachments

(1 file, 1 obsolete file)

It does not find them because the current code searches for scripts with the right global. I think compartment-per-global will clear this right up.
Adding [chrome-debug] to whiteboard; although this isn't chrome-specific, chrome debugging does need it. The patch we whipped up is part of changeset ff20735ac16c in the remote-debug repository.
Whiteboard: [chrome-debug]
Assignee: general → jorendorff
Attached patch v1 (obsolete) — Splinter Review
Attachment #626422 - Flags: review?(jimb)
Comment on attachment 626422 [details] [diff] [review] v1 Review of attachment 626422 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/vm/Debugger.cpp @@ +2187,5 @@ > * if no error occurs, false if an error occurs. > */ > + bool consider(JSScript *script, AutoScriptVector *vector) { > + GlobalObject *global = script->getGlobalObjectOrNull(); > + if (global && !globals.has(global)) Could we have a one-line comment here explaining that non-CNG scripts can't be associated with any global, so we're just including them all?
Attachment #626422 - Flags: review?(jimb) → review+
I don't have time to write a one-line comment, so I added a three-line comment https://hg.mozilla.org/integration/mozilla-inbound/rev/58ca5bf07352
Depends on: 738468
I refreshed this and ran it by Try server, but it has some failures in debugger tests.
Assignee: jorendorff → nobody
Component: JavaScript Engine → jemalloc
Target Milestone: --- → mozilla14
Version: Other Branch → 15 Branch
This patch was needed to see all the scripts we expected while debugging chrome code; it landed, but bounced. Panos, this might still be affecting our chrome debugging. The patch includes a test, so we can see for sure.
Assignee: nobody → jimb
Resetting component & flags that I presume were accidentally changed. This patch seems slightly bitrotted: Debugger.cpp:2348:40: error: no member named 'getGlobalObjectOrNull' in 'JSScript' I wanted to verify if this patch would fix some missing scripts I get with chrome debugging.
Component: jemalloc → JavaScript Engine
Target Milestone: mozilla14 → ---
Version: 15 Branch → Trunk
Since compartment-per-global, this code can be much simplified, and fix this bug in the process. Will request review if try approves.
Attachment #626422 - Attachment is obsolete: true
Seems to cause a bunch of timeouts in the debugger tests: TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/debugger/test/browser_dbg_bfcache.js | Test timed out and a bunch like this: TEST-UNEXPECTED-FAIL | /home/cltbld/talos-slave/test/build/xpcshell/tests/toolkit/devtools/debugger/tests/unit/test_dbgactor.js | test failed (with xpcshell return code: 0), see following log: TEST-UNEXPECTED-FAIL | chrome://global/content/devtools/dbg-script-actors.js:1056 | TypeError: aScript.url is null - See following stack:
Seems like the debugger wasn't expecting to get any scripts that didn't have URLs; it does now. Fresh try: https://tbpl.mozilla.org/?tree=Try&rev=d86bf86be673
(In reply to Panos Astithas [:past] from comment #9) > I wanted to verify if this patch would fix some missing scripts I get with > chrome debugging. It does indeed! (In reply to Jim Blandy :jimb from comment #13) > Seems like the debugger wasn't expecting to get any scripts that didn't have > URLs; it does now. After we get Debugger.Source and are able to display the script contents without using the URL to fetch them, will it make sense to allow scripts without URLs again? Under what circumstances eval scripts get no URL? Using eval() in a page makes the script inherit the page URL, so I haven't come across this case before.
Blocks: 740551
Still some interesting regressions here; for example: https://tbpl.mozilla.org/php/getParsedLog.php?id=16149680&tree=Try&full=1
(In reply to Jim Blandy :jimb from comment #15) > Still some interesting regressions here; for example: > https://tbpl.mozilla.org/php/getParsedLog.php?id=16149680&tree=Try&full=1 Only the createRemote leak is new, the others are bug 753225 and bug 797336.
Attachment #671586 - Flags: review?(luke)
Luke, you'll enjoy this patch, I think. The try run looks good; there is a debugger-related failure, but I think that's a known bug (starred).
Panos, for what it's worth, the stack traces printed after the "###!!! ASSERTION" (NS_ASSERTION) are produced assuming that we've got a frame pointer, which we don't; they're always bogus.
Comment on attachment 671586 [details] [diff] [review] Simplify Debugger::ScriptQuery after CPG. Fix missing compile-and-go scripts. cpg ftw!
Attachment #671586 - Flags: review?(luke) → review+
Status: NEW → ASSIGNED
Flags: in-testsuite+
Target Milestone: --- → mozilla19
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: