-
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
Fix debugger and profiler functionality #4298
Conversation
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) {})); |
There was a problem hiding this comment.
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
@bnoordhuis updated based on your comment. |
LGTM if CI etc. |
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]>
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]>
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]>
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 ... does this need to go into v4? |
(I'm assuming not) |
This is a fix for a regression in 5.2.0. This does not need to go into v4. |
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. |
I agree with @cjihrig. |
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]>
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]>
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]>
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]>
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]>
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]>
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.