From: Avi Kivity <avi@redhat.com>
To: Matt Rice <ratmice@gmail.com>
Cc: Hui Zhu <hui_zhu@mentor.com>, gdb@sourceware.org
Subject: Re: 'info symbol' equivalent in python?
Date: Mon, 19 Mar 2012 10:48:00 -0000 [thread overview]
Message-ID: <4F670EC2.2020407@redhat.com> (raw)
In-Reply-To: <CACTLOFpC4TVgCfcdu+kem-WvOjPH+S-fYoaRCMk5cryr--zKJA@mail.gmail.com>
On 03/19/2012 12:43 PM, Matt Rice wrote:
> On 3/19/12, Avi Kivity <avi@redhat.com> 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.Symbol object at 0x7fb5ef615df0>
> (gdb) py print gdb.block_for_pc(0x0000000000400598).function
> main
> (gdb)
Similar. I want the names of static/global variables, not functions.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-03-19 10:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-18 14:37 Avi Kivity
2012-03-19 4:35 ` Hui Zhu
2012-03-19 9:17 ` Avi Kivity
2012-03-19 10:43 ` Matt Rice
2012-03-19 10:48 ` Avi Kivity [this message]
2012-03-27 1:11 ` Hui Zhu
2012-03-27 10:24 ` Avi Kivity
2012-03-26 15:53 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F670EC2.2020407@redhat.com \
--to=avi@redhat.com \
--cc=gdb@sourceware.org \
--cc=hui_zhu@mentor.com \
--cc=ratmice@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox