Class DebugManager#
Defined in File DebugManager.h
Class Documentation#
-
class DebugManager#
A structure to hold variables that are useful for debugging.
Public Static Functions
-
static bool isExiting()#
Returns true once any of the BaseContainer at exit callbacks begin to execute.
- Returns:
True any of the BaseContainer atExit functions are running due to program shutdown.
-
static bool getUsageTrackingErrors()#
Get the value of usage tracking errors.
Usage tracking errors is used to enable/disable error messages when discarding variables. If true, it will print errors if the variable if still in use. If false, it will only print a warning, but will continue on anyway.
- Returns:
Whether usage tracking errors is enabled or disabled.
-
static void setUsageTrackingErrors(bool enable)#
Set the value of usage tracking errors.
Usage tracking errors is used to enable/disable error messages when discarding variables. If true, it will print errors if the variable if still in use. If false, it will only print a warning, but will continue on anyway.
- Parameters:
enable – If true, then enable usage tracking errors. If false, then disable it.
-
static std::vector<ks_ptr<const Base>> inUseBy(const ks_ptr<Base> &base)#
Return the list of Base objects that are using the provided one.
The list includes objects that are referring to this object, but not ones that will remove the reference if this object were discarded. The purpose of this method is to catch commonly occurring dependencies that will get in the way of discarding this object.
- Parameters:
base – The object to get the list of objects that depend upon it.
- Returns:
List of objects that depend on this one.
-
static void dumpInUseBy(const ks_ptr<Base> &base)#
Display the list of Base objects that are using this one.
- Parameters:
base – Base object to dump users of.
-
static void dumpDependencyTree(const ks_ptr<LockingBase> &locking_base, std::string_view prefix = "", int depth = -1, bool downstream = true)#
Display the dependency tree for the provided LockingBase.
- Parameters:
locking_base – The LockingBase to display the dependency tree for.
prefix – Optional prefix to add to each line.
depth – Depth to traverse (default -1 means no limit).
downstream – Whether to show downstream (true) or upstream (false) dependencies.
-
static void dumpDependencyGraphviz(const ks_ptr<LockingBase> &locking_base, const std::filesystem::path &filename, const std::vector<ks_ptr<LockingBase>> &terminal = {}, int downstream_depth = -1, int upstream_depth = -1)#
Create a Graphviz dot file representing the dependency graph.
- Parameters:
locking_base – The LockingBase to display the dependency graph for.
filename – Output filename.
terminal – Nodes to be considered as terminal nodes (stop created graph on current branch if one of these is reached).
downstream_depth – Max depth for downstream traversal.
upstream_depth – Max depth for upstream traversal.
-
static const std::vector<ks_ptr<LockingBase>> &getDownstreamDeps(const ks_ptr<LockingBase> &locking_base)#
Get the downstream dependencies of the provided LockingBase.
- Parameters:
locking_base – The LockingBase to get the dependencies of.
- Returns:
A vector of downstream dependencies
Public Static Attributes
-
static std::optional<size_t> all_destroyed_message_limit#
Limit for the number of messages printed by all destroyed. Nullopt will print them all.
-
static bool enable_locking_trace#
Boolean used to enable/disable tracing of LockingBase. Enabling this will print messages whenever a LockingBase is made healthy or not healthy. It will also print messages when new dependents are added. This affects all LockingBases.
-
static bool catch_discard_errors_at_exit#
Boolean used to enable/disable discard errors at exit.
In most cases, discard issues at program exit are not an issue, as things like circular references will be cleaned up when the program virtual memory is torn down. However, there are times when we want this to be done cleanly. Setting this to true will catch discard errors at exit. The default is false, which will ignore them.
Note, this will not ignore all discard errors at exit. Only those registered by the Sim class.
Friends
- friend class UsageTrackingMap
-
static bool isExiting()#