Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Chris Moller <cmoller@redhat.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] pr11594
Date: Tue, 22 Jun 2010 18:38:00 -0000	[thread overview]
Message-ID: <m34oguewvg.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4C20A875.7060204@redhat.com> (Chris Moller's message of "Tue, 22	Jun 2010 08:11:33 -0400")

>>>>> "Chris" == Chris Moller <cmoller@redhat.com> 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  <cmoller@redhat.com>
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


  reply	other threads:[~2010-06-22 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 12:11 Chris Moller
2010-06-22 18:38 ` Tom Tromey [this message]
2010-06-22 19:57   ` Chris Moller
2010-06-23 17:38     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34oguewvg.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=cmoller@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox