Skip to content

Cannot attach debugger to VS Code using process._debugProcess #53789

@TomasHubelbauer

Description

@TomasHubelbauer

VS Code version: Code 1.25.0 (0f080e5, 2018-07-05T13:11:58.697Z)
OS version: Windows_NT x64 10.0.17134

I cannot seem to be able to attach a debugger to an existing instance of Code by executing process._debugProcess(<code-pid>) (which is a Windows version of kill -s SIGUSR1 <node-pid>) in a separate instance of Node.

The call succeeds (doesn't throw an error), but doesn't print out information like this:

Debugger listening on ws://127.0.0.1:9229/cf49bcfe-d922-4f89-b438-57755d254198
For help see https://nodejs.org/en/docs/inspector

The above lines are printed out upon successful attachment to other running Node processes.

Because this is not printed out, I cannot know what port and UUID to use to connect to the debugger using CDP.

When I run the above and then scan all open ports of 127.0.0.1 and issue http://127.0.0.1:<port>/json/list against all of them, I do not find any open port where this URL (which is the same as chrome://inspect) returns a list of targets containing a VS Code instance.

Is it possible to attach a debugger to an existing VS Code instance and connect to it using CDP?

Metadata

Metadata

Assignees

No one assigned

    Labels

    debugDebug viewlet, configurations, breakpoints, adapter issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions