[Python] How to know the current inferior? (exited event)

Kevin Pouget kevin.pouget@gmail.com
Wed Apr 20 10:54:00 GMT 2011


Hello,

is there a way to know the current inferior from GDB's Python interface ?

I can see `gdb.selected_thread()', so
> for inf in gdb.inferiors():
>    if inf.pid == gdb.selected_thread().ptid[0]:
>        return inf

give the current inferior, but when I receive a `events.exited',
gdb.selected_thread() returns None and I can't find any way to know
which inferior exited ...


cordially,

Kevin



More information about the Gdb mailing list