This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/Patch] Call overloaded operators to perform valid Python operations on struct/class values.
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Siva Chandra <sivachandra at google dot com>
- Cc: gdb-patches at sourceware dot org, tromey at redhat dot com, dje at google dot com
- Date: Sat, 21 Dec 2013 10:21:23 +0200
- Subject: Re: [RFC/Patch] Call overloaded operators to perform valid Python operations on struct/class values.
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gxk9zcLKQ1Ef2XhgUMCyB8MB1v=6tA4jsfPyEFgxR8bNw at mail dot gmail dot com> <m31u1q1oq0 dot fsf at sspiff dot org> <871u1j2ldi dot fsf at fleche dot redhat dot com> <CAP9bCMSPpz8px2ZFvRroHcNP8PWWQV39P7GmXCmj+fdSR7NT2Q at mail dot gmail dot com> <CAGyQ6gzYE_NthBxc17VPxjgtYSqTW3HGhPVp8qvk=Nye27G8hg at mail dot gmail dot com> <CAP9bCMTthY1oJN-res0Cegd_YrMqW77ZehMjnzK+Y9681Of5bQ at mail dot gmail dot com> <CAGyQ6gy9E3J8mbG0xKTTwH8=MYG2naeBhMtwmNb5f=m9Xsmufg at mail dot gmail dot com> <CAP9bCMTcTRTR7QUQqJXY5qAk28q3nABSh0DEJyMKOB65wf71jA at mail dot gmail dot com> <CAGyQ6gzYoyct9VwjsTgVR0tcq_u3=abyfdSAQwssqQk09yYdZA at mail dot gmail dot com> <CAGyQ6gzMxiWMCYxYDvyWDfXVxfe3_Yy=6uzOyVyJ9XO+8QU5YA at mail dot gmail dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 20 Dec 2013 14:29:36 -0800
> From: Siva Chandra <sivachandra@google.com>
> Cc: Tom Tromey <tromey@redhat.com>, Doug Evans <dje@google.com>
>
> 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.