From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25273 invoked by alias); 7 Mar 2010 10:16:35 -0000 Received: (qmail 25260 invoked by uid 22791); 7 Mar 2010 10:16:34 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from ahmler4.mail.eds.com (HELO ahmler4.mail.eds.com) (192.85.154.77) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 07 Mar 2010 10:16:29 +0000 Received: from ahmlir4.mail.eds.com (ahmlir4-2.mail.eds.com [192.85.154.134]) by ahmler4.mail.eds.com (8.14.2/8.13.8) with ESMTP id o27AGRl5007838 for ; Sun, 7 Mar 2010 05:16:27 -0500 Received: from ahmlir4.mail.eds.com (localhost [127.0.0.1]) by ahmlir4.mail.eds.com (8.14.2/8.12.10) with ESMTP id o27AGLjb001244 for ; Sun, 7 Mar 2010 05:16:21 -0500 Received: from usplmvpfe001.ent.rt.verigy.net ([192.100.40.4]) by ahmlir4.mail.eds.com (8.14.2/8.12.10) with ESMTP id o27AGKoQ001233 for ; Sun, 7 Mar 2010 05:16:21 -0500 X-EDSINT-Source-Ip: 192.100.40.4 Received: from usplmvpbe001.ent.rt.verigy.net ([10.16.58.34]) by usplmvpfe001.ent.rt.verigy.net with Microsoft SMTPSVC(6.0.3790.3959); Sun, 7 Mar 2010 04:16:20 -0600 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: MI Interface and Pretty Print to_string() result Date: Sun, 07 Mar 2010 10:16:00 -0000 Message-ID: <58596C4646708B4BB990C4483997333001E4F2C5@usplmvpbe001.ent.rt.verigy.net> In-Reply-To: From: "Elmenthaler, Jens" To: 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/msg00041.txt.bz2 Jens> The current issue is that if I have a pointer as a direct or Jens> indirect child of a dynamic variable object, how do I dereference Jens> it? The way it is done without pretty printers is to take the Jens> result of -var-info-path-expression, and than create a variable Jens> object for *(resulting-expression). Tom> If that is the only problem, what about adding a new command to Tom> dereference the pointer and add a child to the varobj? I noticed that the Eclipse CDT requires the result of -var-info-path-expres= sion, but it is not used to dereference it and determine the children. The = gdb already behaves nicely, as it returns a single child for references and= pointers, which is the dereferenced value. This is independent of whether = it is a actually a child of a pretty printer or not. So, the most important= use case is handled perfectly. I found it is used for the following purposes: - display label: well, I can construct something meaningful easily - determine address and size of the value, most notably, to create a watchp= oint from it. Well, here a new MI command would indeed help. In order to de= termine address and size, the CDT builds new expressions from the value (i.= e. "&(value-expression)" and "sizeof(value-expression)"), and calls -data-e= valuate-expression. This is what is no longer possible with children of dyn= amic variable objects. Tom> The only way I can think of to truly implement -var-info-path- Tom> expression Tom> would be to let the printers return path expressions. That is going to Tom> yield some crazy expressions, though, for many typical containers. Well, from what I saw in the Eclipse CDT, the main purpose of -var-info-pat= h-expression is to be later able to use them in other expressions. The Ecli= pse CDT has an expressions view. As a user I would expect, that if a vector= "v" displays a child with the name [0], that I also could create an expres= sion v.[0] (well actually v[0], but this is not a real problem) in the expr= ession view. However, that is not possible, since the gdb will not be able = to evaluate this expression. For this, it would be sufficient, if gdb would map "v.[0]" to the child nam= ed "[0]". The pretty printers children() method provides all information th= at is need. The relative expression of a child to it's parent simple is the= name of the child. The expressions resulting from it don't look like real = C/C++ anymore, but this is something a user could possibly deal with. In th= e worst case, a gdb frontend could polish that up by using the disply hint = information. Jens Elmenthaler Platform & Components Lab SW Designer R&D Verigy Germany GmbH, Herrenberger Str. 130, 71034 B=F6blingen Sitz der Gesellschaft: B=F6blingen - Amtsgericht B=F6blingen HRB 6167 WEEE-Reg.-Nr. DE 16968742 Gesch=E4ftsf=FChrer: Hans-J=FCrgen Wagner, Dietmar H=F6ller Tel: +49 7031 4357-119 jens.elmenthaler@verigy.com =20 -----Original Message----- From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On Behalf = Of Tom Tromey Sent: Samstag, 6. M=E4rz 2010 00:49 To: Elmenthaler, Jens Cc: gdb@sourceware.org Subject: Re: MI Interface and Pretty Print to_string() result >>>>> "Jens" =3D=3D Elmenthaler, Jens writes: Jens> The current issue is that if I have a pointer as a direct or Jens> indirect child of a dynamic variable object, how do I dereference Jens> it? The way it is done without pretty printers is to take the Jens> result of -var-info-path-expression, and than create a variable Jens> object for *(resulting-expression). If that is the only problem, what about adding a new command to dereference the pointer and add a child to the varobj? The only way I can think of to truly implement -var-info-path-expression would be to let the printers return path expressions. That is going to yield some crazy expressions, though, for many typical containers. Tom