Since Visual Studio 2015, remote debugging is supported. You can compile it in the target Linux environment, run it on GDB, and work with that GDB using the Visual Studio debugger interface.
Anything that is not included in the standard C / C ++ library will appear as a syntax error in Visual Studio. However, since the code is compiled and executed on the target Linux, there is no problem if the code can be compiled by hitting g ++ etc. in the target environment.
If you really care about it, you can bring a set of header files from the target system, throw them in an appropriate directory, and add them to the include directory of the project properties.
2017.08.20 Addendum: It can also be a network drive or Samba share. If Visual Studio can read and parse the header file, the syntax error will disappear.
As long as you're using Visual Studio, you want to take care of IntelliSense.
Frequently used items are included in $ (ISenseIncludePath)
.
$(ISenseIncudePath)
By default, it looks like this: (Depending on the version of Visual Studio)
Build and run the project.
Since you cannot see the console output as it is, open the console in the Linux environment.
When using remote debugging for the first time, a screen for specifying the connection destination will appear.
It looks like this when it can be executed.
By default, gdbserver is started in the target environment and connected to it from Visual Studio.
If you are told that gdbserver cannot be found, include gdbserver.
% zypper in gdbserver
And
% apt-get install gdbserver
You can use variable watchers, deassembly, and call stacks with familiar screens and operations.
Recommended Posts