Prism 6.0 User's Guide

C++ Support in Prism 6.0

Prism 6.0 provides limited support for debugging C++ programs.

Fully Supported C++ Features

With few limitations, you can use Prism to debug C++ programs containing the features described in this section.

Data Members in Methods

You can simply type print member to print a data member when in a class method.

C++ Linkage Names

You can set breakpoints using the stop in command with functions having either C or C++ linkage (mangled) names.

Methods of a Class

You can use the Prism stop in, func and list commands with methods of a class.

(prism) stop in class_name::method_name


(prism) func class_name::method_name


(prism) list class_name::method_name

Class Member Variables

Prism supports assignment to class member variables.

Variables of Class Type and Template Classes

You can use the Prism whatis and print commands with variables of class type and template classes.

this Identifier

Prism recognizes the this identifier in C++ methods. Its value also appears in stack back-traces.

Overloaded Method Names

Prism allows you to set breakpoints in overloaded method names. A list pops up, from which you can select the correct method.

Template Functions

Prism allows you to set breakpoints in template functions. A list pops up, from which you can select the correct function.

Scope Operator in Prism Identifier Syntax

Prism's identifier syntax recognizes the C++ scope operator, ::. For example:

(prism) whereis dummy
variable: `symbol.x`symbol.cc`Symbol::print:71`dummy

Partially Supported C++ Features

With significant limitations, you can use Prism to debug C++ programs containing the features described in this section.

Casts

Prism recognizes casting a class pointer to the class of a base type only for single inheritance relationships. For example, Prism recognizes the following cast syntax when printing variable P:

(prism) print (struct class_name *) P
(prism) print (class class_name *) P	
(prism) print (class_name *) P

Static Class Members

You can print static class members when the current scope is a class method. You cannot print static class members when not in class scope. For example, the following command will fail if you issue it outside of the scope of class_name:

(prism) print class_name::var_name

Break Points in Methods

You cannot use a method name that has some forms of non-C identifier syntax to set a breakpoint. For example, this fails with a syntax error:

(prism) stop in class_name::operator+

You must instead use stop at line syntax. These method names are correctly identified in a stack trace, however.

Unsupported C++ Features

You cannot use Prism to debug C++ programs containing the features described in this section.

Inlined Methods Used in Multiple Source Files

Using Prism 6.0, you cannot set a breakpoint in an inlined method that is used in multiple source files. Only one of the several debuggable copies of the inlined function gets the breakpoint.

Calling C++ Methods

Prism does not support calling C++ methods, using any syntax.

Variables of Type Reference

Prism does not support printing variables of type reference, such as int &xref. Also, variables of type reference appear as (unknown type) in stack traces.