From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30582 invoked by alias); 24 Mar 2006 08:31:17 -0000 Received: (qmail 30573 invoked by uid 22791); 24 Mar 2006 08:31:16 -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; Fri, 24 Mar 2006 08:31:14 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FMhhG-0000W8-7E for gdb-patches@sources.redhat.com; Fri, 24 Mar 2006 09:31:02 +0100 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Mar 2006 09:31:02 +0100 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Mar 2006 09:31:02 +0100 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: MI: type prefixes for values Date: Fri, 24 Mar 2006 09:46:00 -0000 Message-ID: References: <17427.54333.236860.258115@kahikatea.snap.net.nz> <20060317191207.GA19068@nevyn.them.org> <20060324030332.GB2853@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00267.txt.bz2 Daniel Jacobowitz wrote: > OK, I checked this out. Before, if all the variables are initialized: > > ^done,locals=[{name="baz",value="2"},{name="blaz2",value="(int &) > @0x5009c8: 1"}, > {name="blaz4",value="(int &) @0x5009c8: 1"}, > {name="blaz",value="(int &) @0x5009c8: 1"}, > {name="blaz3",value="(int &) @0x5009c8: 1"}, > {name="blaz5",value="(int &) @0x5009c8: 1"}] > > If they aren't: > > &"Cannot access memory at address 0x0\n" > ^error,msg="Cannot access memory at address 0x0" > > After: > > ^done,locals=[{name="baz",value="10922"} {name="blaz2",value="@0x2aaaaabc1ca0"}, > {name="blaz4",value="@0x4005e0"},{name="blaz",value="@0x0"}, > {name="blaz3",value="@0x40041b"},{name="blaz5",value="@0x400578"}] > > Now we are showing only the reference, not the target. I would have > expected the target value. > > Looking at Eclipse: > cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralValue.java > > // Coming from a reference > if (valueString.startsWith("@")) { //$NON-NLS-1$ > valueString = valueString.substring(1); > int colon = valueString.indexOf(':'); > if (colon != -1) { > valueString = valueString.substring(colon > + 1); > } So, Eclipse is manually parsing the "value" string? I pretty sure I've heard either Bob, or Eli say this is not good idea. In fact, I suspect I heard both of them say this. > } else { > > It wants to show the value in its variables window, not the reference. > So this patch would break it. > > So, should we change common_val_print, do you think? Short-term, this might be a solution. But note again that depending on textual "value" field is bad idea in any case. Long-term the right solution is: - Port the Apple change that allows to get variable objects for all local variables in one command. - Port Apple change that add 'typecode' field to variable objects - Add command/variable object format to deference references - Teach Eclipse that for variable object with "reference" typecode, it should dereference variable object, or whatever is appropriate. This could be a long process, though. - Volodya