From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19122 invoked by alias); 24 Mar 2010 15:24:25 -0000 Received: (qmail 19106 invoked by uid 22791); 24 Mar 2010 15:24:24 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-ew0-f214.google.com (HELO mail-ew0-f214.google.com) (209.85.219.214) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Mar 2010 15:24:20 +0000 Received: by ewy6 with SMTP id 6so1792354ewy.4 for ; Wed, 24 Mar 2010 08:24:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.35.10 with HTTP; Wed, 24 Mar 2010 08:24:16 -0700 (PDT) Date: Wed, 24 Mar 2010 15:24:00 -0000 Received: by 10.213.65.76 with SMTP id h12mr2020091ebi.70.1269444256635; Wed, 24 Mar 2010 08:24:16 -0700 (PDT) Message-ID: <325e93671003240824t3e940773ned358335b9fe1f40@mail.gmail.com> Subject: gdb python and 'complete' From: Jeroen Dobbelaere To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2010-03/txt/msg00193.txt.bz2 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): ... =A0=A0 def retrieveFunctionSummary(self): =A0=A0=A0=A0=A0 member_list=3Dgdb.execute("complete b 'MyClass::").split("\= n") =A0=A0=A0=A0=A0 .... 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