From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28863 invoked by alias); 14 Jul 2010 23:00:20 -0000 Received: (qmail 28852 invoked by uid 22791); 14 Jul 2010 23:00:19 -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; Wed, 14 Jul 2010 23:00:14 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6EN0BF8030683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 14 Jul 2010 19:00:12 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6EN0Ans013998; Wed, 14 Jul 2010 19:00:11 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o6EN0ABk016065; Wed, 14 Jul 2010 19:00:10 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id ACB113782A3; Wed, 14 Jul 2010 17:00:09 -0600 (MDT) From: Tom Tromey To: sami wagiaalla Cc: gdb-patches@sourceware.org Subject: Re: [patch] function eval cleanup References: <4C3B6428.8090906@redhat.com> Date: Wed, 14 Jul 2010 23:00:00 -0000 In-Reply-To: <4C3B6428.8090906@redhat.com> (sami wagiaalla's message of "Mon, 12 Jul 2010 14:51:20 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-07/txt/msg00235.txt.bz2 >>>>> "Sami" == sami wagiaalla writes: Sami> This code performs function evaluation before overload resolution Sami> completes. Currently, for C++, this is a waste if overload Sami> resolution results in a different function than the one which was Sami> evaluated but it breaks a future patch of mine which introduces a Sami> fake place holding variable needed for proper template function Sami> evaluation. You didn't mention how you tested this... Sami> + /* If this is a C++ function wait until overload resolution. */ Sami> + if (overload_resolution Sami> + && (exp->language_defn->la_language == language_cplus)) Sami> { Sami> - for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++) Sami> + (*pos) += 4; /* Skip the evaluation of the symbol. */ Why is it ok to add 4 here? I think this assumes that the function in question is a symbol. But is that always the case? What about something like calling via a function pointer? Or some other more complicated subexpression? If there is a failing case here, and it was not caught by the test suite, please also add a regression test. Some day we should refactor this whole case, it is really hard to understand. And 'overload_resolution' -- another global affecting things randomly throughout gdb. Sigh. I wonder if anybody would complain if we just got rid of it. Tom