You can use Tkenv together with a C++ debugger, which is mainly useful when developing new models. When you do that, there are a few things you need to know.
Tkenv is a library that runs as part of the simulation program. This has a lot of implications, the most apparent being that when the simulation crashes (due to a bug in the model's C++ code), it will bring down the whole OS process, including the Tkenv GUI.
The second consequence is that suspending the simulation program in a debugger will also freeze the GUI until it is resumed. Also, Tkenv is also single-theaded and runs in the same thread as the simulation program, so even if you only suspend the simulation's thread in the debugger, the UI will freeze.
The Tkenv UI deals with cObject
s (the C++ methods that the GUI relies
on are defined on cObject
). All other data such as primitive variables,
non-cObject classes and structs, STL containers etc, are hidden from Tkenv.
You may wrap objects into cObjects to make them visible for Tkenv, that's what
e.g. the WATCH macros do as well.
The following sections go into detail about various parts and functions of the Tkenv UI.