AVR gdb with python

November 20, 2017

Python support in GDB for AVR architecture

Python support in GDB

Since GBD 7, it has been possible to extend GDB functionality with Python. This is extremely useful, as the GDB interface is not particularly informative and lacks easy access to some features that really help when debugging code. Python support has been leveraged in particular in the world of reverse engineering and exploit development, with the creation of extremely useful scripts that enhance GDB such as: PEDA, Voltron and GEF.

Unfortunately, installing GDB for AVR architecture from the Ubuntu repositories doesn’t provide Python support. So this is a quick guide on building GDB for AVR from source, and enabling python support.

How to

  1. Download the appropriate source from http://ftp.gnu.org/gnu/gdb/
  2. Extract it and cd to the extracted folder
  3. ./configure --with-python --target=avr
  4. make
  5. make install
  6. Done!

GDB is super simple to compile from source, and by doing this you can enable much-needed python support to make debugging AVR binaries less painful.