You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v8_inspector: Support the V8 debugger from within VM contexts #7593
feature requestIssues requesting new Node.js features.inspectorIssues and PRs related to the V8 inspector protocol.vmIssues and PRs related to the vm subsystem.
This is a feature request to support Node 6.3.0's V8 inspector capability (node --inspect) from within the vm module's contexts. For example:
vm.runInNewContext(code,sandbox,{inspect: 9999,// same as --inspect=9999});
If it's not possible to make individual contexts inspectable, it'd also meet our needs to make other contexts inspectable if the parent Node process is running with --inspect. Currently code that runs in other contexts isn't debuggable (ex: debugger statements are ignored).
Reacted by Andrew Levine, bsr203, George, Alec Larson, Vladimir Krivosheev, Hendrik Purmann, Chris Cowan, Alexey Svetliakov, Jure Triglav, Ryan Cruz and 80 more
changed the title [-]v8_inspector: Support the V8 debugger from with VM contexts[/-][+]v8_inspector: Support the V8 debugger from within VM contexts[/+]on Jul 7, 2016
@cpojer are you running Node with the --debug-brk option? You need that so that Node waits for you to connect the Blink Inspector since debugger statements are no-ops unless there is a debugger actively attached.
i'll take this over, it seems like there is also a bug with the inspector not being synced the contexts on connect which makes this less trivial since we need to rejig the handshaking.
ping. This issue is still causing JEST tests to not trigger on debugger; statements: jestjs/jest#1652
Reacted by Bazyli Brzóska (Zendesk), Gio d'Amelio, Brad Pearson, 弘树, Alwin Schoemaker, Ricardo Costa, Arnold Schrijver, Scott Ellis, Ovidiu (Ovi), Michael Cohen and 4 more
feature requestIssues requesting new Node.js features.inspectorIssues and PRs related to the V8 inspector protocol.vmIssues and PRs related to the vm subsystem.
Activity
[-]v8_inspector: Support the V8 debugger from with VM contexts[/-][+]v8_inspector: Support the V8 debugger from within VM contexts[/+]cpojer commentedon Oct 24, 2016
node --inspectalso doesn't stop fordebugger;statements.Repro:
ide commentedon Oct 24, 2016
@cpojer are you running Node with the
--debug-brkoption? You need that so that Node waits for you to connect the Blink Inspector sincedebuggerstatements are no-ops unless there is a debugger actively attached.cpojer commentedon Oct 24, 2016
@ide yes, please see jestjs/jest#1652 for more details.
hybrist commentedon Oct 24, 2016
Quoting @bmeck (https://twitter.com/bradleymeck/status/790571493579116546):
bmeck commentedon Oct 24, 2016
can be based upon https://github.com/bmeck/node/tree/inspect-contexts , don't really have time to figure out segfaults currently but would need tests for sure to ensure GC properly works on this.
ofrobots commentedon Oct 24, 2016
The branch from @bmeck looks like a good starting point. This would be a really neat contribution.
/cc @nodejs/v8-inspector.
bmeck commentedon Oct 25, 2016
i'll take this over, it seems like there is also a bug with the inspector not being synced the contexts on connect which makes this less trivial since we need to rejig the handshaking.
inspector: add contexts when using vm module
10 remaining items
michahell commentedon Jul 5, 2017
ping. This issue is still causing JEST tests to not trigger on
debugger;statements: jestjs/jest#1652aschrijver commentedon Jul 12, 2017
I just referred to this issue from stackoverflow after spending more than a day on setting up debugging, without results! FYI: https://stackoverflow.com/questions/45056952/debugging-jest-unit-tests-with-breakpoints-in-vs-code-with-react-native
aschrijver commentedon Jul 12, 2017
Are there any debuggers besides Chrome and VS Code that I can use to debug using V8 or should I downgrade and bide my time?
[UPDATE: I decided to downgrade to node 7 and now debugging in VS Code is a breeze! See details...]
[WIP] src, inspector: support opted-in VM contexts
wangxuepeng commentedon Jul 25, 2017
Downgrade to 7.10.1 to work-around the issue. Keep watching on this.
hakunin commentedon Jul 26, 2017
@cpojer Maybe FB should donate a developer to the node project for a few months so we can get somewhere :D
jgoz commentedon Aug 11, 2017
@eugeneo This is closed now that #14465 is merged, right?
ide commentedon Aug 17, 2017
Closing this since Node 8.4.0 supports attaching to vm contexts out of the box.
jbeard4 commentedon Aug 24, 2017
Source maps are ignored in chrome dev tools for code that is evaluated using
vm.runInContext.Update Troubleshooting.md
Update Troubleshooting.md (#5794)
Ugly workaround for issue nodejs/node#7593
Update Troubleshooting.md (jestjs#5794)