From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65066 invoked by alias); 27 Jul 2018 12:16:46 -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 65041 invoked by uid 89); 27 Jul 2018 12:16:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1061, H*c:alternative X-HELO: mail-oi0-f44.google.com Received: from mail-oi0-f44.google.com (HELO mail-oi0-f44.google.com) (209.85.218.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jul 2018 12:16:43 +0000 Received: by mail-oi0-f44.google.com with SMTP id q11-v6so8652223oic.12 for ; Fri, 27 Jul 2018 05:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undo-io.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=SFlY02FddATz+CyI0hQo31tRzAjaTTnLOwB6l/TOdNw=; b=YenI6b+J/0em9MbLYkq97Li/maHWLqC+9gMe24WPU+sQB0Yg0RC0bGDpx7xLCggHdt cOGieb6IfFhbaHSVh7QFj5ssl2VJIOeFLfhadh7qtDEzpUHP2d22F6HCHfhKWMwMTDAp N2+5nIOiWVP1mkpkhzSxIxPohzR11sNmaO5/HX92mZsw0QPPYOctKv9wJO7rUmEpHnc/ vquQwDxmVX2oQt4DFxdeBQPX7ET0R4K8KDK/KzbrPtJERNHlpbx9mp6PcCibnDpiXN/7 fQYaD8J4sfaWoIlPw7ZV8doCZEuO5TBjP7Y1pPiEBom2Z+2No9P5UobY9na0yHZN2IFe I45A== MIME-Version: 1.0 Received: by 2002:a9d:c29:0:0:0:0:0 with HTTP; Fri, 27 Jul 2018 05:16:41 -0700 (PDT) From: David Griffiths Date: Fri, 27 Jul 2018 12:16:00 -0000 Message-ID: Subject: How to do "info address" directly from python? To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00043.txt.bz2 Hi, I can obtain the address of a non-debug symbol in python by doing: gdb.execute("info address %s" % symbol, to_string=True) and then parsing the result, but is there a way to obtain that information directly using the python api? I've tried things like gdb.lookup_global_symbol, gdb.lookup_type and gdb.parse_and_eval but none of them return anything. I'd prefer not to use gdb.execute as it sometimes gets the output of the command mixed up with the output of a preceding gdb.write. Cheers, David