Create a project with source code and debug with gdbserver via adb forward

Suppose there is a project folder /home/srcdbg/project/test in the server www.sourcedebug.com and the cross-compiled executable is /home/srcdbg/project/test/srcdbg_test. srcdbg_test is put into the /data/test/ directory on the arm board to run and debug. gdbserver is also on the arm board for debugging application. Suppose you've downloaded gdb-multiarch from http://static.grumpycoder.net/pixel/gdb-multiarch-windows/ and unzip it to C:\gdb-multiarch-10.2 . Assume adb is located in the folder C:\adb-platform-tools and added to the PATH environment variable. Here are steps to create a new project.

1. Select File > New > Solution... > Wizard... and then click the OK button.

2. Enter the name of the project and click Next button.

3. Enter the correct Remote host, Port, Username, Password, Initial path and click Next button.

4. If you prefer, you can also access files via samba as follows and click Next button.

5. Click Next button.

6. Select Link type as Local GDB, input GDB path and input the Initial path of srcdbg_test on the arm board. Click Next button.

7. Click Finish button.

8. Enter the solution File name and click Save button.

9. Enter the project File name and click Save button.

10. Right click the srcdbg_test project and select Add > Add Existing Remote File to add the project files.

11. Select the needed folders and files and click Open button.

12. Select Build > Synchronize Files... to synchronize files and build the project symbols.

13. Select Build > Build Project to build the project.

14. Right click the srcdbg_test project and select Properties. Make sure it's an absolute path of the "Attach to program" line. Change the string "-i=mi ./$PROJECTNAME$" to "-i=mi C:\srcdbg\project\test\srcdbg_test". Configure Debug start command as "-exec-continue". Configure Postdebug command as "target remote :8888"

15. Run the command "adb forward tcp:8888 tcp:8888" to forward tcp with adb.

16. Run the command "adb shell" and then "gdbserver localhost:8888 /data/test/srcdbg_test" to bootup gdbserver on the board.

17. Select Debug > Start Debugging to debug the project.

18. Start debug with debug tool bars.