Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug attach session never starts (endless waiting/loading) #12120

Open
borjamunozf opened this issue Mar 19, 2024 · 0 comments
Open

Debug attach session never starts (endless waiting/loading) #12120

borjamunozf opened this issue Mar 19, 2024 · 0 comments
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.

Comments

@borjamunozf
Copy link

borjamunozf commented Mar 19, 2024

Environment

  • OS and version: Ubuntu 22.04
  • VS Code: 1.87.2
  • C/C++ extension: 1.19.8
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version: 12.2 (tested with 14.1 also)

Bug Summary and Steps to Reproduce

Bug Summary:

For different kind of C++ projects in my company (complex or not) the attach debug session never starts nor attaches to the target PID at first time. The solution is always to kill the OpenDAP PID and launch again the attach debug config.

Sometimes it says waiting for connection but others it just show the attach configu in the Debug console and nothing more.

Steps to reproduce:

  1. Create launch.json with these configs.
  2. Execute config.

Debugger Configurations

 {
      "name": "whatever Attach sim.bin",
      "type": "cppdbg",
      "request": "attach",
      "program": "${workspaceFolder}/build/sim/default_rig/sim/sim.bin",
      "processId": "${input:findPidSimulatorsim.bin}",
      "MIMode": "gdb",
      "logging": {
        "trace": true,
        "engineLogging": true,
        "traceResponse": true,
      },
      "additionalSOLibSearchPath": "/opt/lib/:${input:whateverSysPath}/sysroots/x86-whatever-linux/usr/lib/:/lib/i386-linux-gnu:${input:whateverBuild}/Debug/platform/osal:${workspaceFolder}/build/whatever-x86/Debug/platform/osal_modules",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": false
        },
        {
          "description": "ignore SIGUSR1 signal",
          "text": "handle SIGUSR1 nostop noprint pass",
          "ignoreFailures": false
        },
        {
          "description": "disable non stop mode",
          "text": "-gdb-set non-stop 0",
          "ignoreFailures": false
        },
        {
          "description": "set async",
          "text": "-gdb-set mi-async 1",
          "ignoreFailures": false
        },
        {
          "description": "set sysroot",
          "text": "-gdb-set sysroot ${input:whateverSysPath}/sysroots/x86-whatever-linux/",
          "ignoreFailures": false
        },
        {
          "text": "set auto-load safe-path /",
          "ignoreFailures": false
        },
        {
          "text": "set print object on",
          "ignoreFailures": false
        },
        {
          "text": "set print vtbl on",
          "ignoreFailures": false
        }
      ]
    },
 "inputs": [
    {
      "id": "whateverBuild",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "ls ${workspaceFolder}/build/whatever*",
        "useSingleResult": true
      }
    },
    {
      "id": "whateverSysPath",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "ls -d -1 /opt/sdks/*/*",
        "useSingleResult": true
      }
    },
    {
      "id": "findPidSimulatoriosim.bin",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "pgrep -f 'sim.bin' | grep -v $$",
        "useSingleResult": true
      }
    },

Debugger Logs

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (128) LaunchOptions{\"name\":\"whatever_project Attach sim.bin\",\"type\":\"cppdbg\",\"request\":\"attach\",\"program\":\"/home/borjamf/workspace/whatever_project/build/sim/default_rig/sim/sim.bin\",\"processId\":\"13706\",\"MIMode\":\"gdb\",\"logging\":{\"trace\":true,\"engineLogging\":true,\"traceResponse\":true},\"additionalSOLibSearchPath\":\"/opt/lib/:/opt/sdks/whatever-sdk/x86_4/sysroots/x86-whatever-linux/usr/lib/:/lib/i386-linux-gnu:Debug/Debug/platform/osal:/home/borjamf/workspace/whatever_project/build/whatever-sdk_x86_4/Debug/platform/osal_modules\",\"setupCommands\":[{\"description\":\"Enable pretty-printing for gdb\",\"text\":\"-enable-pretty-printing\",\"ignoreFailures\":false},{\"description\":\"ignore SIGUSR1 signal\",\"text\":\"handle SIGUSR1 nostop noprint pass\",\"ignoreFailures\":false},{\"description\":\"disable non stop mode\",\"text\":\"-gdb-set non-stop 0\",\"ignoreFailures\":false},{\"description\":\"set async\",\"text\":\"-gdb-set mi-async 1\",\"ignoreFailures\":false},{\"description\":\"set sysroot\",\"text\":\"-gdb-set sysroot /opt/sdks/whatever-sdk/x86_4/sysroots/x86-whatever-linux/\",\"ignoreFailures\":false},{\"text\":\"set auto-load safe-path /\",\"ignoreFailures\":false},{\"text\":\"set print object on\",\"ignoreFailures\":false},{\"text\":\"set print vtbl on\",\"ignoreFailures\":false}],\"__configurationTarget\":6,\"__sessionId\":\"db4b7f4d-10cd-4703-9a6f-2b0a7fef4054\"}\n"},"seq":2}
1: (128) LaunchOptions{"name":"whatever_project Attach Docker iosim.bin","type":"cppdbg","request":"attach","program":"/home/borjamf/workspace/whatever_project/build/sim/default_rig/sim/sim.bin","processId":"13706","MIMode":"gdb","logging":{"trace":true,"engineLogging":true,"traceResponse":true},"additionalSOLibSearchPath":"/opt/lib/:/opt/sdks/whatever-sdk/x86_4/sysroots/x86-whatever-linux/usr/lib/:/lib/i386-linux-gnu:Debug/Debug/platform/osal:/home/borjamf/workspace/whatever_project/build/whatever-sdk_x86_4/Debug/platform/osal_modules","setupCommands":[{"description":"Enable pretty-printing for gdb","text":"-enable-pretty-printing","ignoreFailures":false},{"description":"ignore SIGUSR1 signal","text":"handle SIGUSR1 nostop noprint pass","ignoreFailures":false},{"description":"disable non stop mode","text":"-gdb-set non-stop 0","ignoreFailures":false},{"description":"set async","text":"-gdb-set mi-async 1","ignoreFailures":false},{"description":"set sysroot","text":"-gdb-set sysroot /opt/sdks/whatever-sdk/x86_4/sysroots/x86-whatever-linux/","ignoreFailures":false},{"text":"set auto-load safe-path /","ignoreFailures":false},{"text":"set print object on","ignoreFailures":false},{"text":"set print vtbl on","ignoreFailures":false}],"__configurationTarget":6,"__sessionId":"db4b7f4d-10cd-4703-9a6f-2b0a7fef4054"}

Other Extensions

No response

Additional Information

top output process, resource usage

imagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.
Projects
None yet
Development

No branches or pull requests

3 participants