Repository navigation
Uniform way to trigger debugger on first line #12630
Copy link
Copy link
Closed
Labels
inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.ltsIssues and PRs related to Long-Term Support (LTS) releases.Issues and PRs related to Long-Term Support (LTS) releases.
Description
Ref: #12364
-
Have
--inspect --debug-brkas a uniform way to trigger debug on first line- Restore the
--inspect --debug-brkcombo to v7+v8 (inspector: restore --debug-brk alias #12580) - Does it stay undocumented? Or maybe it should become the primary option and remove
--inspect-brk(re: inspector: makedebugan alias forinspect#11441)
(IMHO if we keep it--debug-brk,--inspect-brkwill probably never be used) - Will the combo be valid in
node8? - What do we do with
--debug-port/inspect-port? - In light of these, consider what to mark as deprecated.
- Since
v6andv7requires the combo--inspect[=port] --debug-brk[=port]is specifyingporton both args a valid invocation, and in that case whichportwins?
- Restore the
-
Have
--inspect-brkas a uniform way to trigger debug on first line- Keep the
--inspect --debug-brkcombo in v7 alone (deprecation notice yes/no) (i.e. don't land src: Remove support for --debug #12197 in v7) - port the
--inspect-brkalias tov6(inspector: enable --inspect-brk in v6 #12615)
[new comment] this will make--inspect-breaka feature of recent versions of 6.x, but it can't change the past: versions of 6.x will always exist without this feature, and so will not be debuggable by third-party tooling [without special treatment] - for
v4it's irrelevant since it's a different protocol and other means of detection and handling is necessary
- Keep the
-
Help the users adapt to our plan:
- Help fix VSCode properly, make it compatible with our current and future plans (/cc @roblourens Ref: [wip] implement
runtimeExecutableversion detection microsoft/vscode-node-debug2#100) - Make sure JetBrains handle node8 nightlies (/cc @ulitink @segrey youtrack#WEB-26568)
- Help fix VSCode properly, make it compatible with our current and future plans (/cc @roblourens Ref: [wip] implement
User feedback
I'm trying to get more feedback from @roblourens and JetBrains, so you could make the best decision.
-
Quote from youtrack#WEB-26568

-
Comment from @roblourens regression: 3rd party debuggers are incompatible with node8 nighlies #12364 (comment)
P.S. at present WebStorm and IDEA based IDEs can't trigger debug in node8 nightlies (nor can VSCode)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.ltsIssues and PRs related to Long-Term Support (LTS) releases.Issues and PRs related to Long-Term Support (LTS) releases.
Activity
refack commentedon Apr 24, 2017
After hearing from the IDE vendors, IMHO we should forget about
--inspect-brk, it won't get adopted, and just keep--debug-brkpermanently.Protocol detection & resolution is done in orthogonal ways anyway.
sam-github commentedon Apr 24, 2017
I'm OK with keeping
--debug-brkpermanently as the flag meaning "break-on-first-line" (too bad it wasn't called that originally). It seems analogous (to me) with hownode debugstarts the inspector in most recent. In which case, we don't have to backport anything, we just start the deprecation process for--inspect-brk(so long, barely had time to know you).I'm also OK with backporting
--inspect-brk.gibfahn commentedon Apr 24, 2017
It seems to me that if you ignore the
--inspect --debug-brkcombo, then the situation becomes much more simple. Going forward we want a flag that means "start the debugger and break on the first line", and we have two options. The pros and cons are:--inspect-brk--inspect+--inspect-brkmakes sense--debug-brkalready exists--debug-brk--debug-brkon v6 !==--inspect --debug-brkon v6 and !==--debug-brkon v7Thinking about this further, I'd be +1 for abandoning
--inspect-brkand sticking with--debug-brk. By Node 10 or 11, no-one will (hopefully) remember or need to care about the difference between the two protocols, we'll just have the one. And at that point having--debug-brkmean "start a debugger and break" seems like the natural choice.If we're going to do that then we should not backport
--inspect-brk, and we should re-add--debug-brkto master.EDIT: I'd also say that the number of times I've used the inspector without the
brkoption is very small, I'd say this is really the default option for a user.gibfahn commentedon Apr 24, 2017
@sam-github the thing is that you're not supposed to do
--inspect --debug-brk, you're just supposed to do--debug-brk, which debugs and breaks. So it actually seems pretty well named to me. The--inspect --debug-brkthing is a temporary aberration caused by having two debug protocols in one version of Node.refack commentedon Apr 24, 2017
If you look at the code it's actually syntactic sugar for three operations:
I think ideally it would have only been used by users, while vendors used the three explicit args
--inspect --brake-on-first --debugger-port=5599BTW: should it be "break" of "brake"?
gibfahn commentedon Apr 24, 2017
I think it's break as in breakpoint.
sam-github commentedon Apr 25, 2017
@Trott @eugeneo thoughts? doesn't matter to much too me which we do, but we need to do one or the other, allow --debug-brk in all versions, or backport --inspect-break.
Trott commentedon Apr 25, 2017
I'm happy to defer to the judgment of @nodejs/diagnostics and @nodejs/LTS on this.
MylesBorins commentedon Apr 25, 2017
33 remaining items
Fishrock123 commentedon May 10, 2017
Cross-posting from: #12580 (comment)
refack commentedon May 10, 2017
I'll try to sum:
--inspect --debug-brkto triggerinspectorrefack commentedon May 10, 2017
#12630 (comment)
They all had a release cycle while both protocols were available. Unfortunately they used
--inspect --debug-brkto triggerinspector. That's hardcoded logic in all current versions.hybrist commentedon May 10, 2017
To elaborate on what @refack already said: What was stopping them was that
--inspect-brkunfortunately didn't exist yet when they started to work on the integration. So they couldn't do the "right" thing.refack commentedon May 10, 2017
If I understand correctly CTC agreed to restore
--inspect --debug-brkas alias to--inspect-brk, pending @ChALkeR's investigating an issue.Trott commentedon May 14, 2017
Pinging @ChALkeR: Did you gather the information you needed to gather? Are we prepared to move forward with restoring
--inspect --debug-brk? Or not yet?joshgav commentedon May 15, 2017
@refack
This is my understanding as well, and #12949 accomplishes that (and more).
@jkrems
I agree, and in fact I think this might be @ChALkeR's primary concern.
Based on this, #12949 should not add back
--debugat all.On the other hand, it could be helpful to our users to print a friendly message when
--debugis specified in 8.x. I don't think that should be part of #12949 but would be appropriate for another PR.inspector: --debug* deprecation and invalidation
inspector: --debug* deprecation and invalidation