This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: size of non local variables
- From: Tom Tromey <tromey at redhat dot com>
- To: "Anmol P. Paralkar" <anmol at freescale dot com>
- Cc: ranjith kumar <ranjithproxy at gmail dot com>, gdb at sourceware dot org
- Date: Tue, 01 Dec 2009 12:26:42 -0700
- Subject: Re: size of non local variables
- References: <31cff80d0911301216j36328837k673a2e1936f00eb1@mail.gmail.com> <Pine.LNX.4.64.0911301423300.12536@lds03-tx32> <31cff80d0911301246p6471c1a5ua95608d22b81a22a@mail.gmail.com> <Pine.LNX.4.64.0911301743520.12536@lds03-tx32>
- Reply-to: tromey at redhat dot com
>>>>> "Anmol" == Anmol P Paralkar <anmol@freescale.com> writes:
Anmol> On the other hand, GDB Guru's, is there a way one could get a
Anmol> list of a program's symbols into a list and map over that list,
Anmol> a function that takes a symbol as an argument and returns an
Anmol> integer representing it's size? etc...
Anmol> I tried looking at the Python support documentation to see if
Anmol> this could be done easily, but could not really tell (I've never
Anmol> used GDB's Python support nor Python).
I don't believe the Python symbol table code has been merged yet. And
even on the branch in archer I'm not sure whether this can be done.
Anmol> Is there a mini-tutorial somewhere that has an example of
Anmol> getting started with using GDB's Python support? I tried trying
Anmol> out the Greet snippet here:
Anmol> http://sourceware.org/gdb/current/onlinedocs/gdb/Functions-In-Python.html#Functions-In-Python
Anmol> but I'm not sure what I'm doing wrong.
If that didn't work, could you be more specific? How did it fail, etc?
I wrote a series of blog entries about the python work a while back.
This may be the closest thing to a tutorial; however, some details of
the API have changed since then, so you would have to read it in
conjunction with the gdb manual:
http://tromey.com/blog/?p=494
Tom