0

I have a sample c++ application which builds and runs fine in a Red Hat installation.

I wanted to have the source code of this application in my windows machine so I can create a Visual Studio project and use Visual Studio 2017's new features which makes it possible to build and debug programs on a Linux server.

I successfully managed the following

  • Create a 'make file' project using Visual Studio CE 2017
  • Connect to the remote server and build by invoking make command at the server

My remote debugger settings are as follows enter image description here

Remote Build Settings are as follows enter image description here

General Settings are as follows enter image description here

However, when I try to debug the program via Visual Studio (using gdb in the server) following error occurs

enter image description here

Since this doesn't reveal much, I enabled verbose mode (in GDB) and following is the verbose output. Apparently, GDB crashes after loading symbols for one of the source files.

enter image description here

Furthermore, I can manually GDB the binary in the Linux Server without any problems

enter image description here

warunanc
  • 2,221
  • 1
  • 23
  • 40
  • There appears to be an issue around threading because there's a clear difference between the two GDB outputs in that area. Are all the required shared libraries present? Is that the exact same makefile in Visual Studio as used from the command line on the Redhat system? Do you get the same result when you go to the VS created project folder on RedHat, make the makefile then start GDB? Can you share the details of the project settings `General` and `Remote Build` tabs (black out the login)? Which VS2017 version are you on? – stanthomas Apr 20 '18 at 16:36
  • A couple more questions: is this a GUI application, in which case which GUI? Is there anything in your `bash` environment that is not there in an `ssh` environment? Can you run the debug session over `ssh` from the Windows host outside VS? – stanthomas Apr 20 '18 at 20:44
  • @stanthomas this is not a GUI program. Let me help you to get this recreated at your end I'm trying to debug the following program https://github.com/warunanc/socket-programming-examples-c I used following links to try this out https://blogs.msdn.microsoft.com/vcblog/2017/04/11/linux-development-with-c-in-visual-studio/ https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/ Basically, I have invoked GDB on the remote server itself. The application is not built nor running in the windows box. All happens in the Linux box. – warunanc Apr 23 '18 at 07:15
  • @stanthomas I added the other project property images as well, in the question description – warunanc Apr 23 '18 at 07:23
  • I'll try to look at your application but, for now, can you confirm that, when you manually reproduce the steps used by Visual Studio *outside* Visual Studio, i.e. run `make` and `gdb` via `ssh` directly from the command line on the Windows host, everything runs fine. Because the most likely explaination is that there's something in your environment when logged in directly on the Linux remote that is different when going in via `ssh`. – stanthomas Apr 23 '18 at 22:18
  • Yes, it's working fine. Visual studio also basically creates a ssh session afaik – warunanc Apr 24 '18 at 00:24
  • Visual Studio drives the Linux remote over `ssh`. So, if you run manually run a remote session over `ssh` from the Windows host to the Linux system using the same login and same commends you will get exactly the same behavior as you see in Visual Studio. But it does have to be *exactly* the same, same commands, same folder, same paths, same steps. – stanthomas Apr 24 '18 at 15:03
  • It works when I run manually – warunanc Apr 24 '18 at 17:45
  • That doesn't make any sense to me 'cos all VCLinux does is drive the Linux remote over `ssh`. – stanthomas Apr 25 '18 at 14:12

0 Answers0