how to get last created inferior, python api

quentin sabah <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAJoex3O_3YdA+Uga3unraoPxBnJBQGjW0uki2eRW-88PP9vu2A@mail.gmail.com>
Hi, I have been using gdb for many years and I am just starting to use
the python api.
I am wondering if there is a simple way to retrieve the last created
inferior using the python api.

Currently (gdb 7.7) I can create a new inferior with
gdb.execute("add-inferior"). There is no value returned, just a
messages printed in the CLI ("Added inferior N").

The only way that I can think of, is to call gdb.inferiors() before
and after creating a new one, and then compare the two lists to find
the new inferior.

Thanks!

-- 
Quentin Sabah
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.