From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25105 invoked by alias); 23 Apr 2014 21:41:03 -0000 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 Received: (qmail 25093 invoked by uid 89); 23 Apr 2014 21:41:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 23 Apr 2014 21:41:01 +0000 Received: by mail-wi0-f180.google.com with SMTP id q5so146012wiv.1 for ; Wed, 23 Apr 2014 14:40:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wb51BDojvaCpgmHZHp+vlMhBrLh43f4/7Zi6dKcIARE=; b=G4t40lcNgXVvSxxwXIeNiu1BDTm0eag5+E4+yXxCOEgi03Ho/HJPIsJQp8+msFSum8 nrTcLWXxfvIB33I6d7oJqvG6OMla2QaYn1Mi4mH7PkjKTO7bXmefhX0IQnfem31As5Xq 8eMUblx8oZ2im13Ccil+Docya9u93rpUUmP1h7aFQi7ajRHKVDM2C7wWc3rRJLUDLbKy 4Met4LkwcPSqFY/kzHlQYGCOn2y5Ys8KGdQiZCI5xMxpjPoxCZmnJasjctdHvCaAYubp E7ZhMNYuzsxbYFZ2P5p62JBTuL50e6sF99HgRxiC9OfEADfsEl1+e9NXnXzyAKfADTZt emJw== X-Gm-Message-State: ALoCoQk07KjoKt1sWjM7q1H4V+JmYArG5O8yr9wuHfwehmX6/LzdQXsQDH2JnkfR9i93Iw+5qfC5n7eAOjWjrI6gaFhbO0j5DWeuHxy5wgbRT5OvYeVI9+bnUOjLEJLERn+nnCdXr19QwxgYoTqUod//Q3SAMZVs1QgH73UCpDZflbGu7Rm9Ps48na+IwQVdxxdYexBfOG/G8oumhMgG8jH8eBfANmaKRQ== MIME-Version: 1.0 X-Received: by 10.180.93.41 with SMTP id cr9mr3481191wib.7.1398289258524; Wed, 23 Apr 2014 14:40:58 -0700 (PDT) Received: by 10.217.51.7 with HTTP; Wed, 23 Apr 2014 14:40:58 -0700 (PDT) In-Reply-To: References: <21333.45108.381336.447391@ruffy.mtv.corp.google.com> Date: Wed, 23 Apr 2014 21:41:00 -0000 Message-ID: Subject: Re: [PATCH v14 3/4] Add support for lookup, overload resolution and invocation of C++ debug methods From: Siva Chandra To: Doug Evans Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00471.txt.bz2 On Wed, Apr 23, 2014 at 1:06 PM, Doug Evans 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