public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/14077] New: Dynamic type of references cannot be accessed
@ 2012-05-08 10:22 andre.poenitz at nokia dot com
  2012-05-08 17:02 ` [Bug python/14077] " andre.poenitz at nokia dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: andre.poenitz at nokia dot com @ 2012-05-08 10:22 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-28 16:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08 10:22 [Bug python/14077] New: Dynamic type of references cannot be accessed andre.poenitz at nokia dot com
2012-05-08 17:02 ` [Bug python/14077] " andre.poenitz at nokia dot com
2013-06-13 16:29 ` tromey at redhat dot com
2014-03-24 16:05 ` poenitz at htwm dot de
2020-04-28 16:24 ` ssbssa at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).