Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Creator - The selected build of GDB does not support Python scripting

Tags:

gdb

qt

qt-creator

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++?

like image 606
Kampi Avatar asked Sep 06 '25 05:09

Kampi


2 Answers

You can run this command in your terminal to install gdb

sudo apt-get install gdb
like image 107
Bercove Avatar answered Sep 07 '25 20:09

Bercove


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.

like image 35
tttapa Avatar answered Sep 07 '25 20:09

tttapa