Using Qtenv with a Debugger

You can use Qtenv 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.

Qtenv 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 Qtenv GUI.

The second consequence is that suspending the simulation program in a debugger will also freeze the GUI until it is resumed. Also, Qtenv is 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 Qtenv UI deals with cObjects (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 Qtenv. You may wrap objects into cObjects to make them visible for Qtenv, that's what e.g. the WATCH macros do as well.

The following sections go into detail about various parts and functions of the Qtenv UI.