Skip to content

"program" field required when attaching to a running process with GDB #11284

@kyselejsyrecek

Description

@kyselejsyrecek

Environment

  • OS and version: Ubuntu 23.04
  • VS Code: 1.80.2
  • C/C++ extension: ms-vscode.cpptools 1.16.3
  • OS and version of remote machine (if applicable): Linux, ARM
  • GDB / LLDB version: GNU gdb (Ubuntu 13.1-2ubuntu2) 13.1 (gdb-multiarch)

Bug Summary and Steps to Reproduce

When attaching to a running process, either locally with GDB, or remotely with the combination of GDB/GDB Server, VSCode insists on specifying the "program" attribute of the debugging "request": "attach" configuration. No such step is needed when attaching to a running process, either local or remote, with pure GDB manually from the terminal.

Often in production, the requirement to specify a path to the binary being executed within a given remote process would imply downloading the binary manually before starting the debugging session and then manually altering the "program" field in launch.json or pasting it always into an input before a debugging session is started. It seems that providing path to a different binary does not have any negative impact on VS Code, as the binary is parsed internally by GDB and so are built-in symbols or external symbol files.

Debugger Configurations

    {
      "name": "C/C++: remote debugging",
      "type": "cppdbg",
      "request": "attach",
      "useExtendedRemote": true,
      "program": "${input:pathToBinary}", // <<< debugged executable // FIXME
      "MIMode": "gdb", 
      "miDebuggerPath": "gdb-multiarch",
      "miDebuggerServerAddress": "${input:targetIP}:1234"
    }

Debugger Logs

N/A

Other Extensions

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions