From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114236 invoked by alias); 8 Aug 2018 14:39:48 -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 113947 invoked by uid 89); 8 Aug 2018 14:39:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_RP_RNBL,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:893 X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (50.116.124.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 14:39:46 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 6244A400C722C for ; Wed, 8 Aug 2018 08:42:38 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id nPcFf0HplbXuJnPcYfPDau; Wed, 08 Aug 2018 09:39:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sxNOIxjwLsJEMAXrwI0ljXkYo7RHaQyx97FYcVjGthk=; b=mrrhHPoNU+NF1WW/yT/DCTUUHW 5dIJ+SOAUAVHqNKjtdrAIlhL/zi5heuOsB9Ag4acamizDmg8w2AXLZMH+7+14ZCeW0bdfq7oMmS/Y uS6yaaxTXQp9s8vc1Xz/Uz+CD; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:54156 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fnPcE-004BK8-Py; Wed, 08 Aug 2018 09:39:10 -0500 From: Tom Tromey To: David Griffiths Cc: gdb@sourceware.org Subject: Re: How to do "info address" directly from python? References: Date: Wed, 08 Aug 2018 14:39:00 -0000 In-Reply-To: (David Griffiths's message of "Fri, 27 Jul 2018 13:16:41 +0100") Message-ID: <87tvo4apo1.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-08/txt/msg00024.txt.bz2 >>>>> "David" == David Griffiths writes: David> Hi, I can obtain the address of a non-debug symbol in python by doing: David> gdb.execute("info address %s" % symbol, to_string=True) David> and then parsing the result, but is there a way to obtain that information David> directly using the python api? I've tried things like David> gdb.lookup_global_symbol, gdb.lookup_type and gdb.parse_and_eval but none David> of them return anything. The Python API doesn't expose non-debug symbols yet. In fact the whole symbol part of the API isn't really complete. It's an area that could use some work. David> I'd prefer not to use gdb.execute as it sometimes gets the output of the David> command mixed up with the output of a preceding gdb.write. That sounds like a bug worth filing. Do you know how to reproduce it? Tom