From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31268 invoked by alias); 23 Sep 2011 11:40:11 -0000 Received: (qmail 31251 invoked by uid 22791); 23 Sep 2011 11:40:09 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Sep 2011 11:39:49 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8NBdjv8021881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Sep 2011 07:39:45 -0400 Received: from host1.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8NBdhon025194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Sep 2011 07:39:45 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p8NBdgZo014279; Fri, 23 Sep 2011 13:39:42 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p8NBdftr014277; Fri, 23 Sep 2011 13:39:41 +0200 Date: Fri, 23 Sep 2011 12:02:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [patch 11/12] entryval#2: @entry values even for references Message-ID: <20110923113941.GA14054@host1.jankratochvil.net> References: <20110913195046.GL12849@host1.jankratochvil.net> <201109230042.03104.pedro@codesourcery.com> <20110923083032.GA5996@host1.jankratochvil.net> <201109231050.22720.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201109231050.22720.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-09/txt/msg00429.txt.bz2 On Fri, 23 Sep 2011 11:50:22 +0200, Pedro Alves wrote: > Sorry, in the hurry, I hadn't noticed you had used `S &s; class S { char a, b; };'. > That's not the case I raised originally. The case is an entry val of > type `struct { int a; long &b; }'. Calling an entry object of that > type `s', if we "print s@entry", I think we'll: In such case the parameter `s' is not TYPE_CODE_REF and therefore entry_data_value_funcs do not get ever used and therefore coerce_ref_if_computed will always return NULL. coerce_ref_if_computed is there only as a hack for TYPE_CODE_REF which dereferences into something else than what a native normal such TYPE_CODE_REF-pointer would derefefence into. I had a former version of the patch which did not use coerce_ref_if_computed and if it has seen TYPE_CODE_REF with both DW_AT_GNU_call_site_value (=the pointer) and DW_AT_GNU_call_site_data_value (=the dereferenced data) then it created non-lazy lval_memory object of TYPE_TARGET_TYPE type with value_address set to that reference-pointer. But such case was (a) confusing because `ptype param' and `ptype param@entry' could be different and (b) dangerous as param@entry was modifiable due to its lval_memory (it is not_lval now). > print A (TYPE_CODE_INT) at embedded_offset 0 of S, and then B > at embedded_offset==offsetof(typeof(s), b) of S (e.g., 8). B will > be TYPE_CODE_REF here, and coerce_ref_if_computed on S will wrongly coerce_ref_if_computed will be NULL as there is no coerce_ref_if_computed anywhere present. > operate on the contents of the whole S (because it loses embedded_offset), > instead of working with the B contents of S. Thanks, Jan