How do I debug an extension?
When using GDB with dynamically loaded extensions, you can’t set a breakpoint in your extension until your extension is loaded.
In your .gdbinit file (or interactively), add the command:
Then, when you run GDB:
$ gdb /local/bin/python gdb) run myscript.py gdb) continue # repeat until your extension is loaded gdb) finish # so that your extension is loaded gdb) br myfunction.c:50 gdb) continue