Make GDB
more friendly
- GDB embeds the Python interpreter so it can use Python as an extension language.
- You can’t just import gdb from /usr/bin/python like it’s an ordinary Python library because GDB isn’t structured as a library.
- What you can do is
source MY-SCRIPT.py
from within gdb (equivalent to runninggdb -x MY-SCRIPT.py
).