25 #define UNUSED(x) (void) (x) 29 #define UNLIKELY(x) __builtin_expect((x), false) 32 typedef const class __FlashStringHelper*
str_P;
76 bool begin(Stream* dev,
90 void assert(
const char* file,
171 void print(
bool is_pointer =
false);
195 void dump(uint16_t src,
const void *ptr,
size_t size);
204 void run(
const char* file = NULL,
206 const char* func = NULL,
209 #if !defined(DEBUG_NO_BACKTRACE) 217 #if !defined(DEBUG_NO_LOOKUP_VARIABLES) 227 #if !defined(DEBUG_NO_MEMORY_USAGE) 235 #if !defined(DEBUG_NO_PRINT_COMMANDS) 242 #if !defined(DEBUG_NO_PRINT_DATA) 249 #if !defined(DEBUG_NO_PRINT_HEAP) 256 #if !defined(DEBUG_NO_PRINT_STACK) 263 #if !defined(DEBUG_NO_PRINT_VARIABLES) 278 #if !defined(DEBUG_NO_QUIT) 299 #define DEBUG_STREAM(dev) \ 301 debug.begin(&dev, __FILE__,__LINE__, __PRETTY_FUNCTION__); \ 313 #define ASSERT(cond) \ 315 if (UNLIKELY(!(cond))) \ 316 debug.assert(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 325 #define BREAKPOINT() \ 327 debug.break_at(__FILE__,__LINE__, __PRETTY_FUNCTION__, NULL); \ 336 #define BREAK_IF(cond) \ 338 if (UNLIKELY(cond)) \ 339 debug.break_at(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 347 #define CHECK_STACK(room) \ 349 if (UNLIKELY(!(debug.check_stack(room)))) \ 350 debug.assert(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 351 F("check_stack()")); \ 360 #define OBSERVE_IF(cond,expr) \ 362 if (UNLIKELY(cond)) { \ 363 debug.observe_at(__FILE__,__LINE__, __PRETTY_FUNCTION__, \ 365 debug.println(expr); \ 373 #define OBSERVE(expr) OBSERVE_IF(true,expr) 381 #define REGISTER(var) \ 382 Debug::Variable debug__ ## var(__PRETTY_FUNCTION__, \ 390 #define ASSERT(cond) do { if (!(cond)) exit(0); } while (0) 393 #define BREAK_IF(cond) 394 #define CHECK_STACK(room) 395 #define DEBUG_STREAM(dev) 396 #define OBSERVE_IF(cond,expr) 397 #define OBSERVE(expr) 398 #define REGISTER(var)
const class __FlashStringHelper * str_P
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.
bool begin(Stream *dev, const char *file, int line, const char *func)
void do_backtrace(const char *func)
void assert(const char *file, int line, const char *func, str_P cond)
Variable * m_var
Last registered variable.
void print(bool is_pointer=false)
void dump(uint16_t src, const void *ptr, size_t size)
Stream * m_dev
Debug stream.
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, bool is_pointer=false)
virtual size_t write(uint8_t c)
size_t m_size
Variable value size.
virtual int available(void)
class Variable * m_next
Next variable.
str_P m_name
Function name.