83 void assert(
const char* file,
125 printf(
PSTR(
"Debug::observe_at:%s:%d:%S="), func, line, expr);
186 void run(
const char* file =
NULL,
188 const char* func =
NULL,
191 #if !defined(COSA_DEBUG_NO_BACKTRACE) 199 #if !defined(COSA_DEBUG_NO_HELP) 206 #if !defined(COSA_DEBUG_NO_LOOKUP_VARIABLES) 215 #if !defined(COSA_DEBUG_NO_MEMORY_USAGE) 223 #if !defined(COSA_DEBUG_NO_PRINT_DATA) 230 #if !defined(COSA_DEBUG_NO_PRINT_HEAP) 237 #if !defined(COSA_DEBUG_NO_PRINT_STACK) 244 #if !defined(COSA_DEBUG_NO_PRINT_VARIABLES) 259 #if !defined(COSA_DEBUG_NO_QUIT) 280 #define DEBUG_STREAM(dev) \ 282 debug.begin(&dev, __FILE__,__LINE__, __PRETTY_FUNCTION__); \ 294 #define ASSERT(cond) \ 296 if (UNLIKELY(!(cond))) \ 297 debug.assert(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 306 #define BREAKPOINT() \ 308 debug.break_at(__FILE__,__LINE__, __PRETTY_FUNCTION__, NULL); \ 317 #define BREAK_IF(cond) \ 319 if (UNLIKELY(cond)) \ 320 debug.break_at(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 328 #define CHECK_STACK(room) \ 330 if (UNLIKELY(!(debug.check_stack(room)))) \ 331 debug.assert(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 332 __PSTR("check_stack()")); \ 341 #define OBSERVE_IF(cond,expr) \ 343 if (UNLIKELY(cond)) { \ 344 debug.observe_at(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 355 #define OBSERVE(expr) OBSERVE_IF(expr,true) 363 #define REGISTER(var) \ 364 Debug::Variable debug__ ## var(__PRETTY_FUNCTION__, \ 372 #define ASSERT(cond) do { if (!(cond)) exit(0); } while (0) 375 #define BREAK_IF(cond) 376 #define CHECK_STACK(room) 377 #define DEBUG_STREAM(dev) 378 #define OBSERVE_IF(cond,expr) 379 #define OBSERVE(expr) 380 #define REGISTER(var)
void run(const char *file=NULL, int line=0, const char *func=NULL, str_P expr=NULL)
void do_print_stack(int marker)
bool check_stack(int room=128)
void observe_at(const char *file, int line, const char *func, str_P expr)
void do_print_variables()
const char * m_func
Registered in function.
char EXITCHARACTER
Character to emit on exit.
void do_backtrace(const char *func)
void assert(const char *file, int line, const char *func, str_P cond)
void printf(str_P format,...)
bool begin(IOStream::Device *dev, const char *file, int line, const char *func)
Variable * m_var
Last registered variable.
const class prog_str * str_P
void do_memory_usage(int marker)
int DATAEND
End of data segment.
void break_at(const char *file, int line, const char *func, str_P cond)
Variable(const char *func, str_P name, void *ref, size_t size)
int DATASIZE
Size of data segment.
void * m_ref
Variable value reference.
bool do_lookup_variables(const char *name)
size_t m_size
Variable value size.
class Variable * m_next
Next variable.
str_P m_name
Function name.