From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9040 invoked by alias); 4 Nov 2014 15:40:25 -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 9023 invoked by uid 89); 4 Nov 2014 15:40:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: e34.co.us.ibm.com Received: from e34.co.us.ibm.com (HELO e34.co.us.ibm.com) (32.97.110.152) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 04 Nov 2014 15:40:22 +0000 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Nov 2014 08:40:19 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 4 Nov 2014 08:40:18 -0700 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 3B49619D8041 for ; Tue, 4 Nov 2014 08:29:00 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sA4FeIEJ50659454 for ; Tue, 4 Nov 2014 16:40:18 +0100 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sA4FdAH8025221 for ; Tue, 4 Nov 2014 08:39:11 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id sA4Fd8ad024933; Tue, 4 Nov 2014 08:39:09 -0700 Message-Id: <201411041539.sA4Fd8ad024933@d03av02.boulder.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 04 Nov 2014 16:39:08 +0100 Subject: Re: [PATCH v4] Make chained function calls in expressions work To: sivachandra@google.com (Siva Chandra) Date: Tue, 04 Nov 2014 15:40:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches) In-Reply-To: from "Siva Chandra" at Nov 04, 2014 07:08:05 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: 14110415-0017-0000-0000-0000060CA4E9 X-SW-Source: 2014-11/txt/msg00067.txt.bz2 Siva Chandra wrote: > On Tue, Nov 4, 2014 at 5:43 AM, Ulrich Weigand wrote: > > Well, that's true. For simple structs, we would have to create a > > temporary at the point of call when using a reference; we discussed > > adding this anyway (it's necessary for scalars as well) ... > > I agree for scalars, but is it worth the effort to make this check for > structs/unions? Consider this example: > > struct Simpler > { > char c; > char getc (); > }; > > struct Simple > { > Simpler a, b; > }; > > Simple > make_simple () > { > Simple s; > s.a.c = 'a'; > s.b.c = 'b'; > return s; > } > > Simple does not have any methods, but Simpler has. The ABI returns > objects of Simple type in register. However, one could have an > expression like this: make_simple().a.geta() which is equivalent to > f().g(). Hmm, OK. I guess one could check for all those cases, but in the end it probably doesn't matter much. So I'm fine with the solution in your patch to just do it for all classes/unions. We can always fine-tune this further in the future if the need arises. Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com