Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Siva Chandra <sivachandra@google.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v14 3/4] Add support for lookup, overload resolution and invocation of C++ debug methods
Date: Wed, 23 Apr 2014 21:41:00 -0000	[thread overview]
Message-ID: <CAGyQ6gz5YRBmSDt2A-n6w5ssT=BN8CxY1R7UP_YVp8WyWq9m2A@mail.gmail.com> (raw)
In-Reply-To: <CADPb22SPFTraB3nVH1XQZXXB7LKowmLzLLyU_TQ6eGkPZjKzsA@mail.gmail.com>

On Wed, Apr 23, 2014 at 1:06 PM, Doug Evans <dje@google.com> wrote:
> A good question we need to answer is: What happens if a user does
> "ptype" on an expression involving a debug method?
> [ptype uses evaluate_type which is an example of using EVAL_AVOID_SIDE_EFFECTS]
> A user should be able to do that and have confidence that inferior
> state will not be modified.
> Reading the vtable is ok, but if the debug method is implementing,
> say, some kind of iterator then modifying inferior state would not be
> ok.
>
> I tried "ptype a1 + a2" from your py-debugmethods.exp testcase, and
> the debug method does get invoked.
> Is that ok?  In many cases probably, but it doesn't seem likely to be
> ok in the general case.

The example answers it! As a user I never used ptype on expressions,
and have never seen one do it. The only doc about
EVAL_AVOID_SIDE_EFFECTS I have is the comment in expression.h. I think
we should add there that one use of this option is when ptype-ing on
expressions. I can send a comment patch if you feel its meaningful.

So then, I will take your suggestion about encapsulating debug methods
in a value and send a new version. The rest of your comments will be
automatically taken care of I think. The name, I will go with
"xmethods" and TYPE_CODE_XMETHOD if that is OK.

Thanks,
Siva Chandra


  reply	other threads:[~2014-04-23 21:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 19:06 Siva Chandra
2014-04-21 23:56 ` Doug Evans
2014-04-22 20:46   ` Siva Chandra
2014-04-23 20:06     ` Doug Evans
2014-04-23 21:41       ` Siva Chandra [this message]
2014-04-24  0:33         ` Doug Evans

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='CAGyQ6gz5YRBmSDt2A-n6w5ssT=BN8CxY1R7UP_YVp8WyWq9m2A@mail.gmail.com' \
    --to=sivachandra@google.com \
    --cc=dje@google.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