Skip to content

Ability to detach instead of stop debugging #14124

@danergo

Description

@danergo

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

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