From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14759 invoked by alias); 7 Aug 2007 06:30:53 -0000 Received: (qmail 14542 invoked by uid 22791); 7 Aug 2007 06:30:52 -0000 X-Spam-Check-By: sourceware.org Received: from 213-239-199-119.clients.your-server.de (HELO mail.emss.co.za) (213.239.199.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 07 Aug 2007 06:30:43 +0000 Received: from newmail.emss.co.za (dsl-241-163-128.telkomadsl.co.za [41.241.163.128]) by mail.emss.co.za (Postfix) with ESMTP id BE8E821E16 for ; Tue, 7 Aug 2007 06:30:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by newmail.emss.co.za (Postfix) with ESMTP id 373FD1457B7 for ; Tue, 7 Aug 2007 08:30:38 +0200 (SAST) Received: from newmail.emss.co.za ([127.0.0.1]) by localhost (newmail.emss.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14764-04 for ; Tue, 7 Aug 2007 08:30:38 +0200 (SAST) Received: from [172.16.1.123] (unknown [172.16.1.123]) by newmail.emss.co.za (Postfix) with ESMTP id E9C4F13E002 for ; Tue, 7 Aug 2007 08:30:37 +0200 (SAST) Subject: gdb whatis command From: Abri Zaaiman Reply-To: azaaiman@emss.co.za To: gdb@sourceware.org Content-Type: text/plain Date: Tue, 07 Aug 2007 06:30:00 -0000 Message-Id: <1186468237.5024.11.camel@azaaiman.emss.co.za> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit 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: 2007-08/txt/msg00067.txt.bz2 Hi, I apologize if this has been asked about before. I am new to this list. I am attempting to improve this script: http://websvn.kde.org/trunk/KDE/kdesdk/scripts/kde-devel-gdb?revision=629367&view=markup It provides some nice user defined commands for GDB to display QT types in a useful way. One of the scripts limitations is that one has to specify the type(s) of the object that you are trying to inspect. For example: printqmap myMap QString int You will notice that there are comments in the script file about the possibility that the gdb whatis command may be used to make this automatic. As far as I can tell it is not possible to use whatis in an expression in the gdb scripting language. For example something like this: set $type = whatis myMap Is there a way to do this? If not how difficult whould it be to add this ability to GDB? Ultimately I would also need to do some string manipulation to extract the types from the output of whatis. Is this possible in the gdb scripting langauge? Regards Abri Zaaiman