microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.54k stars 1.56k forks source link

Unable to start debugging. Unexpected GDB output from command "-target-select remote 10.102.88.203:1223". Remote communication error. Target disconnected.: Connection reset by peer. #12262

Open HerrCraziDev opened 7 months ago

HerrCraziDev commented 7 months ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: When remotely debugging, vscode is unable to restart gdbserver when clicking the "restart" icon on the debug menu. The remote gdbserver exits and is never relaunched. It must be relaunched manually over SSH to re-initate a debugging session.

This extension should restart gdbserver on the remote.

Steps to reproduce:

  1. Start gdbserveron the remote gdbserver :<port> <path/to/bin>
  2. Connect to gdbserver from vscode
  3. Debug
  4. Click the "Restart" button in the debugger menu
  5. gdbserver exits on the remote and vscode displays the attached error.

Unable to start debugging. Unexpected GDB output from command "-target-select remote <ip>:<port>". Remote communication error. Target disconnected.: Connection reset by peer.

image

Debugger Configurations

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "PM Debug",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceRoot}/bld/<bin>",
      "miDebuggerServerAddress": "${env:RBIP}:1223",
      "args": [],
      "stopAtEntry": false,
      "cwd": "/opt",
      "environment": [],
      "externalConsole": true,
      "MIMode": "gdb",
      "miDebuggerPath": "${env:SDK_PATH}/sysroots/x86_64-deysdk-linux/usr/bin/aarch64-dey-linux/aarch64-dey-linux-gdb",
      "setupCommands": [
        { "text": "set sysroot ${env:SDK_PATH}/sysroots/cortexa53-crypto-dey-linux/", "description": "set sysroot", "ignoreFailures": false },
        { "text": "handle SIG34 nostop noprint pass noignore", "description": "disable SIG34 handling", "ignoreFailures": false }
      ],
      "additionalSOLibSearchPath": "${workspaceRoot}/bld/<bin>.so",
    }
  ]
}

Debugger Logs

Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[Inferior 1 (process 22216) killed]
The program '/home/<user>/<workdir>/bld/<bin>' has exited with code 0 (0x00000000).

Other Extensions

No response

Additional Information

No response

HerrCraziDev commented 5 months ago

Any news on this ?

WajahatRiaz commented 5 months ago

Did you try that bindto thing. Maybe it works for you. Specify hostname or IPv4 address on which to listen for incoming TCP/IP connections. By default, OpenOCD will listen on the loopback interface only. If your network environment is safe, bindto 0.0.0.0 can be used to cover all available interfaces. Simply add it to your config file and let me know if it works.

sean-mcmanus commented 5 months ago

@HerrCraziDev I don't have any update on this issue.

HerrCraziDev commented 3 months ago

@HerrCraziDev I don't have any update on this issue.

Still happening here. I didn't really understand @WajahatRiaz 's comment.