Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Feature Request] Change Attach to Process to not require a program name by inferring it. #1272

Description

@chibicitiberiu

Currently, in order to attach to a process, I need to provide the following fields in my launch.json:

{
    "name" : "Attach (gdb)",
    "type" : "cppdbg",
    "request" : "attach"
    "program" : "${workspaceFolder}/path/to/program",
    "processId" : "${command:pickProcess}",
    "MIMode" : "gdb"
}

In my tests, it seems that the program field is validated (i.e. the executable exists, it is a valid executable), but it is completely ignored when debugging. I can set "program" = "/bin/bash" and attach to any process I want. But if I set "program" = "non existent file", I get a launch error that the program doesn't exist.

So why do I need to provide a path to the executable, when it is not needed?

Of course, it would be nice if ${command:pickProcess} would use this field to filter the processes, but it doesn't. Even then, it should be optional.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions