microsoft / microsoft/vscode-cpptools

Ability to detach instead of stop debugging

Open
#14,124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Environment
  • OS and version: Ubuntu Linux 24.04LTS

  • VS Code: Version: 1.96.3
    Commit: 91fbdddc47bc9c09064bf7acf133d22631cbf083
    Date: 2025-01-09T18:14:09.060Z
    Electron: 32.2.6
    ElectronBuildId: 10629634
    Chromium: 128.0.6613.186
    Node.js: 20.18.1
    V8: 12.8.374.38-electron.0
    OS: Linux x64 6.8.0-90-generic

  • C/C++ extension: 1.29.3

  • OS and version of remote machine (if applicable): Debian Linux

  • GDB / LLDB version: GNU GDB 16.3

Bug Summary and Steps to Reproduce

Bug Summary:

I can't attach my cross-debugger to a remote target without being killed at the end.

I want to debug my application running on a remote target.

For this, on the target I'm running gdbserver :1234 --attach $(pidof myapp).

I have created a launch.json script for vscode:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "cppdbg",
            "request": "launch",
            "preLaunchTask": "Debug: Start gdbserver",
            "program": "/home/developer/src/build/Debug/myapp_unstripped",
            "cwd": "/home/developer/src",
            "MIMode": "gdb",
            "miDebuggerPath": "aarch64-linux-gnu-gdb",
            "miDebuggerServerAddress": "IP:1234",
            "stopAtEntry": false,
            "logging": {"engineLogging": false},
        }
    ]
}

I want VS Code to leave my app alone when I finish debugging, i.e. do not kill it.

As far as I know I can use attach instead of launch, but it always drops me a process picker on my local machine.

How can I finish debugging without killing the process?

I'm on Linux, target is also Linux, but different architecture.

Debugger Configurations
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "cppdbg",
            "request": "launch",
            "preLaunchTask": "Debug: Start gdbserver",
            "program": "/home/developer/src/build/Debug/myapp_unstripped",
            "cwd": "/home/developer/src",
            "MIMode": "gdb",
            "miDebuggerPath": "aarch64-linux-gnu-gdb",
            "miDebuggerServerAddress": "IP:1234",
            "stopAtEntry": false,
            "logging": {"engineLogging": false},
        }
    ]
}
Debugger Logs
No need. I'm forced to use "launch" which only has "Stop debugging" which will stop my app. I wish to detach from debugger.
Other Extensions

No response

Additional Information

No response

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

No repository files or tests are named. Start with the cppdbg launch configuration in launch.json and the Stop debugging behavior described in the issue, then determine how a remote gdbserver session can detach without stopping the target process. Done means finishing the session leaves the remote application running.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.