summaryrefslogtreecommitdiffstats
path: root/debug.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-22 20:25:48 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-22 20:25:48 +0000
commit3ab9ce1b9f30e901735576a4c89faf4521d4b08e (patch)
tree6fc1b45987d5df74a07e9b5572771d964d2b5d3a /debug.h
parent6ba75629051613c43b5d7cbc937a8243b250886c (diff)
downloadrsyslog-3ab9ce1b9f30e901735576a4c89faf4521d4b08e.tar.gz
rsyslog-3ab9ce1b9f30e901735576a4c89faf4521d4b08e.tar.xz
rsyslog-3ab9ce1b9f30e901735576a4c89faf4521d4b08e.zip
added thread-specific call stack to debug interface
Diffstat (limited to 'debug.h')
-rw-r--r--debug.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/debug.h b/debug.h
index ae079310..ecc599e1 100644
--- a/debug.h
+++ b/debug.h
@@ -30,7 +30,26 @@ extern int Debug; /* debug flag - read-only after startup */
extern int debugging_on; /* read-only, except on sig USR1 */
/* prototypes */
+rsRetVal dbgClassInit(void);
void sigsegvHdlr(int signum);
void dbgprintf(char *fmt, ...) __attribute__((format(printf,1, 2)));
+void dbgEntrFunc(char* file, int line, const char* func);
+void dbgExitFunc(char* file, int line, const char* func);
+
+/* macros */
+#if 1 /* DEV debug: set to 1 to get a rough call trace -- rgerhards, 2008-01-13 */
+# define BEGINfunc dbgEntrFunc(__FILE__, __LINE__, __func__);
+# define ENDfunc dbgExitFunc(__FILE__, __LINE__, __func__);
+#else
+# define BEGINfunc
+# define ENDfunc
+#endif
+#if 1 /* DEV debug: set to 1 to enable -- rgerhards, 2008-01-13 */
+# define RUNLOG dbgprintf("%s:%d: %s: log point\n", __FILE__, __LINE__, __func__)
+# define RUNLOG_VAR(fmt, x) dbgprintf("%s:%d: %s: var '%s'[%s]: " fmt "\n", __FILE__, __LINE__, __func__, #x, fmt, x)
+#else
+# define RUNLOG
+# define RUNLOG_VAR(x)
+#endif
#endif /* #ifndef DEBUG_H_INCLUDED */