From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22728 invoked by alias); 19 Mar 2012 10:43:47 -0000 Received: (qmail 22718 invoked by uid 22791); 19 Mar 2012 10:43:46 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yx0-f169.google.com (HELO mail-yx0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Mar 2012 10:43:23 +0000 Received: by yenm8 with SMTP id m8so6187385yen.0 for ; Mon, 19 Mar 2012 03:43:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.79.138 with SMTP id i10mr11967763yhe.12.1332153802476; Mon, 19 Mar 2012 03:43:22 -0700 (PDT) Received: by 10.236.66.49 with HTTP; Mon, 19 Mar 2012 03:43:22 -0700 (PDT) In-Reply-To: <4F66F9A2.2060407@redhat.com> References: <4F65F322.2000204@redhat.com> <4F66B75C.1090404@mentor.com> <4F66F9A2.2060407@redhat.com> Date: Mon, 19 Mar 2012 10:43:00 -0000 Message-ID: Subject: Re: 'info symbol' equivalent in python? From: Matt Rice To: Avi Kivity Cc: Hui Zhu , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 X-SW-Source: 2012-03/txt/msg00049.txt.bz2 On 3/19/12, Avi Kivity wrote: > On 03/19/2012 06:34 AM, Hui Zhu wrote: >> http://sourceware.org/gdb/current/onlinedocs/gdb/Symbols-In-Python.html#Symbols-In-Python >> >> >> On 03/18/12 22:37, Avi Kivity wrote: >>> Is there a gdb python API for 'info symbol'? >>> >> > > These give lookup the symbol given a name. I want to lookup a symbol > given an address (like 'info symbol'). sounds like you're looking for the block_for_pc and gdb.Block's function attribute, (gdb) py print repr(gdb.block_for_pc(0x0000000000400598).function) (gdb) py print gdb.block_for_pc(0x0000000000400598).function main (gdb)