Expression Evaluation with ReplayEngine
When you enable ReplayEngine, you still have the ability to evaluate expressions, but the behavior is different. In regular, forward debugging, your expression may change the state of your program, for example, by changing the value of a variable. But when ReplayEngine is enabled, expression evaluation takes place in a separate, temporary space, and the results have no side effects in your program. When the evaluation is complete, the temporary space is released and any changes resulting from the evaluation no longer exist.
This is important to remember if you are actually counting on an expression evaluation to change something in your program. Note, too, that this is true even when ReplayEngine is in Record mode. If you want to regain the ability to affect your program state through expressions, you need to disable ReplayEngine.
With ReplayEngine enabled and in Record mode, there are still two ways to change memory or registers: with the CLI dassign command, and by directly editing the value in the TotalView user interface. However, an attempt to modify memory or registers in this way in Replay mode results in an error or the new value being discarded.
Expressions can call functions when ReplayEngine is enabled, but if the called function stops for any reason, for example, hits a breakpoint or receives a signal, the expression is suspended and limitations are imposed. You can continue to debug forward in a function called from an expression, but you cannot debug backwards until the expression evaluation is complete. Using an expression to write to stdout and stderr (file descriptors 1 and 2) is allowed with the following limitations: Writes to those file descriptors work for any type of file in Record mode. However, writes to those file descriptors fail in Playback mode unless the file is a TTY.
All of the above also applies to the transformations in C++View.