-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger misbehavior in function called via symbol property reference #7536
Comments
Confirmed. The |
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. |
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. |
Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See nodejs/node#7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597}
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 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(); |
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See nodejs#7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{nodejs#37597} Fixes: nodejs#7536
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See #7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: #7536 PR-URL: #7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See nodejs#7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{nodejs#37597} Fixes: nodejs#7536 PR-URL: nodejs#7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See #7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: #7536 PR-URL: #7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See nodejs/node#7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: nodejs/node#7536 PR-URL: nodejs/node#7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See nodejs#7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{nodejs#37597} Fixes: nodejs#7536 PR-URL: nodejs#7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See #7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: #7536 PR-URL: #7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See #7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: #7536 PR-URL: #7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See #7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: #7536 PR-URL: #7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See #7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: #7536 PR-URL: #7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: Handle symbols in FrameMirror#invocationText(). Fix a TypeError when putting together the invocationText for a symbol method's stack frame. See nodejs/node#7536. Review-Url: https://codereview.chromium.org/2122793003 Cr-Commit-Position: refs/heads/master@{#37597} Fixes: nodejs/node#7536 PR-URL: nodejs/node#7612 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Steps to Reproduce
test.js
with 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].
The text was updated successfully, but these errors were encountered: