This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/14077] Dynamic type of references cannot be accessed
- From: "andre.poenitz at nokia dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 08 May 2012 17:01:31 +0000
- Subject: [Bug python/14077] Dynamic type of references cannot be accessed
- Auto-submitted: auto-generated
- References: <bug-14077-4717@http.sourceware.org/bugzilla/>
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.