From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21709 invoked by alias); 24 May 2011 13:48:23 -0000 Received: (qmail 21699 invoked by uid 22791); 24 May 2011 13:48:22 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,TW_QD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.nokia.com (HELO mgw-da01.nokia.com) (147.243.128.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 May 2011 13:48:08 +0000 Received: from gar.localnet (berwst16747.europe.nokia.com [172.25.167.47]) by mgw-da01.nokia.com (Switch-3.4.4/Switch-3.4.3) with ESMTP id p4ODm69A027920 for ; Tue, 24 May 2011 16:48:06 +0300 From: =?iso-8859-1?q?Andr=E9_P=F6nitz?= To: "gdb@sourceware.org" Subject: Re: automated cast to different data type possible? Date: Tue, 24 May 2011 13:48:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-21-generic; KDE/4.4.5; i686; ; ) References: <20110511090850.28500@gmx.net> <201105161343.54594.andre.poenitz@nokia.com> <4DD15C6B.6080006@gmx.de> In-Reply-To: <4DD15C6B.6080006@gmx.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201105241550.00273.andre.poenitz@nokia.com> X-Nokia-AV: Clean 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: 2011-05/txt/msg00127.txt.bz2 On Monday 16 May 2011 19:18:35 ext Klaus Rudolph wrote: > Andr=E9 P=F6nitz schrieb: >=20 > >> please give me an idea who is calling qdump_KRBase and what is paramet= er > >> d? I actually have no idea how to add that to the printer script... or > >> maybe any other python script to gdb. > >=20 > > The code would be called from a Python script that creates the full > > display for an local variable including all expanded children in one go= .=20 >=20 > Is there any interface defined for that purpose? Or you think that I > should create a new gdb command? If I handle that from a new gdb > command, there is really no problem, but that fits not in the > integration to ddd without changing sources of it. The necessary basic interface is gdb's python module, i.e. http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html#Python-A= PI The script on top of that would be something similar to https://qt.gitorious.org/qt-creator/qt-creator/blobs/master/share/qtcreat= or/gdbmacros/dumper.py This also contains definitions of convenience functions that uses that sche= me. Some example pretty-printer implementations using that scheme are in=20 https://qt.gitorious.org/qt-creator/qt-creator/blobs/master/share/qtcreat= or/gdbmacros/gdbmacros.py The qdump__KRBase() function I mentioned is currently at the end of that fi= le. The main script produces gdb/MI-style output. I am not sure whether ddd=20 can digest that, if not, producing "human readable" output by "fixing" the= =20 put*() methods in the Dumper class should be straightforward.=20 > > 'd' is an object that accumulates output that's finally 'printed', and > > takes care of properly closing nested items in case of exceptions. >=20 > Is there any description which can handle such idea? Maybe you already > have such a solution finsihed? I have, Qt Creator uses this approach. There are some hints on what it does= =20 and how it works (I wouldn't call it "documentation", though) at http://doc.qt.nokia.com/qtcreator-snapshot/creator-debugging-helpers.html > Maybe there is also an official one but not known by me? I don't think so. Regards, Andre'