[Bug python/14077] Dynamic type of references cannot be accessed
andre.poenitz at nokia dot com
sourceware-bugzilla@sourceware.org
Tue May 8 17:02:00 GMT 2012
http://sourceware.org/bugzilla/show_bug.cgi?id=14077
--- Comment #1 from Andre Poenitz <andre.poenitz at nokia dot com> 2012-05-08 17:01:31 UTC ---
The following seems to fix the issue for me:
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 6f67bdb..bfb7260 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -310,7 +310,11 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
struct value *target;
int was_pointer = TYPE_CODE (type) == TYPE_CODE_PTR;
- target = value_ind (val);
+ if (was_pointer)
+ target = value_ind (val);
+ else
+ target = coerce_ref (val);
+
type = value_rtti_type (target, NULL, NULL, NULL);
if (type)
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list