debug: activate inspector with _debugProcess#11431
debug: activate inspector with _debugProcess#11431eugeneo merged 0 commit intonodejs:masterfrom eugeneo:inspector-signal
Conversation
|
CI: https://ci.nodejs.org/job/node-test-pull-request/6457/ ARM failures are parallel/test-dgram-address that does not seem to be influenced by this change. |
|
/cc @nodejs/diagnostics @jkrems |
addaleax
left a comment
There was a problem hiding this comment.
Left a few comments … the size of the diff makes it quite difficult to tell code that was just moved around from actual changes, by the way. I don’t know if splitting into several commits would have been a possibility here, but that would make reviewing a lot easier…
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Could you use a TwoByteValue for the above couple of lines?
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Why not just value.IsEmpty() || !value->IsString()?
There was a problem hiding this comment.
I switched to TwoByteValue and removed this check.
src/inspector_agent.h
Outdated
There was a problem hiding this comment.
Is there any reason why this can’t be const v8_inspector::StringView&?
src/inspector_agent.h
Outdated
There was a problem hiding this comment.
(ditto for const v8_inspector::StringView&)
src/inspector_io.cc
Outdated
There was a problem hiding this comment.
nit: I’m tempted to say this might better be called TransportAndIo. 😄
There was a problem hiding this comment.
Right... :) Thanks, I fixed it!
|
CI: https://ci.nodejs.org/job/node-test-pull-request/6527/ I do not see ARM failures through the Hudson - I think GitHub integration might be glitchy. |
|
Tried this change against |
|
What's the status on this? |
|
@jasnell I am not sure. Code-wise it is ready for the review. A decision needs to be made when the old debugger stops handling the signal - is this something that needs to be discussed by @nodejs/diagnostics? |
|
@joshgav Can we pull this into tomorrow's meeting? I think it boils down to a unified "master plan" for doing the switch and when to land what and where. |
|
@jkrems sure, just added label. |
|
@jkrems, @joshgav - how can I join the meeting? I tried looking through the https://github.com/nodejs/diagnostics but did not find details about the upcoming meeting. |
|
@eugeneo This is the meta issue for the meeting: nodejs/diagnostics#89 |
bnoordhuis
left a comment
There was a problem hiding this comment.
Mea culpa, looks like I reviewed this back in February but forgot to submit the comments. Re-reviewed; needs a rebase but the conflicts look minor.
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Can you line up the arguments?
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Can you write this as CHECK_NE(channel, nullptr)?
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Likewise but with CHECK_EQ. I'll stop pointing it out.
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Prefer channel_ == nullptr over bool coercion.
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Likewise. I'll stop pointing it out.
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Can you explain why you sometimes CHECK(impl->client()) and sometimes not?
src/inspector_io.cc
Outdated
src/inspector_io.cc
Outdated
src/inspector_io.cc
Outdated
There was a problem hiding this comment.
Can you CHECK_EQ(0, uv_loop_close(&loop))? I'm pretty sure this won't work on account of the closing handle.
There was a problem hiding this comment.
I changed the code to spin until the callback is called.
src/node_debug_options.cc
Outdated
There was a problem hiding this comment.
Can you make this an if statement for legibility? You could also simplify it to this:
if (port < 0) {
port = default_debugger_port;
#if HAVE_INSPECTOR
if (inspector_enabled_)
port = default_inspector_port;
#endif // HAVE_INSPECTOR
}|
Thank you for the review. Please take another look. |
|
I did a rebase to account for the latest changes. Please review. |
|
Looks like there's one stray lint error: |
|
@jkrems thanks for pointing that out, I fixed it. |
bnoordhuis
left a comment
There was a problem hiding this comment.
LGTM sans some final comments. Have you checked if ./configure --without-inspector still builds?
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Out of curiosity, what is the purpose of this destructor?
src/inspector_agent.cc
Outdated
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
You could use FIXED_ONE_BYTE_STRING here.
There was a problem hiding this comment.
Done, did search/replace for all invocations
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Is there a point to creating the TryCatch when it just rethrows the exception?
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
You could use FIXED_ONE_BYTE_STRING here.
src/inspector_io.cc
Outdated
src/inspector_io.cc
Outdated
There was a problem hiding this comment.
Not wrong but you could also io_thread_req_() in the initializer list.
src/inspector_io.cc
Outdated
src/inspector_io.cc
Outdated
src/node.cc
Outdated
There was a problem hiding this comment.
The change suggests it's not just about the compiler?
There was a problem hiding this comment.
I removed outdated comment.
|
@bnoordhuis I moved the _debugProcess code back to node.cc so the node built with --without-inspector would still be able to send signal/do the weird Windows stuff to another Node instance. What do you think? |
|
@eugeneo Did you forget to push? I still see RegisterDebugSignalHandler() and friends in inspector_agent.cc, not node.cc. (Happy to hear I'm not the only one who thinks the Windows code is weird. I'm not even sure why it works.) |
|
Signal handler remains there, it is only the code that sends the signal that was moved back. (I see CI failures, looking into them) |
|
CI is passing: https://ci.nodejs.org/job/node-test-pull-request/7217/ |
|
CI: https://ci.nodejs.org/job/node-test-pull-request/7219/ - OS X is passing, even though its status is not properly reported. |
|
Landed as 7599b0e |
This pull request switches the signal handler to start inspector socket
server instead of the legacy V8 debug protocol.
Fixes: #8464
CC: @ofrobots