This section gives information on the following C++ support features:
C++ is a complex language, with a rich expression system. The debugger understands much of the system, but it does not understand how to evaluate some complex aspects of a C++ expression. It can correctly debug these when they occur in the source code.
The aspects of the expression system not processed properly during debugger expression evaluation include the following:
Many of the implicit conversions
Program-defined operators
Calling constructors and destructors during the debugger's own evaluation of expressions
There are also some minor restrictions in the following grammar, compared with the full C++ expression grammar, to make it unambiguous:
constant-expression
The debugger correctly augments the general lookup rules when inside class member functions, to look up the members correctly.
The debugger has only a limited understanding of namespaces. It correctly processes names such as UserNameSpace::NestedNamespace::userIdentifier, as well as C++ use-declarations, which introduce a new identifier into a scope.
The debugger does not currently understand C++ using-directives.
The debugger understands the relationship between struct and class identifiers and typedef identifiers.
The debugger treats numeric constants the same as C++ does. The enumeration constant identifiers go though the same grammar paths as variable identifiers, which has basically the same effect as the C++ semantics.
constant
The debugger does not understand the following aspects of C++ calls:
Invoking C++ constructors and destructors to create and destroy temporaries containing the value of parameters and results.
Default parameters.
Many of the implicit conversions that may be needed for the parameters.
Overloading resolution. Instead, the debugger queries the user.
call-expression
Restrictions and limits are documented here.
address
: AMPERSAND postfix-expression /* Address of */
: address
| address-exp PLUS address
| address-exp MINUS address
| address-exp STAR address
loc
| qual-typedef-opt TICK type-name
string-literal-list
: string
| string-literal-list string
The debugger understands nested names. Namespaces go through the same paths as classes, hence the unusual use of TYPEDEFname.
id-expression
: id-expression-internals
id-expression-internals
: qualified-id
| id-or-keyword-or-typedef-name
| TWIDDLE id-or-keyword-or-typedef-name
qualified-id
: nested-name-specifier qualified-id-follower
qualified-type
: nested-name-specifier TYPEDEFname
nested-name-specifier
: CLCL
| nested-name-specifier TYPEDEFname CLCL
qualified-id-follower
| TWIDDLE id-or-keyword-or-typedef-name
The debugger understands the full C++ type specification grammar.
| struct-union-enum-type-specifier
| type-qualifier-list type-qualifier
: CONST
| VOLATILE
| LE
| _le
| _be
: basic-type-name basic-type-name
| basic-type-name type-qualifier
| type-qualifier-list basic-type-name
| basic-type-specifier type-qualifier
| basic-type-specifier basic-type-name
struct-union-enum-type-specifier
| type-qualifier-list elaborated-type-name
| struct-union-enum-type-specifier type-qualifier
| type-qualifier-list TYPEDEFname
| typedef-type-specifier type-qualifier
: VOID
| CHAR
| SHORT
| INT
| LONG
| FLOAT
| DOUBLE
| SIGNED
| UNSIGNED
: aggregate-key opt-parenthesized-identifier-or-typedef-name
| aggregate-key qualified-type
opt-parenthesized-identifier-or-typedef-name
: id-or-keyword-or-typedef-name
| LPAREN opt-parenthesized-identifier-or-typedef-name RPAREN
: STRUCT
| UNION
| CLASS
: ENUM id-or-keyword-or-typedef-name
: PARENS type-qualifier-list-opt
| type-specifier abstract-declarator
| basic-type-name abstract-declarator
| qualified-type abstract-declarator
| TYPEDEFname abstract-declarator
| type-qualifier-list abstract-declarator
| postfixing-abstract-declarator
postfixing-abstract-declarator
: BRACKETS
| LBRACKET constant-expression RBRACKET
| array-abstract-declarator LBRACKET constant-expression RBRACKET
: STAR
| AMPERSAND abstract-declarator
| pointer-operator-type abstract-declarator
: LPAREN unary-abstract-declarator RPAREN
| LPAREN postfix-abstract-declarator RPAREN
| LPAREN postfixing-abstract-declarator RPAREN
| LPAREN unary-abstract-declarator RPAREN postfixing-abstract-declarator
: TYPEDEFname CLCL STAR type-qualifier-list-opt
| AMPERSAND type-qualifier-list
The following expressions all have the usual C++ semantics:
: constant
| THIS
: OPERATOR operator-predefined
| OPERATOR basic-type-name
| OPERATOR LPAREN type-name RPAREN
: PLUS
| MINUS
| STAR
| ...
| DELETE
| COMMA
: [ type-qualifier-list ]
| primary-expression LBRACKET expression RBRACKET
| postfix-expression PARENS
| postfix-expression LPAREN argument-expression-list RPAREN
| postfix-expression LPAREN type-name-list RPAREN
| postfix-expression DOT id-expression
| postfix-expression ARROW id-expression
| postfix-expression INCR
| postfix-expression DECR
| TYPEDEFname LPAREN argument-expression-list RPAREN
| TYPEDEFname LPAREN type-name-list RPAREN
| basic-type-name LPAREN assignment-expression RPAREN
| type-name COMMA type-name-list
| type-name comma-opt-ellipsis
| ELLIPSIS
: ELLIPSIS
| TWIDDLE LPAREN cast-expression RPAREN
| SIZEOF LPAREN type-name RPAREN
: operator-new LPAREN type-name RPAREN operator-new-initializer
| operator-new LPAREN argument-expression-list RPAREN LPAREN type-name RPAREN operator-new-initializer
: NEW
: [ PARENS ]
| [ LPAREN argument-expression-list RPAREN ]
| LPAREN type-name RPAREN cast-expression
| DELETE deallocation-expression
| CLCL DELETE deallocation-expression
| DELETE BRACKETS deallocation-expression
| CLCL DELETE BRACKETS deallocation-expression
| point-member-expression DOTstar deallocation-expression
| point-member-expression ARROWstar deallocation-expression
| multiplicative-expression STAR point-member-expression
| multiplicative-expression SLASH point-member-expression
| multiplicative-expression MOD point-member-expression
| additive-expression PLUS multiplicative-expression
| additive-expression MINUS multiplicative-expression
| shift-expression LS additive-expression
| shift-expression RS additive-expression
| relational-expression LESS shift-expression
| relational-expression GREATER shift-expression
| relational-expression LE shift-expression
| relational-expression GE shift-expression
| equality-expression EQ relational-expression
| equality-expression NE relational-expression
| AND-expression AMPERSAND equality-expression
: AND-expression
| exclusive-OR-expression HAT AND-expression
: exclusive-OR-expression
| inclusive-OR-expression OR exclusive-OR-expression
: inclusive-OR-expression
| logical-AND-expression ANDAND inclusive-OR-expression
: logical-AND-expression
| logical-OR-expression OROR logical-AND-expression
: logical-AND-expression
| logical-AND-expression QUESTION expression COLON conditional-expression
| unary-expression ASSIGNOP assignment-expression
| unary-expression MULTassign assignment-expression
| unary-expression DIVassign assignment-expression
| unary-expression MODassign assignment-expression
| unary-expression PLUSassign assignment-expression
| unary-expression MINUSassign assignment-expression
| unary-expression LSassign assignment-expression
| unary-expression RSassign assignment-expression
| unary-expression ANDassign assignment-expression
| unary-expression ERassign assignment-expression
| unary-expression ORassign assignment-expression