Repository navigation
Debugger misbehavior in function called via symbol property reference #7536
Description
Activity
Confirmed. The
debuggerstatement generates av8::Breakdebug event without a JSON payload, tricking src/debug-agent.cc into thinking that the debug session has terminated. I'll put together a fix.Turns out it's (also) a V8 bug. The JSON-ification of the event data fails with a "Cannot convert a Symbol value to a string" exception, that is why the payload is empty.
- addedv8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
on Jul 5, 2016 Filed a CL: https://codereview.chromium.org/2122793003/
@bnoordhuis: Good news. I'm ready to try out the fix as soon as it lands in node.
- added a commit that references this issue
on Jul 7, 2016 Tracking bug for back-porting the fix to the 5.2 and 5.3 branches: https://bugs.chromium.org/p/v8/issues/detail?id=5191
I'll take care of back-porting it to older branches.
Trying to find a workaround, I ran into a more tricky scenario. It would be nice to see if the proposed fix repairs this one as well.
This piece of code produces the same effect as my original sample. However if the breakpoint is moved into
o.g, it works as expected.var S = Symbol(); var o = { [S]() { debugger; console.log("in o[S]"); }, g() { console.log("in o.g"); } } var f = o[S]; var g = o.g; f.call(o); g.call(o);
One more exotic test case just to make sure that it is covered.
var S = Symbol(); var o = { [S]() { debugger; console.log("in o[S]"); }, } var f = o[S].bind(o); f();
- added a commit that references this issue
on Jul 14, 2016 - added a commit that references this issue
on Jul 18, 2016 - added 2 commits that reference this issue
on Jul 18, 2016 - added a commit that references this issue
on Jul 21, 2016 - added a commit that references this issue
on Jul 22, 2016 - added 2 commits that reference this issue
on Oct 10, 2016 - added a commit that references this issue
on Oct 18, 2016 - added a commit that references this issue
on Oct 26, 2016 - added a commit that references this issue
on Nov 9, 2016
Steps to Reproduce
test.jswith the following code.node debug test.js.The debugger stops at line 1.
Expected Behavior
"before" is printed then the debugger stops at
debugger;.Actual Behavior
"before" is printed and I get a
debug>prompt without any code listing.If I type 'bt' I get the message 'Can't request backtrace now'.
If I type 'list(5)' I get a list when the current line is marked at line 1.
If I type 'c' then "at breakpoint" and "after" is printed and
the program terminates without ever stopping at the breakpoint.
If I change the last line as follows, everything goes fine.
Node Inspector and VS 2015 Node.js tools also show weird behavior with the sample code. Effectively they are unable to stop at the breakpoint in o[S].