From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13150 invoked by alias); 21 Dec 2013 08:21:41 -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 13139 invoked by uid 89); 21 Dec 2013 08:21:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout21.012.net.il Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Dec 2013 08:21:39 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MY500600DE6SZ00@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Sat, 21 Dec 2013 10:21:36 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MY5006VSDW0TH00@a-mtaout21.012.net.il>; Sat, 21 Dec 2013 10:21:36 +0200 (IST) Date: Sat, 21 Dec 2013 08:21:00 -0000 From: Eli Zaretskii Subject: Re: [RFC/Patch] Call overloaded operators to perform valid Python operations on struct/class values. In-reply-to: To: Siva Chandra Cc: gdb-patches@sourceware.org, tromey@redhat.com, dje@google.com Reply-to: Eli Zaretskii Message-id: <83ppoqaa2k.fsf@gnu.org> References: <871u1j2ldi.fsf@fleche.redhat.com> X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00856.txt.bz2 > Date: Fri, 20 Dec 2013 14:29:36 -0800 > From: Siva Chandra > Cc: Tom Tromey , Doug Evans > > I do not think there was an agreement on whether to have this feature > or not. Based on the points raised by Doug, my personal opinion is > that we should have this feature along with the facility (which in my > opinion is a cool fallback when no other Pythonic way works) suggested > by Doug. To keep the discussion moving for both the ideas, I am > sending a patch which addresses the nits pointed out by Doug on my > first patch. I will hopefully find time during the holidays to work > on the feature suggested by Doug. Thanks. > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -42,6 +42,9 @@ > ** Line tables representation has been added. > ** New attribute 'parent_type' for gdb.Field objects. > ** gdb.Field objects can be used as subscripts on gdb.Value objects. > + ** Valid Python operations on gdb.Value objects representing > + structs/classes invokes the corresponding overloaded operators if > + available. ^^^^^^^ "invoke", in plural. > +Python operations can also be performed on @code{gdb.Value} objects > +representing @code{struct}s/@code{class}es. For such cases, the These tricks don't look good in print, due to changes in typefaces. Suggest to rephrase representing a @code{struct} or a @code{class}. > + which has an overloaded > +operator defined for the @code{+} operator "which overloads the @code{+} operator" sounds better, and is surely shorter and more concise. The documentation parts are OK with those changes.