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:
Siva Chandra 2013-12-02 06:45:09 -08:00
parent 649ebbcaef
commit f7bd0f7854
8 changed files with 88 additions and 12 deletions

View file

@ -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);
}