Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb python and 'complete'
@ 2010-03-24 15:24 Jeroen Dobbelaere
  2010-03-24 15:54 ` Michel METZGER
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeroen Dobbelaere @ 2010-03-24 15:24 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-24 22:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24 15:24 gdb python and 'complete' Jeroen Dobbelaere
2010-03-24 15:54 ` Michel METZGER
2010-03-24 16:35   ` Jeroen Dobbelaere
2010-03-24 17:16 ` Daniel Jacobowitz
2010-03-24 17:59 ` Tom Tromey
2010-03-24 22:02   ` Jeroen Dobbelaere
2010-03-24 22:55     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox