0

I have a console application written in C++ which I develop inside Qt Creator. I'm using toolchain and I've set in cmake CMAKE_SYSROOT, CMAKE_CXX_COMPILER to point to those from that toolchain. Also, I've added -g and -O0 to gcc. Then, I've made a kit inside Qt Creator to build and deploy executable to Raspberry Pi 3, and it works great. Now, I want to set up debugger to debug application remotely from my PC.

So, I've added gdbmultiarch compiler to my kit inside Qt Creator and set its working directory in options to the path of the sysroot which I've set in CMAKE_SYSROOT. Next, I installed gdbserver on Raspberry Pi and attempted to connect. That was successful, but I've got warning: "Could not load shared library symbols". Then, I went to Qt Creator options -> Debugger -> GDB -> Additional attach options and added

set sysroot [path to sysroot from toolchain]

but the warning stayed. I've also tried

set solib-search-path [path to libraries in sysroot from toolchain]

and

set solib-absolute-prefix [path to sysroot from toolchain]

but neither of those worked.

The only thing that worked is

set sysroot target:/

but then I'm loading all of the libraries from Raspberry Pi and it's slow. So what am I doing wrong and how can I fix it?

1 Answers1

0

Setting sysroot to qt5pi directory of my host worked for me. So for me it looks like:

set sysroot ~/raspi/qt5pi/

(in Qt Creator options -> Debugger -> GDB -> Additional attach options).