From a752a7f1f54337c746d0f2afc0d4df3da6c13caf Mon Sep 17 00:00:00 2001 From: bernie Date: Fri, 17 Feb 2006 22:28:37 +0000 Subject: [PATCH] Support TRACE() and TRACEMSG() on hosted targets. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@526 38d2e660-2303-0410-9eaa-f027e97ec537 --- cfg/debug.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cfg/debug.h b/cfg/debug.h index fe8481f0..6759344c 100755 --- a/cfg/debug.h +++ b/cfg/debug.h @@ -17,6 +17,9 @@ /*#* *#* $Log$ + *#* Revision 1.6 2006/02/17 22:28:37 bernie + *#* Support TRACE() and TRACEMSG() on hosted targets. + *#* *#* Revision 1.5 2005/11/04 16:09:03 bernie *#* Doxygen workaround. *#* @@ -178,12 +181,14 @@ } /* G++ can't inline functions with variable arguments... */ #define kprintf(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) + #define kvprintf(fmt, ap) vfprintf(stderr, fmt, ap) void kdump(const void *buf, size_t len); /* UNIMPLEMENTED */ #ifndef ASSERT #include #define ASSERT(x) assert(x) #endif /* ASSERT */ + #define ASSERT2(x, help) ASSERT(help && x) /*! * Check that the given pointer is not NULL or pointing to raw memory. @@ -195,6 +200,15 @@ #define ASSERT_VALID_PTR(p) ASSERT((unsigned long)(p) > 0x200) #define ASSERT_VALID_PTR_OR_NULL(p) ASSERT((((p) == NULL) || ((unsigned long)(p) >= 0x200))) + + #if !CONFIG_KDEBUG_DISABLE_TRACE + #define TRACE kporintf("%s()\n", __func__) + #define TRACEMSG(msg,...) kprintf("%s(): " msg, __func__, ## __VA_ARGS__) + #else + #define TRACE do {} while(0) + #define TRACEMSG(...) do {} while(0) + #endif + #else /* !OS_HOSTED */ #include /* CONFIG_KDEBUG_ASSERT_NO_TEXT */ -- 2.25.1