BBB Remote Debugging
The general BeagleBone Black pages are here.
In the instructions below click twice on the pictures in order to get a high resolution version, that is easier to read. Two clicks are necessary because you click one time for opening the file and a second time for opening it in high resolution
In order to be able to debug remote the remote board needs a suitable gdbserver. There is one already onboard - or it can be downloaded using apt-get, but that one does not operate correct with the toolchain downloaded previously.
But luckily there is a suitable gdbserver included with the gnueabihf tools.
]$ scp /opt/toolchains/gnueabihf/bin/gdbserver <username>@<your BBB IP>:~/
If you set-up password-less login over SSH (see this page for details) your life will be much easier.
NOTE: The gdbserver has been moved in the newer pakages, and as it may happen again you may want to locate your gdbserver using these instructoins:
To find the gdbserver use these commands:
] $ cd /opt/toolchains/gnueabihf ] $ find . -name gdbserver
Copy your program to the BBB
You can test your newly developed ARM program on your BBB.
]$ scp <path to your project>/Debug/<yourbinary> <username>@<Your BBB IP address>:~
Log on to your BBB and try
and inspect the output.
Remote debugging from Eclipse
Next thing is to set up remote debugging.
In Eclipse select the Run menu and select Debug Configurations
First mark the C/C++ Remote debugging and then click on the new button to the upper left corner of the dialogue.
You'll get a dialogue like this:
Setup the connection
Press the New button to the right of the Connection line.
This will open a dialogue for setting up the connection to the BBB. We'll use SSH.
You can use the local IP address or any other configured for the BBB.
Returning to the main Debug Configuration dialogue you'll see that the Connection now has been filled in with the details you just provided.
Setting path on remote
Next you'll have to specify the complete path of your program to execute on the BBB. The program will be sent over the SSH connection before launching the gdbserver - so any changes made on the development host will be reflected on the binary on the BBB.
Here I just placed the binary in my home directory, but it could be anywhere suitable.
Configuring the debugger
Next thing to do is to click on the Debugger tab in the top of the dialogue. In this part of the settings you'll have to specify a complete path and name of the debugger - in this case we'll use the Linaro supplied residing in /opt/toolchains/gnueabihf
Also click on the Shared libraries tab and click Add and navigate to /opt/toolchains/gnueabihf/libc/lib and add that. This will remove some error messages during debugging.
Path to the remote gdbserver
Adjust the path to the gdbserver on the BBB.
You are now ready to debug. Press the Debug button.
You're asked a password for your login on the BBB.
And the you're told what system you're debugging.
And finally the debugger launches the program that has been transfered to the remote BBB and the gdbserver is launched with the program a a parameter and you can debug you application just like any other application.
Use the keyboard
Finally, if you want the F11 key to launch the debugger rather than fiddling around with the mouse trying to find the little debug button, open menu Window->Preferences and locate the setting as showed on the figure below. Select the Always launch the previously launched application. After your initial launch of the application to debug subsequent launches can be done by hitting F11. I find that rather convenient.