From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21367 invoked by alias); 30 Jul 2007 13:52:25 -0000 Received: (qmail 21357 invoked by uid 22791); 30 Jul 2007 13:52:24 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jul 2007 13:52:22 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IFVfX-00011c-5G for gdb-patches@sources.redhat.com; Mon, 30 Jul 2007 15:52:19 +0200 Received: from 241-246.umostel.ru ([77.246.241.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Jul 2007 15:52:19 +0200 Received: from ghost by 241-246.umostel.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Jul 2007 15:52:19 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: Type information in -data-evaluate-expression Date: Mon, 30 Jul 2007 15:34:00 -0000 Message-ID: References: <200707301540.59361.apoenitz@trolltech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit User-Agent: KNode/0.10.4 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00312.txt.bz2 André Pönitz wrote: > > Hi all. > > While playing around with gdb's "mi" interface (which looks rather > nice for scripting btw...) I came across a few places where I think > the interface might be made even more convienient without much > effort. > > One example: As far as I can see currently the only way to obtain > the type of an expression is to use -var-create & -var-delete. > It would be more convienient for me if I could get that information > with a single command without creating a variable which will be > thrown away immediatedly afterwards. What is the use case where you need to just get the type of an expression, without doing anything with it? > A possibility to do so would be to "enhance" "-data-evaluate-expression" > to return not only the value, but also the type information which is > is available after the evaluation process anyway. > > I came up with a tiny patch that "seem to work for me". But as this > is the first time I look gdb source I am unsure whether this is done > properly or if some kind of cleanup is needed, and, of course, whether > there is a chance to get such patches included in gdb proper > at some point of time. I'd expect this patch will break a bunch of tests, since those tests are not expecting the additional 'type' field. The patch itself seems reasonable as far as code is concerned, but I'm not yet sure about your use case. I'd prefer -data-evaluate-expression to fall to misuse, rather than adding some new functionality to it. - Volodya