From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31886 invoked by alias); 24 Sep 2009 19:30:38 -0000 Received: (qmail 31868 invoked by uid 22791); 24 Sep 2009 19:30:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Thu, 24 Sep 2009 19:30:30 +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 n8OJUScx009615 for ; Thu, 24 Sep 2009 15:30:28 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8OJUQjU015224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 Sep 2009 15:30:28 -0400 Message-ID: <4ABBC8D1.6010107@redhat.com> Date: Thu, 24 Sep 2009 19:30:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [RFA] Add method overload resolution to expression parser References: <4A9D628B.1070300@redhat.com> In-Reply-To: <4A9D628B.1070300@redhat.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: 2009-09/txt/msg00755.txt.bz2 Ping [I also have expanded tests for this in my next patch, which adds proper C++ operator handling in the parser.] On 09/01/2009 11:06 AM, Keith Seitz wrote: > Hi, > > The attached patch is the first of several patches which will attempt > mitigate the requirement of single-quoting every single C++ expression > passed to the parser. > > This patch specifically adds method overload resolution into parser, so > now gdb correctly understands "print foo::flubber(int)". > > I've added a few basic tests to gdb.cp/overload.exp, but when this > series of patches is nearing completion, I will submit my archer > "realcpp" tests, which are far more thorough (and currently causes gdb > to crash a lot). > > Tested regression-free on x86 linux. > > Keith > > ChangeLog > 2009-09-01 Keith Seitz > > * c-exp.y: Add new rule for resolving method overloads. > Add cleanups for nonempty_typelist. Changed all users. > * eval.c (make_params): New function. > (free_param_types): New function. > (evaluate_subexp_standard): Pass expect_type to value_aggregate_elt. > Handle case TYPE_INSTANCE. > (evaluate_subexp_for_address): Pass expect_type to value_aggregate_elt. > * expression.h (enum exp_opcode): Add TYPE_INSTANCE. > (compare_parameters): Add declaration. > * parse.c (operator_length_standard): Add TYPE_INSTANCE. > * valops.c (value_aggregate_elt): Add new expect_type parameter. > Pass expect_type to value_struct_elt_for_reference. > (value_struct_elt_for_reference): Add expect_type parameter and use > compare_parameters. > Check for overload matches with and without artificial parameters. > Skip artificial methods. > (compare_parameters): New function. > * value.h (value_aggregate_elt): Add new expect_type parameter. > > testsuite/ChangeLog > 2009-09-01 Keith Seitz > > * gdb.cp/overload.exp: Add tests for resolving overloaded > methods in expression parsing/evaluation.