|
To debug ArmarX applications you can use GDB in the following way:
After gdb has finished loading the program it can be executed by typing 'run' into the gdb console window. This will start executing the program (a bit slower than usual) and stop if a segmentation fault occurs.
Here is a list of the most used gdb commands:
Debugging with QtCreator is supported. Depending on your setup you may have to allow the QtCreator debugger to attach to external programs. If you try to attach to an ArmarXComponent and you get a message like "ptrace: Operation not permitted." you need to execute the following command before starting the program (sudo rights needed, taken from https://bugreports.qt-project.org/browse/QTCREATORBUG-3509):
Note that after rebooting the value will be reverted to 1. You can add this line to a startup script (or figure out a permanant solution).
If you need to inspect the startup routines of your component you need to start the component via QtCreator. Using the attaching method (as described above) you are not able to stop at breakpoints in the initialization routines (Constructor/onCraeteCompontent, etc). If the component requires additional configuration files you need to add this information to the startup configuration. Go to the "Projects" pane on the left and select the "Run Settings" properties page on the top. Select the component you want to debug and edit the startup settings (Run->Arguments) and add the following to the "Arguments" tab:
Now you can start your scenario as usual, but disable the component you want to debug in the startscript. Start the debugging of your component with QtCreator (play button wth bug, be sure the correct application is selected).
ArmarXGui plugins can be debugged similar to the methods described above. You can start the ArmarX GUI, attach to the ArmarXGui process with QtCreator and set your breakpoints. When you then load the gui plugin via the ArmarXGui menu, you are able to debug the methods of the plugin.