Debugging on apalis imx6 with gdb debugger

Hello,

We try to debug our cross-compiled c application with qt-creator and encounter Python problems.
The direct access from gdb to gdbserver also displays errors.

Our first question is, why the yocto-image 2.7 contains an older gdbserver version (7.8) in comparison to the gdb debugger build for the SDK (7.11).

The second question is, why the gdb debugger gives us the following start up warnings:

./arm-angstrom-linux-gnueabi-gdb /home/cc/evtest_1/evtest_1
Python Exception <class 'ImportError'> No module named 'imp':

warning: 
Could not load the Python gdb module from `/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (Linaro GDB) 7.8-2014.09
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-angstromsdk-linux --target=arm-angstrom-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.linaro.org>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/cc/evtest_1/evtest_1...done.
(gdb) python import sys; print(sys.version)
3.5.2 (default, Sep 25 2017, 11:27:51) 
[GCC 5.2.1 20151005]
(gdb) 

Qt-creator debugger log:

>&"python sys.path.append('/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi/data-directory/python')\n"
>13^done

>&"python from gdbbridge import *\n"
>&"Error while executing Python code.\n"
>14^error,msg="Error while executing Python code."

>&"python theDumper.loadDumpers({\"token\":15})\n"
>&"Error while executing Python code.\n"
>15^error,msg="Error while executing Python code."
dNOTE: ENGINE SETUP FAILED
dState changed from EngineSetupRequested(1) to EngineSetupFailed(2) [master]
dHANDLE RUNCONTROL FINISHED
sDebugger finished.
sUser requested stop. Shutting down...
dHANDLE RUNCONTROL START FAILED
dState changed from EngineSetupFailed(2) to DebuggerFinished(22) [master]

dQUIT DEBUGGER REQUESTED IN STATE 22
>16^done
dCOOKIE FOR TOKEN 16 ALREADY EATEN (DebuggerFinished). TWO RESPONSES FOR ONE COMMAND?

Thank you in advance,
Jens Römer

Hi

Our first question is, why the yocto-image 2.7 contains an older gdbserver version (7.8) in comparison to the gdb debugger build for the SDK (7.11).

If that should really be the case, then you did not build the image and the SDK from the same OE setup. At least if checking out 2.7.3 I get a Linaro based 7.8 gdb and gdbserver.

But since in the console output above gdb reports to be GNU gdb (Linaro GDB) 7.8-2014.09 I guess you did check the gdb version from a binary toolchain you have installed or you did compare with a poky based SDK you have also installed.

The second question is, why the gdb debugger gives us the following start up warnings:

Did you check the following two community posts?

Max

Hi Max,

thanks for your answer and sorry for the long delay - we somehow forgot about this questions…

If that should really be the case, then you did not build the image and the SDK from the same OE setup. At least if checking out 2.7.3 I get a Linaro based 7.8 gdb and gdbserver.

That may be, because we needed to upgrade Qt to 5.9 and therefore changed meta-qt5 directly to code.qt.io.

Thanks also for your links, we will try them the next days. From a glance, it looks like these answers could help us.

Thanks and regards,
André