-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
inspector: use inspector API for "break on start" #12076
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
Conversation
cc @ofrobots |
lib/internal/bootstrap_node.js
Outdated
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.
===
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.
Done
lib/module.js
Outdated
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.
Ditto.
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.
Done
src/inspector_agent.cc
Outdated
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.
The HandleScope isn't necessary, API functions get one implicitly.
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.
Done.
src/inspector_agent.cc
Outdated
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.
Just CHECK(args.Length() > 1)
and CHECK(args[0]->IsFunction())
? This is only called by built-in code, right?
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.
For now, it is not supposed to be a public API. This might change in the future.
src/inspector_agent.cc
Outdated
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.
This effectively breaks on the next call into JS land? If this function were to return instead of calling the function, it would break at the next line in lib/module.js?
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.
It breaks on the next JS instruction. E.g. I just noticed that it is not breaking inside the wrapper - it seems to break on the wrapper call (e.g. one step is required to reach the same point it was breaking before). It does not make any difference for the tests as the line number and variables are the same.
Thank you for the review. I addressed the comments, please take another look. |
src/inspector_agent.cc
Outdated
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.
Can you check that session_ != nullptr
?
src/inspector_agent.cc
Outdated
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.
env->context()
might be simpler
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.
Done.
CI has some challenges but they appear unrelated. |
Landed as 7954d2a |
cc @eugeneo |
@italoacasas - sorry, I forgot to add labels. This code does not need to be ported to pre-8x as those versions still rely on debug context. Thanks! |
This change removes a need for using deprecated debug context for
breaking at the start of the main module.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
inspector