Remote debugging with Anjuta
Owners: Haitao Feng, Kevin Wang
Using the Anjuta IDE with the Moblin Anjuta plug-in for Anjuta provides a good environment for creating and remote debugging of Moblin applications on Ubuntu and Fedora.
Import Your Project into Anjuta
For this tutorial we will be using the sample clutter application. The source for this is included in the SDK under "samples". You can also use your own project.
Start anjuta:
$ anjuta
Click "File->New->Project From Existing Sources", choose a project name and enter the source directory.
Configure the Anjuta Debugger and Moblin SDK plug-ins
If you have not already installed Anjuta and the Moblin SDK plug-in, follow the steps on the Moblin Anjuta Plug-in project page.
- Enable the Anjuta Debugger plug-in
Click "Edit->Preferences. Select the "General" icon in the left panel, then the "Installed plugins" tab. Click "Debugger" (usually already selected) to enable the Anjuta debugger. - Enable the Moblin SDK plug-in
While viewing the installed plug-ins, also select the "Moblin SDK" plug-in. A new icon will appear for the Moblin plug-in settings in the left panel of the Preferrences dialog. - Configure the Moblin plug-in
Click the Moblin SDK icon in the left panel.- Select "Use an external toolchain" and set "SDK root" to: ~/moblin-sdk-${version}/moblin-cross-toolchain
- Set "Toolchain triplet" to "i586-moblin-linux"
- Select "Use an external device" and set "IP address" to your netbook's IP address
- Restart anjuta
Configure and Build the Project
Now that anjuta is configured to use the Moblin SDK toolchain we are ready to build our application.
- Run "configure": Click "Build->Configure Project->Execute"
- Run "make": Click "Build->Build Project"
Configure the netbook to enable remote deployment and debugging
Build on your workstation, deploy to the netbook, debug remotely.
- gdbserver enables you to walk through code on your workstation while the program is running on the netbook
- openssh-server and rsync enable you to easily send newly built binaries from the workstation to the netbook. This is called "deploy" in anjuta
- xhost + allows remote systems to connect and display content on the display
On your netbook, run the following in a terminal:
$ sudo yum install gdb-gdbserver
$ sudo yum install openssh-server
$ sudo yum install rsync
$ xhost +Deploy Project
When you "Deploy" your application it is the same as running "make install" on the Netbook. The application icons, data, and binaries are all installed in the appropriate locations. The Netbook root user priveleges are required.
To Deploy your application, click: "Tools->Deploy". You can see the results in the Deploy window.
Test Run Project on Netbook
Click "Tools->Run Remote ...". Enter the full path where your application was installed on the Netbook. For the sample application, enter "/usr/local/bin/clutter-helloworld".
Remote Debugging on Netbook
- Start gdbserver on Netbook. In a terminal, run:
$ gdbserver localhost:<port> <full-path-to-program>
( for clutter-helloworld program and using port #8080 you would enter: )
$ gdbserver localhost:8080 /usr/local/bin/clutter-helloworld
Note: gdbserver must be started each time you debug your application. - Start anjuta debugging session on Workstation
- In anjuta, set a breakpoint in your source code (right-click on a line of code and select "Toggle Breakpoint")
- Click: "Run->Debug Remote Target ...".
- In the "Connect to remote target" dialog, enter the Netbook IP address and port used with gdbserver above. Click "Connect"
- Printer-friendly version
- Login or register to post comments


Comments (5 total)
Solution: Cannot select "Moblin SDK" plug-in
You need to find out the reason why the particular 'shared object', , in this case is being reported to be missing.
It could be one of various factors. I am only enlisting the error-tracking procedure that I used.
a) After running envsetup.sh, check if the moblin SDK has been properly set up. You can verify the setup by checking the values of the (exported) environment variables (mentioned in the envsetup.sh file) by typing $ at the command prompt. You need to type it in without the angle brackets.
b) Incase you get any 'missing library' or 'missing shared object' errors, you will need to go to your Software Package Manager, and search for the missing library or shared object. The specifics of this process are not possible to explain here as there are too many variations. The point is, it is really simple to find the solution of 'missing library' or 'missing shared object' if a methodical approach is followed.
Hope this helps!
This is probably due to a bug
This is probably due to a bug with the plugin and certain versions of Anjuta: see this comment for more details.
I get the same error on Fedora 11
same error on Fedora 11, anjuta 2.26.22.2
what version on anjuta was the plugin compiled against?
Cannot select "Moblin SDK" plug-in.
In the step below,
•Enable the Moblin SDK plug-in
While viewing the installed plug-ins, also select the "Moblin SDK" plug-in. A new icon will appear for the Moblin plug-in settings in the left panel of the Preferrences dialog.
I met this.
I got this on Ubuntu 9.10.
This has been logged as an
This has been logged as an SDK bug:
http://bugzilla.moblin.org/show_bug.cgi?id=7918