Call overloaded operators to perform operations on gdb.Value objects.
* NEWS: Add entry for the new feature * python/py-value.c (valpy_binop): Call value_x_binop for struct and class values. testsuite/ * gdb.python/py-value-cc.cc: Improve test case to enable testing operations on gdb.Value objects. * gdb.python/py-value-cc.exp: Add new test to test operations on gdb.Value objects. doc/ * python.texi (Values From Inferior): Add description about the new feature.
This commit is contained in:
parent
649ebbcaef
commit
f7bd0f7854
8 changed files with 88 additions and 12 deletions
|
@ -16,10 +16,19 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
class A {
|
||||
public:
|
||||
int operator+ (const int a1);
|
||||
|
||||
public:
|
||||
int a;
|
||||
};
|
||||
|
||||
int
|
||||
A::operator+ (const int a1)
|
||||
{
|
||||
return a + a1;
|
||||
}
|
||||
|
||||
union U {
|
||||
int a;
|
||||
char c;
|
||||
|
@ -88,5 +97,7 @@ main ()
|
|||
{
|
||||
A obj;
|
||||
|
||||
obj.a = 5;
|
||||
|
||||
return func (obj);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue