Skip to content

Feature request: API for debugging node child processes #9621

@mightyiam

Description

@mightyiam

Kind-of-recent changes in the debugging feature make it easy to debug a node process with whatever debugger speaks the protocol. Most notable, perhaps, is Chrome DevTools.

Further, a wrapper tool makes it trivial to start a node process with debugging on and launch the debugger on that. An example that I'm using is https://github.com/jaridmargolin/inspect-process.

For me, experience is smooth and I'm happy until I reach the great wall of the child process. For example, debugging any test that's run with my favorite test runner, https://github.com/avajs/ava, is kind of impossible, because all of the tests run in child processes and there's no feature to allow running tests in the main process.

inspect-process is considering monkey-patching methods of child_process for this purpose.

What I request is an API that will solve this.

Here’s a thought: An addition to the debugging protocol that:

  1. Informs the debugger that a new node child process is going to be launched
    1. Allows the debugger to decide whether that process will be debuggable
      1. If true, the debug port will be provided to the debugger and the debugger could launch a new instance of itself on that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions