Remote debugging on NAO¶
This section is specific to Aldebaran cross-toolchains and the NAO robot.
In this section, we will assume you have already configured qibuild to use a
geode cross toolchain, and that the IP of your robot is
See the section Using toolchains for more details.
We will then show you how you can use
qibuild deploy to upload the
code you have just cross-compiled to the robot, and then debug it.
qibuild deploy uses
ssh, you should make sure you can
access your robot with
ssh without typing your password over
and over and that
rsync is installed.
ssh-keygen ssh-copy-id firstname.lastname@example.org
sudo apt-get install rsync
Running qibuild deploy¶
Here we will deploy all the code to a directory on the robot
You can choose whatever directory you want.
Here’s how you would compile and upload the
example, for instance:
cd examples/core/sayhelloworld qibuild configure -c geode qibuild make -c geode qibuild deploy -c geode email@example.com:target
Here is what should happen:
- The project will be installed in a temporary directory named
deployinside the build directory.
- The debug symbols will be stripped from the binaries
deploydirectory will be synchronized with the
targetdirectory on the robot.
- Some gdb helpers script will be created.
At this point, you can look at the qibuild output messages to run a gdb server on the robot, and then start using gdb from the command line on your box.
But of course you may wish to use a IDE instead.
Remote debugging only has been tested with QtCreator, but the procedure should be more or less the same for other IDEs.
- If you have not already, please read the section Building with qibuild and QtCreator.
- Run the gdb server script on the robot:
$ /home/user/src/sayhelloworld/build-geode/deploy/remote_gdbserver.sh bin/sayhelloworld .... Server listening to 2159
- Open QtCreator and select the
connect to a remote gdb serveroption
- Configure the remote debugging settings:
You should select the binary in
- And then start debugging as usual:
The gdb server will exist as soon as the debug session ends. Simply rerun the script when this happens.
The output of the program will be shown in the terminal where you ran the gdb server script.