Displaying a Class Template and a Function Template

To display a class template or a function template, enter EVAL template-name on the debug command line. The variable template-name is the name of the class template or function template you want to display.

The example below shows the results of evaluating a class template. You must enter a template name that matches the demangled template name. Type definition names are not valid because the typedef information is removed when the template name is mangled.

Figure 1. Using EVAL with a Class Template
      > EVAL XX<int>::a
        XX<int>::= '1 '
      > EVAL XX<inttype>::a
        Identifier not found
      1  template < class A >        //Code evaluated at line 8
      2  class XX {                  //where a breakpoint was set
      3     static A a;
      4     static B b;
      5  };
      6  XX<int> x;
      7  typedef int inttype;
      8  int XX<int>::a =1;          //mangled name a__2XXXTi_
      9  int XX<inttype>::b = 2;     //mangled name b__2XXXTi_

The example below shows the results of evaluating a function template.

Figure 2. Using EVAL with a Function Template
      > EVAL XX<int,12>::sxa
        XX<int,12>::sxa = '1 '
      > EVAL xxobj.xca[0]
        xxobj.xca[0] = '2 '
      1  template < class A, int B>  //Code evaluated at lines 8 and 9
      2  class XX {                  //where breakpoints were set
      3     static A sxa;
      4     char     xca[B];
      5  public:
      6    XX(void) { xca[0] = 2; }
      7  };
      8  XX<int,12> xxobj;
      9  int XX<int,2*6>::sxa =1;
                                     //same as intXX<int,12>::sxa
                                     //mangled name sxa__2XXXTiSP12_