GUF-Yocto-jethro-9.0-r7707-0
i.MX6
User Manual
done.
0x76fcfac0 in _start () from /opt/guf/GUF-Yocto-jethro-9.0-r7707-0-sdk/sysroots/
,!
imx6guf-guf-linux-gnueabi/lib/ld-linux-armhf.so.3
The execution is halted at the
_start
entry point before
main
. Set a breakpoint to
main
and let the debugger
continue execution:
(gdb) b main
...
(gdb) c
The debugger will continue and the breakpoint will be hit. This should look like this:
Continuing.
Breakpoint 1, main (argc=1, argv=0x7efffe14 at main.cpp:7)
7
cout << "Hello World!" << endl;
From now on debugging is almost like using a dgb natively on the target.
The following examples demonstrate the most basic use cases applyd to the
myapp
example:
Show call stack:
(gdb) bt
#0 main (argc=1, argv=0x7efffe14) at main.cpp:7
Show the contents of a variaable or more complex data type:
(gdb) p *argv
$1 = 0x7effff05 "/tmp/myapp"
Step over:
(gdb) n
8
return 0;
List code:
(gdb) l
3
using namespace std;
4
5
int main(int argc, char *argv[])
6
{
7
cout << "Hello World!" << endl;
9
return 0;
10
}
Command to stop the gdbserver on the target from the host remotely, if needed:
$ ssh [email protected] 'killall gdbserver' &
For more information consult the GDB documentation:
https://www.gnu.org/software/gdb/documentation
11.2.1 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 frontends
available to GDB. For those that don’t want to use a full featured IDE such as Eclipse or Qt Creator to just debug
from a front end
KDbg
may be a good choice.
KDbg
can be installed on Ubuntu with the following command:
70