I compiled&installed gdb(7.1.1) from the source code by doing CC=gcc-6 ./configure --with-python=python3 && make
then sudo make install
. Then I invoked gdb from bash as usual. But when I tried to load my python script within gdb by doing source asdf.py
, it threw an error saying
AttributeError: 'module' object has no attribute 'execute'
I tried to change my code to try more functions from the gdb module but every function I tried to execute was looking like it's missing. I invoked python interpreter within gdb then did import gdb
and then dir(gdb)
to see gdb's contents, the output was
['__doc__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
So there really is a module called gdb but it's contents are empty. What could have gone wrong during installation? Or is this a bug in gdb? How can I fix this?