arm-none-eabi-gdb with python support on linux (Fedora 17)

I’ve been using the GCC ARM Embedded toolchain for STM32 development on linux for a while now. It’s maintained by ARM, it’s available for linux, windows and osx, and it’s just a zip of binaries. Untar, add to your path, and you’re golden. With the new 4.7 release (2012q4) it includes some decent code size improvements, and is generally just a one stop shop for getting a toolchain.

However, the linux builds don’t have python support in GDB. This isn’t necessarily a bad thing, but people are starting to put together some nice tools that plugin to GDB that rely on python support. There’s some experimental SWV/SWO support, there’s some neat support for printf without printf and, what I’m trying to do, dump a lot of data buffers straight out of ram on the target device for analysis in python.

So, I tried building it myself. I first tried just downloading recent gdb sources and adding python support, after setting the target to arm-none-eabi. but….. that didn’t play well with openocd, so I went back to trying to build the G-A-E provided sources instead.

Here’s what I needed on Fedora 17 x64

  • libmpc-devel
  • expat-devel
  • ncurses-devel
  • python-devel
  • bison

This then replaces step 5 from the provided instructions…

$ cd [extracteddir]/src
[dir]/src$ tar -xf gdb.tar.gz
[dir]/src$ cd gdb
./configure --with-expat --with-python --target=arm-none-eabi
make -j5

That got me a working gdb with python support…

  1. On Fedora 19, I needed “flex” as well, (and probably on Fedora 17, but it had already been installed by something else.

    For gcc-arm-embedded 2013q2, after configure, you need to do: make MAKEINFO=/bin/true to work around bug:

  2. with 2014q1, I needed to either actually install it, or use –with-data-directory to get the python support module to load. I presume this is an incompatibility with the system python gdb support file in /usr/share/gdb and the new gdb7.6 support in 2014q1

    Also, gdbtui is gone, replaced by gdb -tui

  3. Awesome! This’ made my day. I was trying to debug a linux-targeted applicacion with code-sourcery-g++ (arm-none-linux-gnueabi) using QtCreator 3.1, but it complained about about debugger’s lack of Python scripting.

    1. Downloaded
    2. Build it
    tar -xf gdb-7.5.1.tar.bz2
    cd gdb-7.5.1
    ./configure –prefix=/opt/arm/gdb-751 –with-expat –with-python –target=arm-none-linux-gnueabi
    make install
    3. Then configured Qt creator, and everything’s ok

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>