This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gdb python and 'complete'
- From: Jeroen Dobbelaere <jeroen dot dobbelaere at gmail dot com>
- To: gdb at sourceware dot org
- Date: Wed, 24 Mar 2010 16:24:16 +0100
- Subject: gdb python and 'complete'
Hi,
I am trying to create some helper commands using python with gdb-7.1.
One of the things I want to do, is to retrieve the members of a c++
class, do some filtering and
present the result in a nice way.
I tried doing this, by delegating part of the request to the
'complete' command, like in :
class ShowNiceRepresentation(gdb.Command):
...
?? def retrieveFunctionSummary(self):
????? member_list=gdb.execute("complete b 'MyClass::").split("\n")
????? ....
Now, the 'complete' command is indeed retrieving all the member
functions, but it will output them in the terminal in stead of feeding
it back to 'member_list'.
Is there a way to redirect the output, so that the python program can
investigate it ?
Or is there a more appropriate way to access the members of a c++
class form within python ?
Greetings,
Jeroen Dobbelaere