From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2504 invoked by alias); 12 Jul 2010 18:51:29 -0000 Received: (qmail 2491 invoked by uid 22791); 12 Jul 2010 18:51:28 -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; Mon, 12 Jul 2010 18:51:22 +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 o6CIpLEY017316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Jul 2010 14:51:21 -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 o6CIpKtK000493 for ; Mon, 12 Jul 2010 14:51:21 -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 o6CIpKwG016294 for ; Mon, 12 Jul 2010 14:51:20 -0400 Message-ID: <4C3B6428.8090906@redhat.com> Date: Mon, 12 Jul 2010 18:51: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: [patch] function eval cleanup Content-Type: multipart/mixed; boundary="------------000900030205060507040003" 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-07/txt/msg00214.txt.bz2 This is a multi-part message in MIME format. --------------000900030205060507040003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 386 This code performs function evaluation before overload resolution completes. Currently, for C++, this is a waste if overload resolution results in a different function than the one which was evaluated but it breaks a future patch of mine which introduces a fake place holding variable needed for proper template function evaluation. This patch cleans up the above Sami Wagiaalla --------------000900030205060507040003 Content-Type: text/plain; name="overload-cleanup.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="overload-cleanup.patch" Content-length: 1886 commit 9ae843b0376c83096f8d2d0fad5c94142209e8c3 Author: Sami Wagiaalla Date: Tue Jun 22 12:19:08 2010 -0400 Corrected pre-overload-resolution function evaluation. 2010-07-12 Sami Wagiaalla * eval.c (evaluate_subexp_standard): Disabled evaluation of C++ function symbols before overload resolution. diff --git a/gdb/eval.c b/gdb/eval.c index 9a60616..ea3d8a0 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1491,19 +1491,28 @@ evaluate_subexp_standard (struct type *expect_type, { /* Non-method function call */ save_pos1 = *pos; - argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside); tem = 1; - type = value_type (argvec[0]); - if (type && TYPE_CODE (type) == TYPE_CODE_PTR) - type = TYPE_TARGET_TYPE (type); - if (type && TYPE_CODE (type) == TYPE_CODE_FUNC) + + /* If this is a C++ function wait until overload resolution. */ + if (overload_resolution + && (exp->language_defn->la_language == language_cplus)) { - for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++) + (*pos) += 4; /* Skip the evaluation of the symbol. */ + argvec[0] = NULL; + } + else + { + argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside); + type = value_type (argvec[0]); + if (type && TYPE_CODE (type) == TYPE_CODE_PTR) + type = TYPE_TARGET_TYPE (type); + if (type && TYPE_CODE (type) == TYPE_CODE_FUNC) { - /* pai: FIXME This seems to be coercing arguments before - * overload resolution has been done! */ - argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem - 1), - exp, pos, noside); + for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++) + { + argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem - 1), + exp, pos, noside); + } } } } --------------000900030205060507040003--