Totalview® User Guide : PART II Debugging Tools and Tasks : Chapter 12 Evaluating Expressions : Why is There an Expression System? : Using C++
Using C++
The TotalView expression system is able to interpret the way you define your classes and their inheritance hierarchy. For example, if you declare a method in a base class and you invoke upon an object instantiated from a derived class, TotalView knows how to access the function. It also understands when a function is virtual. For example, assume that you have the following declarations:
class Circle : public Shape {
public:
...
virtual double area();
virtual double area(int);
double area(int, int);
Figure 182 shows an expression list calling an overloaded function. It also shows a setter (mutator) that changes the size of the circle object. A final call to area shows the new value.
Figure 182 – Expression List Window: Showing Overloads
If your object is instantiated from a class that is part of an inheritance hierarchy, TotalView shows you the hierarchy when you dive on the object.
Figure 183 – Class Casting