0

I am writing a small Linux app using Visual Studio 2015. To do so, I am using the Visual Studio 2015 Linux Extension, v 1.0.7 (the latest version as I'm writing this post).

I can compile and run the app on the remote environment using gdbserver, but I can't use breakpoints. I don't get why.

Details:

The target environment is a remote Ubuntu 64, on which g++, gdb and gdbserver have been upgraded today.

The extension works in that sense the C++ code is properly sent to the remote environment and properly compiled as a result of pressing F7:

  • My code (I am using some toy code for this post)

enter image description here

  • The resulting build log

enter image description here

The code is also properly executed remotely using gdbserver when I'm running it: the output is properly sent back by gdbserver as I can view it in VS's Linux Console Window.

enter image description here

My problem: when I set a breakpoint in my code (as in line 7 of my code above), it is just ignored. And when I just press F11 to start debugging straight at startup, the program just runs as if I wasn't debugging. I'm wondering whether this is tied to the debugging from host 127.0.0.1 message above.

Of course I'm in debug mode when trying:

enter image description here

  • Optimizations are disabled:

enter image description here

  • Symbols are there:

enter image description here

  • And debug settings are by default. I left them unchanged after having installed the extension. There are no ports set, could it be the cause?

enter image description here

  • And finally, I can do some step-by step debugging if I replace gdbserver by gdb in my debug configuration above, and if I use F10 (or any other stepping option), not F5, to start debugging. The drawbacks being that I lose the Linux Console and I still can't set breakpoints, they are ignored. I have to step during the whole execution path:

enter image description here

This is the first time I am trying this Linux Extension with a remote environement. I was formerly using it with a local Cygwin and had no issues with breakpoints. But this was the previous version (1.05) of the Visual Studio 2015 Linux Extension so this does not prove anything.

Any idea?

Shlublu
  • 10,917
  • 4
  • 51
  • 70
  • There are some compatibility problems with the latest gdb release. Look at https://github.com/Microsoft/VSLinux/issues/119 to see whether it applies in your case. – stanthomas Jul 04 '17 at 00:09
  • Thanks a lot @stanthomas - Actually, yes, it does precisely apply to my case. `gdb --version` claims to be 7.11.1 – Shlublu Jul 04 '17 at 13:29

0 Answers0