Open Bug 1590588 Opened 5 years ago Updated 2 years ago

Debugger shows in-scope variables undefined when paused on breakpoint

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: kevin, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file)

Attached video 2019-10-22 16-25-37.mkv

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:

  1. Go to hubs.mozilla.com
  2. Click "Create A Room"
  3. In the debugger, open the file physics-utils.js
  4. Add a breakpoint on line 59 console.group("traverseMeshesAndAddShapes");
  5. Reload the page.
  6. The debugger should pause on line 59. Observe that variables such as shapePrefix and shapes when hovered show as undefined. They are also undefined if they are entered in the console.
  7. Repeat the same steps in Chrome; Observe that the variables are shown correctly.

The video attached shows steps 1-6.

Priority: -- → P1
Assignee: nobody → bhackett1024

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.

Logan, would you be able to look into where map scopes fails?

Flags: needinfo?(loganfsmyth)
Assignee: bhackett1024 → loganfsmyth

To clarify, I'm not sure anything here is technically broken, but the default behavior is definitely confusing.

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.

Flags: needinfo?(loganfsmyth)
Depends on: 1594550

Thanks, Logan, I filed bug 1594550 to track that as feature.

Priority: P1 → P2
Assignee: loganfsmyth → nobody
Severity: normal → S3
See Also: → 1795764
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: