From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28913 invoked by alias); 23 Oct 2014 16:09:44 -0000 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 Received: (qmail 28897 invoked by uid 89); 23 Oct 2014 16:09:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: e06smtp10.uk.ibm.com Received: from e06smtp10.uk.ibm.com (HELO e06smtp10.uk.ibm.com) (195.75.94.106) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 23 Oct 2014 16:09:43 +0000 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 Oct 2014 17:09:39 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 23 Oct 2014 17:09:38 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 446E42190045 for ; Thu, 23 Oct 2014 17:09:14 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9NG9clV11993374 for ; Thu, 23 Oct 2014 16:09:38 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9NG9b16004530 for ; Thu, 23 Oct 2014 10:09:37 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s9NG9ZvU004472; Thu, 23 Oct 2014 10:09:36 -0600 Message-Id: <201410231609.s9NG9ZvU004472@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 23 Oct 2014 18:09:35 +0200 Subject: Re: [PATCH 0/2] Make chained function calls in expressions work To: sivachandra@google.com (Siva Chandra) Date: Thu, 23 Oct 2014 16:09:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches) In-Reply-To: from "Siva Chandra" at Oct 23, 2014 08:07:43 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14102316-0041-0000-0000-000001CB52B2 X-SW-Source: 2014-10/txt/msg00606.txt.bz2 Siva Chandra wrote: > Restricting to just those values whose address is returned in a hidden > param (per ABI) is OK, but an implementation detail made me to include > all types of return values. There are two times when a return value's > address is required: > > 1. When a method is invoked on the return value: GDB has to evaluate > the 'this' pointer. This is done in eval.c. Ah, I knew there was something else I was missing :-) In this case, I agree with the rest of your explanation. Please add a comment in the final version of the patch that explains why the extra copy is necessary. There's just one minor change I think would be good: can we allocate that extra copy on the stack at least only for *class* types, then? I'd prefer to avoid this for the common case of routines just returning a scalar. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com