From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28111 invoked by alias); 6 Aug 2010 16:23:25 -0000 Received: (qmail 28102 invoked by uid 22791); 6 Aug 2010 16:23:24 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 06 Aug 2010 16:23:20 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o76GNFDn024826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 6 Aug 2010 12:23:15 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o76GNE7n015096 for ; Fri, 6 Aug 2010 12:23:14 -0400 Received: from [10.15.16.129] (dhcp-10-15-16-129.yyz.redhat.com [10.15.16.129]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o76GNE9M006225 for ; Fri, 6 Aug 2010 12:23:14 -0400 Message-ID: <4C5C36F1.9040800@redhat.com> Date: Fri, 06 Aug 2010 16:23:00 -0000 From: sami wagiaalla User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [patch] smart pointer support References: <201008052257.o75MvaE9031710@d12av02.megacenter.de.ibm.com> In-Reply-To: <201008052257.o75MvaE9031710@d12av02.megacenter.de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2010-08/txt/msg00072.txt.bz2 On 08/05/2010 06:57 PM, Ulrich Weigand wrote: > sami wagiaalla wrote: > >> * infcall.c (call_function_by_hand): Set VALUE_LVAL of the >> returned value to lval_memory. > > >> @@ -1026,6 +1026,7 @@ When the function is done executing, GDB will silently stop."), >> retval = allocate_value (values_type); >> gdbarch_return_value (gdbarch, value_type (function), values_type, >> retbuf, value_contents_raw (retval), NULL); >> + VALUE_LVAL (retval) = lval_memory; >> break; > > This part looks broken. Setting VALUE_LVAL to lval_memory implies the > value actually *has* location information pointing to memory, that is > in particular, a memory address. > > Since this value doesn't have that information, and in general it may > not even exist (function return values may be passed in registers), I > don't see how this can be valid here. > Hmm I see. I was under the impression that here the value is copied from the inferior's return location to gdb memory. As the patch stands (with the kfail) this can be removed, but I am actually looking for guidance on how to ensure that this value is available for gdb to perform further function calls that utilize it, especially when the return value is a copy not a reference. As is described in this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11606