From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14421 invoked by alias); 22 Jun 2010 18:38:20 -0000 Received: (qmail 14228 invoked by uid 22791); 22 Jun 2010 18:38:19 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_PL,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; Tue, 22 Jun 2010 18:38:14 +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 o5MIcDY4004125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 22 Jun 2010 14:38:13 -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 o5MIcC9P007314; Tue, 22 Jun 2010 14:38:13 -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 o5MIcB0w003593; Tue, 22 Jun 2010 14:38:12 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 7AC253792DA; Tue, 22 Jun 2010 12:38:11 -0600 (MDT) From: Tom Tromey To: Chris Moller Cc: "gdb-patches\@sourceware.org" Subject: Re: [patch] pr11594 References: <4C20A875.7060204@redhat.com> Reply-To: tromey@redhat.com Date: Tue, 22 Jun 2010 18:38:00 -0000 In-Reply-To: <4C20A875.7060204@redhat.com> (Chris Moller's message of "Tue, 22 Jun 2010 08:11:33 -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-06/txt/msg00487.txt.bz2 >>>>> "Chris" == Chris Moller writes: Chris> I'm fairly sure that the Chris> type2 = check_typedef (type1); Chris> at valarith.c:277 is a typo and treally should be Chris> type2 = check_typedef (type2); Yes. Chris> but, with gdb, who knows? The maintainers are here to help. Feel free to ask questions either on the gdb list or #gdb. Chris> +2010-06-21 Chris Moller Chris> + Chris> + * eval.c (evaluate_subexp_standard): Add a test for an overloaded Chris> + comma operator. Put the PR info at the top of the ChangeLog entry. See ChangeLog for examples of the format. Chris> case BINOP_COMMA: Chris> - evaluate_subexp (NULL_TYPE, exp, pos, noside); Chris> - return evaluate_subexp (NULL_TYPE, exp, pos, noside); Chris> + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); Chris> + arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); Chris> + if (noside == EVAL_SKIP) Chris> + goto nosideret; Chris> + if (current_language->la_language == language_cplus Chris> + && binop_user_defined_p (op, arg1, arg2)) Chris> + { Chris> + struct value *rc; Chris> + Chris> + rc = value_x_binop (arg1, arg2, op, OP_NULL, noside); Chris> + if (rc != NULL) Chris> + return rc; Chris> + else Chris> + return arg2; I think I understand why the current_language check and the result check of value_x_binop are needed. However, I think it would be better to do all the work in value_x_binop and also remove the current_language check. This is more similar to what other code does and it consolidates the (broken) current_language checks in the value code. I'm guessing this means a change to value_user_defined_op. Chris> Index: testsuite/gdb.cp/pr11594.cc Chris> =================================================================== Chris> RCS file: testsuite/gdb.cp/pr11594.cc Chris> diff -N testsuite/gdb.cp/pr11594.cc Chris> --- /dev/null 1 Jan 1970 00:00:00 -0000 Chris> +++ testsuite/gdb.cp/pr11594.cc 22 Jun 2010 02:38:57 -0000 Chris> @@ -0,0 +1,46 @@ Chris> +class complx Needs a GPL header. Tom