I am trying to write a Python script for GDB that uses the events gdb.events.inferior_call_pre and events.inferior_call_post. However, those events are not defined in gdb.events:
>(gdb) python print(dir(gdb.events))
['__doc__', '__name__', '__package__', 'cont', 'exited', 'new_objfile', 'stop']
The above was done without a program loaded. I have also loaded a C program, run it until a breakpoint, and then executed the command with the same result.
I am running CentOS 7 with gdb 7.6.1.
I downloaded and compiled the source (with --with-python=yes) for gdb 7.12 with less success:
(gdb) python print(dir(gdb.events))
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'gdb' is not defined
Error while executing Python code.
Any help is greatly appreciated.