From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76643 invoked by alias); 9 Feb 2017 10:46:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 76617 invoked by uid 89); 9 Feb 2017 10:46:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=hardenedapple@gmail.com, hardenedapplegmailcom, H*i:CAH, sk:Archite X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Feb 2017 10:46:03 +0000 Received: by mail-wm0-f49.google.com with SMTP id r141so14907482wmg.1 for ; Thu, 09 Feb 2017 02:46:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=FIvWFwV7tgDpSY39ZQyF1cm++u2ih/HaZ+z+pswf72g=; b=R4W72mkD7AgN1D4eKMqZgUNnK/ZYqdZ/sZCrsbvXJ0y8DdMGRLxYdAqPCtFZkou8R7 CGjp4OfUIWPedUTfoIGbl+RST6SLqL1JNWw+8ZiNPZoR7R/cGr5+lqccylLo9p5T1MZY Lsjp7KmA4Z8CDhc/6fbanFr9wdhdYLZACMGh5rW2szddb59VnCAEU9nepD7MVYLd2sJv DBU7ShNan2Lv3RYJ9UqPms4GQ0QtBZa+IrzSLlLk0WYkhRSXICd0TvizhVPhSLNEgb30 GtBdFw3TbQ2Y6auf5wXxtsVhNSG+ndpnrA0T07c+I5UywPeEMViIdh/7l0t5moYSxYfP +l7w== X-Gm-Message-State: AMke39n23sQbvxnTh7C4wHGRob624zIeIoi9gds0WvXGgXPUOU+ok/MnvIBODl/qx/mdtg== X-Received: by 10.28.181.145 with SMTP id e139mr20428851wmf.127.1486637161036; Thu, 09 Feb 2017 02:46:01 -0800 (PST) Received: from [10.0.0.57] (host86-142-187-79.range86-142.btcentralplus.com. [86.142.187.79]) by smtp.gmail.com with ESMTPSA id e6sm17864858wrc.30.2017.02.09.02.45.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 02:46:00 -0800 (PST) Subject: Re: [PATCH] Add gdb.current_arch() function to python module -- equivalent of guile (current-arch) To: Yao Qi References: Cc: "gdb-patches@sourceware.org" From: Matthew Malcomson Message-ID: Date: Thu, 09 Feb 2017 10:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00213.txt.bz2 FWIW I've nothing against your suggestion (other than it's sometimes a pain to get one object just to get access to a method to obtain a different object), but thought I should mention that "current" arch is already part of an extension language interface. https://sourceware.org/gdb/current/onlinedocs/gdb/Architectures-In-Guile.html On 08/02/17 22:15, Yao Qi wrote: > On Wed, Feb 8, 2017 at 5:46 PM, Matthew Malcomson > wrote: >> The problem is that without this patch I can't get an Architecture object >> without first having a Frame object, and I can't get a Frame object without >> starting my target program. >> >> Adding a gdb.current_arch() function is in order to get the Architecture >> object I need without starting the target program. >> > IMO, "current" arch is unclear as an extension language interface. Yes, we > do have function get_current_arch, but it is just a c function, we are free to > change it in the future. > It would be better to add function Inferior.architecture. I don't have much > GDB python expertise, so I'd like to hear what other people think. >