This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/14077] Dynamic type of references cannot be accessed


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]