4

I use a cross-compiled Qt setup on a CentOS host. Developing Qt applications and executing them remotely on the Raspberry Pi works fine. But I got the following error when I try to debug the application:

enter image description here

I use the standard GDB from the official Raspberry Pi toolchain (tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gdb).

So what is wrong? Why does the GDB needs Python scripting when I use C++?

3 Answers 3

6

You can run this command in your terminal to install gdb

sudo apt-get install gdb
Sign up to request clarification or add additional context in comments.

1 Comment

Only the minimal version of the GDB (gdb-minimal) was installed on my Debian. sudo apt install gdb was the solution.
4

I usually build GDB from source, so you can configure it to include Python support:

First some dependencies:

yum install -y texinfo gcc gcc-c++ make python3-devel wget

Then build and install GDB itself:

target=arm-linux-gnueabihf
version=9.1

# Download and extract
cd /tmp
[ -e gdb-$version.tar.xz ] || wget https://ftp.gnu.org/gnu/gdb/gdb-$version.tar.xz
rm -rf gdb-$version
tar xf gdb-$version.tar.xz
mkdir -p gdb-$version/build
cd gdb-$version/build

# Get the Python executable and library directory
[ -z "${PYTHON}" ] && export PYTHON=python3
PYTHON_LIBDIR=$("${PYTHON}" -c \
    "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")

# Configure GDB
../configure \
    --prefix="$HOME/.local" \
    --target=$target \
    --with-python="${PYTHON}" \
    LDFLAGS="-L${PYTHON_LIBDIR}"

# Build and install GDB
make -j$(nproc)
make -C gdb install

GDB will be installed in ~/.local/bin, so add it to your path if you haven't already.

Comments

1

FYI, I had the same problem with a fresh Qt install on a fresh debian install.

When I ran

sudo apt-get install gdb

...I noticed that gdb-minimal was removed and the full gdb was installed.

That fixed the python problem and Qt Creator runs gdb with no problems.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.