KDbg as simple GUI debug frontend
Most developers don’t want to use GDB from the command line. As said previously, there are a lot of front ends available to GDB. For those who don’t want to use a full-featured IDE such as Eclipse or Qt Creator , debugging from a front-end KDbg may be a good choice.
KDbg can be installed on Ubuntu with the following command:
sudo apt-get install kdbg
The cross debugger to be used by KDbg is set up by starting KDbg on the development host once without connecting to the target:
The GDB command to invoke can be set up under the dialog opened with Settings->Global Options... as shown in KDbg global options image.
Set up How to invoke GDB in the dialog as shown in KDbg global options dialog image as follows:
$ arm-seconorth-linux-gnueabi-gdb -iex "set sysroot /opt/seconorth-wayland/kirkstone-7.0/sysroots/cortexa9t2hf-neon-seconorth-linux-gnueabi set auto-load safe-path /opt/seconorth-wayland/kirkstone-7.0/sysroots/cortexa9t2hf-neon-seconorth-linux-gnueabi" `find /opt/seconorth-wayland/kirkstone-7.0/sysroots/cortexa9t2hf-neon-seconorth-linux-gnueabi/usr/src/debug -type d -printf '-d %p '` -d$PWD --fullname --nx
KDbg does not have the possibility to enter gdb commands. So the sysroot setup is done through GDB’s -iex command line parameter instead.
Exit from KDbg now.
The gdbserver controlling myapp on the target is started as in the GDB command line scenario described previously:
$ ssh root@172.20.55.89 'gdbserver :2345 /tmp/myapp' &
Start KDbg again with connecting to target device with the following command out of the myapp
directory:
The KDbg opens again while connecting to the target.
Source files can be opened through File->Open Source... as shown in KDbg source navigation image.
Select main.cpp as shown in KDbg source file selection.
Now, a break point can be set by right-clicking on the desired instruction as shown in KDbg break-point setup image.
By selecting Execution->Run the execution can be started as shown in KDbg run command image.
The break-point hit is indicated by the green arrow as shown in KDbg break-point hit image.
The further usage of KDbg is self-explaining.
For further documentation please consult the KDbg reference manual.