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.


On Wed, Dec 18, 2013 at 3:15 PM, Siva Chandra <sivachandra@google.com> wrote:
> On Wed, Dec 18, 2013 at 8:37 AM, Doug Evans <xdje42@gmail.com> wrote:
>> Not that this could work, but for illustration's sake:
>> smart_ptr = gdb.parse_and_eval ("my_smart_ptr");
>> dereferenced_smart_ptr = gdb.parse_and_eval("*%V" % smart_ptr)
>
> Should work. May be the '%' syntax would not (I am not sure). But, we
> could consider other alternatives [Replace occurrences of $1, $2, etc
> for example].
>
> Is this an exhaustive solution or a cool fallback option when no other
> Pythonic way works

Both?
[Not sure I understand the question.]

> [Side topic: Should smart_ptr.dereference() invoke 'operator*'? The
> documentation says this: "... behavior of Value.dereference is
> identical to applying the C unary operator * on a given value." And, I
> remember writing this myself :-)]

Dunno.


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