From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128996 invoked by alias); 19 Apr 2015 11:36:11 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 128982 invoked by uid 89); 19 Apr 2015 11:36:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f180.google.com Received: from mail-ig0-f180.google.com (HELO mail-ig0-f180.google.com) (209.85.213.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 19 Apr 2015 11:36:09 +0000 Received: by igblo3 with SMTP id lo3so41307517igb.0 for ; Sun, 19 Apr 2015 04:36:07 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.77.48 with SMTP id p16mr11027424igw.31.1429443367511; Sun, 19 Apr 2015 04:36:07 -0700 (PDT) Received: by 10.64.74.70 with HTTP; Sun, 19 Apr 2015 04:36:07 -0700 (PDT) Date: Sun, 19 Apr 2015 11:36:00 -0000 Message-ID: Subject: how to get last created inferior, python api From: quentin sabah To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00041.txt.bz2 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