This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Binary operations on struct/class values in GDB Python
- From: Siva Chandra <sivachandra at google dot com>
- To: gdb at sourceware dot org
- Date: Wed, 27 Nov 2013 16:10:00 -0800
- Subject: Binary operations on struct/class values in GDB Python
- Authentication-results: sourceware.org; auth=none
Hi,
Under the section "Python API => Values from Inferior" in the GDB
manual, we have this:
"Inferior values that are simple scalars can be used directly in
Python expressions that are valid for the value's data type."
Why are binary operations, which are syntactically correct in Python
as well, restricted to only simple scalars (and pointers)? Couldn't
the Python side call the overloaded operators for structs/classes if
they exist?
I am discounting the '[]' operator as that has a completely different
meaning for gdb.Value objects.
Thanks,
Siva Chandra