This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/Patch] Call overloaded operators to perform valid Python operations on struct/class values.


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]