This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/14077] New: Dynamic type of references cannot beaccessed
- 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 10:21:42 +0000
- Subject: [Bug python/14077] New: Dynamic type of references cannot beaccessed
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=14077
Bug #: 14077
Summary: Dynamic type of references cannot be accessed
Product: gdb
Version: HEAD
Status: NEW
Severity: enhancement
Priority: P2
Component: python
AssignedTo: unassigned@sourceware.org
ReportedBy: andre.poenitz@nokia.com
Classification: Unclassified
echo "
struct A { virtual ~A() {} int a; };
struct B : A {};
int main()
{
B b;
A *b1 = &b;
A &b2 = b;
return b1->a + b2.a;
}
" | g++ -g -xc++ -
~/debugger/gdb-git-i586/gdb/gdb \
-ex "set confirm off" \
-ex "file ./a.out" \
-ex "b 10" \
-ex run \
-ex "python print 'Pointer static type : %s' %
gdb.parse_and_eval('b1').type" \
-ex "python print 'Pointer dynamic type : %s' %
gdb.parse_and_eval('b1').dynamic_type" \
-ex "python print 'Reference static type : %s' %
gdb.parse_and_eval('b2').type" \
-ex "python print 'Reference dynamic type : %s' %
gdb.parse_and_eval('b2').dynamic_type"
yields:
Pointer static type : A *
Pointer dynamic type : B *
Reference static type : A &
Traceback (most recent call last):
File "<string>", line 1, in <module>
gdb.error: Attempt to take contents of a non-pointer value.
Error while executing Python code.
It would be convenient to see
Reference dynamic type : B &
in the last line
--
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.