Debugger shows in-scope variables undefined when paused on breakpoint
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(Not tracked)
People
(Reporter: kevin, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
3.44 MB,
video/x-matroska
|
Details |
In Mozilla Hubs (tested on both Firefox nightly and stable), in some code paths the debugger will show in-scope variables as undefined when paused in a breakpoint. The same variables will correctly be shown when paused on the same line in Chrome.
Repro:
- Go to hubs.mozilla.com
- Click "Create A Room"
- In the debugger, open the file
physics-utils.js
- Add a breakpoint on line 59
console.group("traverseMeshesAndAddShapes");
- Reload the page.
- The debugger should pause on line 59. Observe that variables such as
shapePrefix
andshapes
when hovered show as undefined. They are also undefined if they are entered in the console. - Repeat the same steps in Chrome; Observe that the variables are shown correctly.
The video attached shows steps 1-6.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 1•5 years ago
|
||
The problem here is related to the scope mapping feature. If I click the "Map" checkbox next to "Scopes", then hovering over "shapes" and "shapePrefix" works as expected. I don't know a lot about how we deal with mapping names between generated and original sources, but it looks like more than just the data shown in the scopes pane depends on the scope mapping flag.
I think the right fix here is to remove the checkbox and turn scope mapping on whenever we're showing the original source. Scope mapping is off by default because if the generated source is really large, mapping the scopes can take a long time and use a lot of resources. Those performance faults need to be fixed first.
Comment 2•5 years ago
|
||
Logan, would you be able to look into where map scopes fails?
Updated•5 years ago
|
Comment 3•5 years ago
|
||
To clarify, I'm not sure anything here is technically broken, but the default behavior is definitely confusing.
Comment 4•5 years ago
|
||
The issue here is that when scope mapping is off, Chrome does a better job than we do. With Scope Mapping enabled, it works great.
Chrome is likely using the name
values from the source mappings, which is lower-fidelity than scope mapping, but also doesn't require intensive preprocessing. We can probably look into doing that when scope mapping is off. I think that would make a lot of sense, now that scope mapping is an opt-in feature.
Comment 5•5 years ago
|
||
Thanks, Logan, I filed bug 1594550 to track that as feature.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•2 years ago
|
Description
•