Skip to content

Embedded Debugging

Oğuzhan Eroğlu edited this page Jan 12, 2022 · 13 revisions

How to build GDB for ARM with embedded-Python3

GDBFrontend needs GDB-embedded Python3. Sometimes, you could not find a GDB build for ARM target (arm-none-eabi) with Python3 support on GDB. In this situation you can quickly build your own GDB with Python3 support and arm-none-eabi target.

You may need some build-time dependencies

I had to install libgmp-dev package for Debian. If you have some missing build dependencies, configure script will say the missing library, just find it in your package management system and install.

Please edit and update this article if you have an issue about build dependencies and you know how to install them.

Follow these steps

cd ~
wget https://ftp.gnu.org/gnu/gdb/gdb-11.1.tar.xz
tar zxvf gdb-11.1.tar.gz
mkdir gdb-11.1-build
cd gdb-11.1-build
../gdb-11.1/configure --with-python=/usr/bin/python3 --target=arm-none-eabi --enable-interwork --enable-multilib
make

As you see, you should pass your Python3 executable to configure script's --with-python paramter just like --with-python=/usr/bin/python3.

Starting GDBFrontend with your GDB build

After build is successful, you should be able to run GDBFrontend like this:

gdbfrontend -g $(realpath ~/gdb-11.1-build/gdb/gdb) -G --data-directory=$(realpath ~/gdb-11.1-build/gdb/data-directory/)

It looks like this:

image image

Clone this wiki locally