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

Doug Evans xdje42@gmail.com
Mon Dec 16 07:48:00 GMT 2013


On Wed, Dec 11, 2013 at 12:17 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <xdje42@gmail.com> writes:
>
> Doug> I'm not yet comfortable enough with going this route to approve it.
>
> It seems fine to me.
>
> Doug> It feels sexy and all, but it's not clear to me going this path is
> Doug> a net win.
>
> What are the negatives?  Your email leaves little to either agree or
> argue with.  A little more insight into your reasoning might be useful.

My concern is basically that one can only go so far mapping Python to
the target language (or, can we get a "mode" (for lack of a better
word) in Python of accepting the syntax of the target language?)

Does it make sense to support what one can (arithmetic ops, a few
others), and leave it at that?  I don't know.
Every feature adds complexity, and this feature can never be complete
(I could certainly be wrong ... it would be interesting if all C++
operators could be supported).

Note that I'm not disapproving the feature ... if someone else
approves the patch I'm not going to object.
For myself, I'm just going slow on this one.  E.g., is there another
way to provide this?
E.g., some kind of facility that uses gdb's language parsers but let's
one pass in gdb.Value objects from Python?
It sounds doable, but I haven't thought about it very hard (it might
not even make sense, or it may require more effort).
Its drawback to the current proposal is that it would be a bit more
verbose, but it has to potential of handling a lot more cases.



More information about the Gdb-patches mailing list