ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to display derived objects


From: Atwood, Robert C
Subject: RE: How to display derived objects
Date: Fri, 19 Dec 2003 13:16:55 -0000

Probably you can use the explicit 'display new expression' pop-up (right
click on the display area) and type in: 

((Derived *) (p)) 

in the dialog. The idea is to recast it for ddd -- but without altering
your program. 

I have done this sort of thing in ddd --  but maybe not exaclty what you
describe. Or maybe from the command line of gdb, use

graph display ((Derived *)(p))

Probably not all those parentheses would be strictly necessary ... 

--Robert
 


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Grzegorz Jakacki
Sent: 18 December 2003 05:05
To: address@hidden
Subject: How to display derived objects



I have this C++ code:

    class Base {  // abstract
        ...
    };

    class Derived : public Base {
        ...
        int x_;
    };

    Base* p = new Derived;

When I do 'graph display *p' all I see is a Base subobject with vtable
info. In particular the display does not show the fields of Derived
object. Can I set up ddd so that it displays the actual object given a
pointer to base?

Thanks
Grzegorz

PS: My config: ddd-3.3.1, gdb-5.3, sparc-sun-solaris2.6


##################################################################
# Grzegorz Jakacki                       Huada Electronic Design #
# Senior Engineer, CAD Dept.              1 Gaojiayuan, Chaoyang #
# tel. +86-10-64365577 x2074               Beijing 100015, China #
# Copyright (C) 2003 Grzegorz Jakacki, HED. All Rights Reserved. #
##################################################################



_______________________________________________
Ddd mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/ddd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]