Support TRACE() and TRACEMSG() on hosted targets.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 17 Feb 2006 22:28:37 +0000 (22:28 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 17 Feb 2006 22:28:37 +0000 (22:28 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@526 38d2e660-2303-0410-9eaa-f027e97ec537

cfg/debug.h

index fe8481f02f138ec9a2db4229276bc8e4d98ced26..6759344ce4da876730afd660ab31c7fa65e2aa56 100755 (executable)
@@ -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.
  *#*
                }
                /* 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 <assert.h>
                        #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.
                #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 <appconfig.h>  /* CONFIG_KDEBUG_ASSERT_NO_TEXT */