CMake example code in Visual Studio encounters GDB connection issues when debugging on a remote Linux platform.

Lionel Dong 15 Reputation points
2024-01-13T05:11:42.15+00:00

I need assistance troubleshooting an issue that has been troubling me for a week,

When building a cross-platform Linux program using CMake in Visual Studio, an error message window pops up during runtime with the message "Unable to start debugging. Unable to establish a connection to GDB. Debug output may contain more information."

After clicking "OK", a new error message window appears with the message "Operation aborted (Exception from HRESULT:0x80004004(E_ABORT))."

The Linux platform information:

  • ubuntu18.04.6 LTS (Bionic Beaver) x86_64 Nvidia GPU Server
  • kernel: 5.4.0-48-generic
  • lldb version 6.0.0
  • GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2
  • cmake version 3.22.1
  • ninja 1.8.2
  • gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

The cross-platform log:

User's image

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.