From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8551 invoked by alias); 30 Jul 2007 15:34:34 -0000 Received: (qmail 8543 invoked by uid 22791); 30 Jul 2007 15:34:33 -0000 X-Spam-Check-By: sourceware.org Received: from esparsett.troll.no (HELO esparsett.troll.no) (62.70.27.18) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jul 2007 15:34:29 +0000 Received: from esparsett.troll.no (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 8746E743CA for ; Mon, 30 Jul 2007 17:34:26 +0200 (CEST) Received: from gar.local (unknown [10.4.0.24]) by esparsett.troll.no (Postfix) with ESMTP id 67085743AC for ; Mon, 30 Jul 2007 17:34:26 +0200 (CEST) From: =?utf-8?q?Andr=C3=A9_P=C3=B6nitz?= To: gdb-patches@sourceware.org Subject: Re: Type information in -data-evaluate-expression Date: Mon, 30 Jul 2007 17:06:00 -0000 User-Agent: KMail/1.9.6 References: <200707301540.59361.apoenitz@trolltech.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200707301733.59718.apoenitz@trolltech.com> 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/msg00313.txt.bz2 On Monday 30 July 2007 15:52:10 Vladimir Prus wrote: > Andr=C3=A9 P=C3=B6nitz wrote: > > 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. > >=20 > > 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. >=20 > What is the use case where you need to just get the type of an expression, > without doing anything with it? One use case would be to display values in a graphical frontend when hovering (or even moving) the mouse over some expression. My current "best practice" here is to create a variable called "tooltip", extract value and type and delete it again, only to create it again with a slightly different expression etc. So I need two roundtrips and need some syncronization to handle the two partial results whereas the proposed "enhanced" version would allow a simple hit-and-run implementation... Also, there are times when I would like to call "custom data dumpers" (think std::string or std::vector) instead of using the content of the=20 value field. To trigger those dumpers quickly I need to get hold of type information quickly, preferably after the first round trip. I understand th= at a delay of a few dozen milliseconds for a round trip is a non-issue for the typical command line use, however these add up easily to a more significant amount if one "needs" lots of them... > [...] I'd expect this patch will break a bunch of tests, since those tests > are not expecting the additional 'type' field.=20 mi2-eval.exp and mi-eval.exp seems to be affected, I guess I would be able to fix them. > 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,=20 > rather than adding some new functionality to it. The gdb variable business requires some bookkeeping on the frontend side some of which I'd like to avoid. Andre'