This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/11792] Provide access to the dynamic type of an object
- From: "andre dot poenitz at nokia dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 7 Jul 2010 10:26:48 -0000
- Subject: [Bug python/11792] Provide access to the dynamic type of an object
- References: <20100706160015.11792.andre.poenitz@nokia.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From andre dot poenitz at nokia dot com 2010-07-07 10:26 -------
Created an attachment (id=4872)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4872&action=view)
proof-of-concept code, mainly copied code from a path triggered by 'set print
object on'
With the attached patch and adding
-ex 'python print "Python says: '%s'" % gdb.parse_and_eval("b").dynamic_type'
to the test script I get
Temporary breakpoint 1, main () at <stdin>:5
5 <stdin>: No such file or directory.
in <stdin>
6 in <stdin>
$1 = (Base *) 0x804b008
$2 = (Derived *) 0x804b008
Python says: Base *
Python says: Derived *
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11792
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.