In general, C++View can be used with ReplayEngine just as with normal TotalView debugging. However, there are some differences you should be aware of. In both record mode and replay mode, TotalView switches your process into ReplayEngine’s
volatile mode before calling your
TV_ttf_display_type function. When the call finishes, TotalView switches the process out of volatile mode. On entering volatile mode, ReplayEngine saves the state of the process, and on exiting volatile mode, ReplayEngine restores the saved status.
In most cases, executing TV_ttf_display_type in volatile mode behaves as you would expect. However, because ReplayEngine restores the earlier process state when it leaves volatile mode, any changes to process memory, such as writing to a variable, made while in volatile mode are lost.
This fact has implications for your program if your TV_ttf_display_type function modifies global or static data upon which either the function or the program relies. If
TV_ttf_display_type does not change any global state, you will see no change in behavior when you engage ReplayEngine. However, if you generate synthetic values, such as the average, maximum or minimum values in an array, you cannot compute these in your
TV_ttf_display_type function as the results will be lost when the function call terminates. Instead, consider generating them as a by-product of the program’s normal execution as described in the section on
Memory Management.
The following code demonstrates how engaging ReplayEngine might affect calls to TV_ttf_display_type. This example is shipped with the ReplayEngine example files as
cppview_example_5.cc.