dgbaur
01-05-2011, 01:24 PM
class A {
public:
virtual ~A()
{};
virtual dump(std::ostream &os) const = 0;
}
class B : public A {
B():
value(1)
{}
virtual dump(std::ostream &os) const {
os << value;
}
private:
int value;
}
main() {
...
A * a = new B;
a.dump(cout);
...
}
When I dive on a, the data for a is solely the int(...)** virtual table pointer, but i knows that the type is B. Yet the window does not show the type as B, rather it displays it at A, therefore I do not see 'value'. Is there a way to get totalview to display the derived type information knowing the type via the virtual table pointer? Or do I have to change the type myself?
public:
virtual ~A()
{};
virtual dump(std::ostream &os) const = 0;
}
class B : public A {
B():
value(1)
{}
virtual dump(std::ostream &os) const {
os << value;
}
private:
int value;
}
main() {
...
A * a = new B;
a.dump(cout);
...
}
When I dive on a, the data for a is solely the int(...)** virtual table pointer, but i knows that the type is B. Yet the window does not show the type as B, rather it displays it at A, therefore I do not see 'value'. Is there a way to get totalview to display the derived type information knowing the type via the virtual table pointer? Or do I have to change the type myself?