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
node --inspect ignores debugger statements and breakpoints inside vm.runInContext #12096
The chrome-devtools:// view correctly displays the console output, is aware of the files being executed using vm.runInContext (with filename set), even lets me set breakpoints in them, it just doesn't actually break for them.
I forward the outer console object into the vm context so console.log statements get correctly printed out by the inspector and I can dig through objects, assign them etc. (though it crashes when accessing certain objects - by the looks of it, it doesn't keep a GC reference to them so they are probably just no longer there).
I'm hoping there is a similar mechanism I can use to have the VM's debug context share the outer one?
There is a pull request that is trying to address this: #7593
Currently this is all blocked on old debugger getting deprecated/disabled - then we will be able to enable the inspector sooner and track all VM contexts. I will assign this issue to me for now.
--debug works most of the time to debug context as long as you set "debugger" instructions within the code executed in the context. But it is not a very efficient protocol to debug Promises. It would be great if it could be fixed. Anyway we can help?
Activity
richardlau commentedon Mar 28, 2017
cc @nodejs/diagnostics
eugeneo commentedon Mar 28, 2017
There is a pull request that is trying to address this: #7593
Currently this is all blocked on old debugger getting deprecated/disabled - then we will be able to enable the inspector sooner and track all VM contexts. I will assign this issue to me for now.
clarabstract commentedon Mar 28, 2017
Thanks!
Is using the old debugger going to work for the time being? (and is that
node debuggerornode --debug?)Alternately, what's the last version where it would work?
eugeneo commentedon Mar 28, 2017
I do not know if --debug supports multicontext.
node debug is a CLI debugger that uses --debug as a protocol.
xtaltas commentedon Apr 24, 2017
--debug works most of the time to debug context as long as you set "debugger" instructions within the code executed in the context. But it is not a very efficient protocol to debug Promises. It would be great if it could be fixed. Anyway we can help?
eugeneo commentedon Apr 25, 2017
This issue a dublicate of #7593
inspector: support extra contexts
Trott commentedon Aug 16, 2017
Did #14465 solve this?
hybrist commentedon Aug 16, 2017
Verified that in node 8.4.0 the following breaks as expected:
node --inspect-brk -e 'vm.runInNewContext("const obj = { log: console.log };\nobj.log(1);\ndebugger;\nobj.log(2);", { console })'I think this is good to close.