vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

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.

Open HerrCraziDev opened this issue 1 year ago • 4 comments

Environment

  • OS and version: Windows 11
  • VS Code: 1.88.1
  • C/C++ extension: 1.19.9
  • OS and version of remote machine (if applicable): Linux (yocto) kernel 5.15.71
  • GDB / LLDB version: gdbserver 11.2

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 avatar Apr 30 '24 16:04 HerrCraziDev

Any news on this ?

HerrCraziDev avatar Jun 06 '24 18:06 HerrCraziDev

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.

WajahatRiaz avatar Jun 10 '24 15:06 WajahatRiaz

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

sean-mcmanus avatar Jun 10 '24 17:06 sean-mcmanus

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

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

HerrCraziDev avatar Aug 08 '24 10:08 HerrCraziDev