Skip to content
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

Fix debugger and profiler functionality #4298

Closed
wants to merge 2 commits into from
Closed

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Dec 15, 2015

This PR contains two commits. The first is a fix for #4297, which restores the old module wrapping behavior. It is my hope that this commit can be reverted in the not so distant future. The second commit is a regression test for #4297.

In b799a74 and
dfee4e3 the module wrapping
mechanism was changed for better error reporting. However,
the changes causes issues with debuggers and profilers. This
commit reverts the wrapping changes.

Fixes: nodejs#4297
const Debug = vm.runInDebugContext('Debug');
const fn = require(common.fixturesDir + '/exports-function-with-param');

Debug.setListener(common.mustCall(function(e, s, d) {}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the common.mustCall(...) reliable here? In my experience the listener frequently gets called for more than just breakpoint events. I'd check manually that it gets called at least once with d.constructor.name === 'BreakEvent'. Maybe give it a more descriptive name than just d. :-)

EDIT: Or check that e === Debug.DebugEvent.Break.

This commit adds a regression test for debugging of
single line files.

Refs: nodejs#4297
@cjihrig
Copy link
Contributor Author

cjihrig commented Dec 16, 2015

@bnoordhuis updated based on your comment.

@bnoordhuis
Copy link
Member

LGTM if CI etc.

@ofrobots
Copy link
Contributor

cjihrig added a commit that referenced this pull request Dec 16, 2015
In b799a74 and
dfee4e3 the module wrapping
mechanism was changed for better error reporting. However,
the changes causes issues with debuggers and profilers. This
commit reverts the wrapping changes.

Fixes: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
cjihrig added a commit that referenced this pull request Dec 16, 2015
This commit adds a regression test for debugging of
single line files.

Refs: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
@cjihrig
Copy link
Contributor Author

cjihrig commented Dec 16, 2015

Landed in 2a60e2a and cb0b4a6.

@cjihrig cjihrig closed this Dec 16, 2015
@cjihrig cjihrig deleted the 4297 branch December 16, 2015 15:23
cjihrig added a commit that referenced this pull request Dec 16, 2015
In b799a74 and
dfee4e3 the module wrapping
mechanism was changed for better error reporting. However,
the changes causes issues with debuggers and profilers. This
commit reverts the wrapping changes.

Fixes: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
cjihrig added a commit that referenced this pull request Dec 16, 2015
This commit adds a regression test for debugging of
single line files.

Refs: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
@ofrobots ofrobots mentioned this pull request Dec 17, 2015
@rvagg rvagg mentioned this pull request Dec 17, 2015
@jasnell
Copy link
Member

jasnell commented Dec 17, 2015

@cjihrig ... does this need to go into v4?

@jasnell
Copy link
Member

jasnell commented Dec 17, 2015

(I'm assuming not)

@ofrobots
Copy link
Contributor

This is a fix for a regression in 5.2.0. This does not need to go into v4.

@cjihrig
Copy link
Contributor Author

cjihrig commented Dec 17, 2015

If you are backporting #4254 and/or #2867, then this needs to be backported as well.

@rvagg
Copy link
Member

rvagg commented Jan 15, 2016

If you are backporting #4254 and/or #2867, then this needs to be backported as well.

It looks like #4254 got in to v4.x already and #2867 has an lts-watch label on it. Can we have some clarification on whether this needs to go back to v4.x or not? @cjihrig, @ofrobots, @jasnell

@cjihrig
Copy link
Contributor Author

cjihrig commented Jan 15, 2016

TL;DR yes, this should get backported.

#4254 and #2867 fixed a slight issue with line numbers on error messages. However, it exposed what appears to be a bug in V8 (https://bugs.chromium.org/p/v8/issues/detail?id=4620). This PR is a partial revert of #4254 and #2867.

@ofrobots
Copy link
Contributor

I agree with @cjihrig.

MylesBorins pushed a commit that referenced this pull request Jan 21, 2016
In b799a74 and
dfee4e3 the module wrapping
mechanism was changed for better error reporting. However,
the changes causes issues with debuggers and profilers. This
commit reverts the wrapping changes.

Fixes: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 21, 2016
This commit adds a regression test for debugging of
single line files.

Refs: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 21, 2016
In b799a74 and
dfee4e3 the module wrapping
mechanism was changed for better error reporting. However,
the changes causes issues with debuggers and profilers. This
commit reverts the wrapping changes.

Fixes: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 21, 2016
This commit adds a regression test for debugging of
single line files.

Refs: #4297
PR-URL: #4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
This was referenced Jan 21, 2016
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
In b799a74 and
dfee4e3 the module wrapping
mechanism was changed for better error reporting. However,
the changes causes issues with debuggers and profilers. This
commit reverts the wrapping changes.

Fixes: nodejs#4297
PR-URL: nodejs#4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
This commit adds a regression test for debugging of
single line files.

Refs: nodejs#4297
PR-URL: nodejs#4298
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants