microsoft / microsoft/vscode-cpptools

[Enhancement] GDB attach config in Linux should not have "program" as a required parameter

Open
#5,713 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger enhancement
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Debugger

Describe the bug

  • OS and Version: Linux (All versions)
  • VS Code Version: 1.46.1
  • C/C++ Extension Version: v0.29.0-insiders
  • Other extensions you installed (and if the issue persists after disabling them): Not Applicable
  • A clear and concise description of what the bug is.

I have been using VS Code with C/C++ Debugger extensively for debugging running applications in Linux
GDB attach config in Linux currently needs path to executable i.e. the "program" parameter in launch.json
This parameter is marked as "required" in the json schema
Standalone GDB can attach to a process using just the "pid".

Can this extension be enhanced to support attach configuration with just a pid / attachQuickPick
If the executable path is necessary, then I suppose it can be queried using proc file system (/proc/'pid'/cmdline or /proc/'pid'/exe)

To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:

  1. Use the attached "launch.json"
    launch.json.zip

  2. Start this launch config

  3. Select a process to attach the debugger to

  4. A popup is displayed that attach property "program" is missing ("1.png")
    1

)

Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with the attached launch.json and inspect how the Linux GDB attach configuration marks or validates the program parameter. Compare this with attaching by pid and the documented /proc/pid/cmdline or /proc/pid/exe paths. Done means a Linux attach configuration using only a pid can start without the missing-program prompt.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, typescript
Domain
devtools, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.