I read both Eclipse and VS supports remote development/debugging but I haven't tried with Eclipse yet. I recently tried with Visual Studio and it works pretty well. There are many blogs and articles already how-to's -- so this posting is note to myself.
Windows Side
- Visual Studio 2017
If you have Visual Studio 2017, it supports this out of the box, but I only have Visual Studio 2015. - Visual Studio 2015
Download this extension from below link, install it , and follow the steps: https://marketplace.visualstudio.com/items?itemName=VisualCppDevLabs.VisualCforLinuxDevelopment
Linux Side
It is assumed SSHd is installed and configured.$ sudo apt-get install -y openssh-server g++ gdb gdbserver
For "Blink" sample project in VS, do this on RPi:
$ sudo apt-get install git-core
$ git clone git://git.drogon.net/wiringPi
$ cd wiringPi
$ sudo ./build
Test
- Run VS
- File > New > Project > Installed > Visual C++ > Cross Platform > Linux
- Select "Console Application (Linux)"
- It'll ask for SSH connection to Linux
- Back to the sample code, make sure the target platform is "ARM"
- Click on "Remote GDB Debugger"
projects/
└── ConsoleApplication1
├── bin
│ └── ARM
│ └── Debug
│ └── ConsoleApplication1.out
├── main.cpp
└── obj
└── ARM
└── Debug
└── main.o
"ConsoleApplication1.out" is the binary.
Please read the links in References to find more info.
VS Connection Manager
To add, edit connections:Tools > Options > Cross Platform > Connection Manager
For existing project, go to Project Properties to change existing connections and other settings.
Remote Debug & Bring up Terminal
Click on "Remote GDB Debugger", and from top menu, Debug > Linux Console.Set Command Line Parameters
- Right click on Project (not Solution), and bring up Properties
- Configuration Properties > Debugging
- And on right pane, find "Program Arguments"
No comments:
Post a Comment