public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: quentin sabah <quentin.sabah@gmail.com>
To: gdb@sourceware.org
Subject: how to get last created inferior, python api
Date: Sun, 19 Apr 2015 11:36:00 -0000	[thread overview]
Message-ID: <CAJoex3O_3YdA+Uga3unraoPxBnJBQGjW0uki2eRW-88PP9vu2A@mail.gmail.com> (raw)

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

             reply	other threads:[~2015-04-19 11:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-19 11:36 quentin sabah [this message]
     [not found] ` <CADPb22T-y6RydUGrKXOgUQeDZc-k85_7cTbFTz-U23qzgWCT6w@mail.gmail.com>
2015-04-22 11:39   ` quentin sabah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJoex3O_3YdA+Uga3unraoPxBnJBQGjW0uki2eRW-88PP9vu2A@mail.gmail.com \
    --to=quentin.sabah@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).