From f9ffd4bb11c401df4c0c5733e946c48d6b295c5e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Aug 2010 20:29:19 +0000 Subject: gdb PR python/11145: * python/py-value.c: Include expression.h. (valpy_do_cast): New function. (valpy_cast): Use it. (valpy_dynamic_cast): New function. (valpy_reinterpret_cast): Likewise. (value_object_methods): Add dynamic_cast, reinterpret_cast. gdb/doc PR python/11145: * gdb.texinfo (Values From Inferior): Document dynamic_cast and reinterpret_cast methods. gdb/testsuite PR python/11145: * gdb.python/py-value.c (Base, Derived): New types. (base): New global. * gdb.python/py-value.exp (test_subscript_regression): Add dynamic_cast test. --- gdb/testsuite/gdb.python/py-value.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gdb/testsuite/gdb.python/py-value.c') diff --git a/gdb/testsuite/gdb.python/py-value.c b/gdb/testsuite/gdb.python/py-value.c index 7481bd5..5ac7d76 100644 --- a/gdb/testsuite/gdb.python/py-value.c +++ b/gdb/testsuite/gdb.python/py-value.c @@ -40,6 +40,16 @@ typedef struct s *PTR; enum e evalue = TWO; #ifdef __cplusplus + +struct Base { + virtual int x() { return 5; } +}; + +struct Derived : public Base { +}; + +Base *base = new Derived (); + void ptr_ref(int*& rptr_int) { return; /* break to inspect pointer by reference. */ -- cgit v1.1