Last week I did an interactive presentation/tutorial in the 11th Rencontre de la Communauté Française de Compilation, in Aussois, France. It was entitled:

Understanding, Scripting and Extending GDB

JCF conference

The talk was divided in three parts:

  • GDB Under the Hood
  • Programming GDB in Python
  • Your turn

The first half is an introduction to GDB internals, and the second is an interactive tutorial that helps you writing new GDB commands in Python.

JCF conference

As of today, the interactive part is not perfect, maybe a bit too ambitious. I’ll rewrite it to add simpler things to begin with.

  • GDB Under the Hood

    • Help from the compiler
    • Help from the OS
    • Help from the CPU
    • Internal algorithms
  • Programming GDB in Python

    • Python interface
    • Short examples and CLI reminder
  • Your turn

    • Section breakpoints
    • Return true breakpoints
    • Register watchpoint
    • Step into next call
    • Faking function execution

Run the docker image with:

HOST_DIR=~/tuto-gdb
mkdir $HOST_DIR
docker run -it -v $HOST_DIR:/home/jcf/host -e GROUPID=$(id -g) -e USERID=$(id -u) --cap-add sys_ptrace kpouget/tuto-gdb.py

JCF conference