Warning
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 nao.local
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.
Since 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 nao@nao.local
sudo apt-get install rsync
Here we will deploy all the code to a directory on the robot named target.
You can choose whatever directory you want.
Here’s how you would compile and upload the sayhelloword example, for instance:
cd examples/core/sayhelloworld
qibuild configure -c geode
qibuild make -c geode
qibuild deploy -c geode nao@nao.local:target
Here is what should happen:
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.
$ /home/user/src/sayhelloworld/build-geode/deploy/remote_gdbserver.sh bin/sayhelloworld
....
Server listening to 2159
Warning
You should select the binary in build-geode/deploy/bin, not in build-geode/sdk/bin
Note
The gdb server will exist as soon as the debug session ends. Simply rerun the script when this happens.
Note
The output of the program will be shown in the terminal where you ran the gdb server script.