67 kill(getpid(), SIGTRAP);
69 cprintf(
"debug::breakpoint suppressed, compiled with NDEBUG\n");
79 static bool done =
false;
101 : _name(
name), _desc(desc)
106 panic_if(!result.second,
"Flag %s already defined!",
name);
133 :
Flag(
name, desc), _isFormat(is_format)
155 "Controls all debug flags. It should not be used within C++ code.", {})
162 _kids.push_back(flag);
207 using namespace debug;
208 FlagsMap::iterator
i = allFlags().begin();
209 FlagsMap::iterator end = allFlags().end();
210 for (;
i != end; ++
i) {
211 SimpleFlag *
f =
dynamic_cast<SimpleFlag *
>(
i->second);
212 if (
f &&
f->tracing())
static AllFlagsFlag & instance()
void add(SimpleFlag *flag)
std::vector< Flag * > _kids
static void globalEnable()
static bool _globalEnable
static void globalDisable()
Flag(const char *name, const char *desc)
bool isFormat() const
Checks whether this flag is a conventional debug flag, or a flag that modifies the way debug informat...
SimpleFlag(const char *name, const char *desc, bool is_format=false)
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
std::map< std::string, Flag * > FlagsMap
bool changeFlag(const char *s, bool value)
Flag * findFlag(const std::string &name)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
void setDebugFlag(const char *string)
void cprintf(const char *format, const Args &...args)
void clearDebugFlag(const char *string)
void dumpDebugFlags(std::ostream &os)
void ccprintf(cp::Print &print)
const std::string & name()