Debugging boosted applications

Debugging

To debug a launched application, the debugger must be attached to an already running booster process. Due to security limitations, it is required to use aegis-su tool from aegis-dss-tools package. For instance:

1. Run the following command:

aegis-su -r tcb aegis-exec -p gdb -a CAP::sys_ptrace gdb /usr/bin/applauncherd.bin $(pgrep booster-d)

2. Set a breakpoint to the application code and let the process continue to that point:

(gdb) break main.cpp:42
No source file named main.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (main.cpp:42) pending.
(gdb) c
Continuing.

3. Invoke the application with the booster to which the debugger is attached:

invoker --type=d /usr/bin/myApp

PIE binaries and debugging

If you use the pkg-config when building your binaries, they are linked with the -pie flag. The -pie flag makes your binaries position-independent executables. This means that the executables can be either used as a normal shared library or run, for example, from the command line.

This creates problems when debugging your application with gdb older than version 7.1 which introduced the support for PIE binaries.

To use gdb 7.0 or earlier, link your binaries as libraries by using -shared instead of -pie. After this, you cannot execute your binaries directly, you have to use invoker.

Setting correct linker flags with qmake:

QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
QMAKE_LFLAGS += -shared -rdynamic

Remember to remove the CONFIG += qdeclarative-boostable, if used (the same applies for meegotouch-boostable or qt-boostable).


Generated on Wed Jul 25 20:12:40 2012 for applauncherd by  doxygen 1.5.6