GUF-Yocto-jethro-9.0-r7707-0
i.MX6
User Manual
In this case
172.20.55.89
is used.
Now, recompile
myapp
and transfer it to the target (with
scp
in this case):
Note:
For all the following steps the SDK environment has to be sourced.
$ source
,!
/opt/guf/GUF-Yocto-jethro-9.0-r7707-0-sdk/environment-setup-imx6guf-guf-linux-gnueabi
$ make
$ make clean
$ make
$ scp myapp [email protected]:/tmp/myapp
If necesary, stop the automatically started demo application. This can be done from the development host with
ssh
:
$ ssh [email protected] '/etc/init.d/qt-guf-demo stop'
Start the
gdbserver
on the device (again from the host through
ssh
):
$ ssh [email protected] 'gdbserver :2345 /tmp/myapp' &
Now, the gdbserver is waiting for the remote debugger to connect on the specified port
2345
. The output should
look like this:
Process /tmp/myapp created; pid = 1266
Listening on port 2345
Start the remote debugger out of the
myapp
source directory:
$ arm-guf-linux-gnueabi-gdb `find /opt/guf/GUF-Yocto-jethro-9.0-r7707-0-sdk/sysroots/
,!
imx6guf-guf-linux-gnueabi/usr/src/debug/ -type d -printf '-d %p '` -d $PWD
,!
myapp
The embedded find command assures that the debugger can access all SDK source codes that are eventually
accessed by the debug session (e.g. setpping into a library call). Every source path found in the specified
directory is passed to GDB with the
-p
option. The source pathes inside the ELF debug information may be
relative or absolute. This depends how they are passed to the compiler. So this is the only way to assure
that every source path of the whole Yocto BSP is known by the debugger and every source file is found when
referenced.
After executing GDB with the above command the GDB shell is entered.
Set the sysroot for the debugger, where it can find the linker and the system libraries:
(gdb) set sysroot /opt/guf/GUF-Yocto-jethro-9.0-r7707-0-sdk/sysroots/imx6guf-guf-
,!
linux-gnueabi
(gdb) set auto-load safe-path /opt/guf/GUF-Yocto-jethro-9.0-r7707-0-sdk/sysroots/
,!
imx6guf-guf-linux-gnueabi
Connect to the target device:
(gdb) target remote 172.20.55.89:2345
The output from the debugger should look like this:
Remote debugging using 172.20.55.89:2345
Reading symbols from /opt/guf/GUF-Yocto-jethro-9.0-r7707-0-sdk/sysroots/imx6guf-guf-
,!
linux-gnueabi/lib/ld-linux-armhf.so.3...Reading symbols from /opt/guf/
,!
GUF-Yocto-jethro-9.0-r7707-0-sdk/sysroots/imx6guf-guf-linux-gnueabi/lib/.debug
,!
/ld-2.22.so...done.
69