summaryrefslogtreecommitdiffstats
path: root/debug.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-10 10:15:48 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-10 10:15:48 +0000
commita98aeec6d0e5739ada471ece2b308ea787c3804a (patch)
treeab7d39306cf948f8580893803119c2501e1315c4 /debug.h
parentd5e7ec7a8382bef969e50e4a3f8c0155f6a27d3a (diff)
downloadrsyslog-a98aeec6d0e5739ada471ece2b308ea787c3804a.tar.gz
rsyslog-a98aeec6d0e5739ada471ece2b308ea787c3804a.tar.xz
rsyslog-a98aeec6d0e5739ada471ece2b308ea787c3804a.zip
bugfix: debug.c now survives module unloads in all cases tracker:
http://bugzilla.adiscon.com/show_bug.cgi?id=2
Diffstat (limited to 'debug.h')
-rw-r--r--debug.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/debug.h b/debug.h
index 27587bd8..4dcc593a 100644
--- a/debug.h
+++ b/debug.h
@@ -49,8 +49,8 @@ typedef struct dbgFuncDBmutInfoEntry_s {
typedef struct dbgFuncDB_s {
unsigned magic;
unsigned long nTimesCalled;
- const char *func;
- const char *file;
+ char *func;
+ char *file;
int line;
dbgFuncDBmutInfoEntry_t mutInfo[5];
/* remember to update the initializer if you add anything or change the order! */
@@ -92,7 +92,7 @@ int dbgMutexUnlock(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncD, int ln, int iStac
int dbgCondWait(pthread_cond_t *cond, pthread_mutex_t *pmut, dbgFuncDB_t *pFuncD, int ln, int iStackPtr);
int dbgCondTimedWait(pthread_cond_t *cond, pthread_mutex_t *pmut, const struct timespec *abstime, dbgFuncDB_t *pFuncD, int ln, int iStackPtr);
void dbgFree(void *pMem, dbgFuncDB_t *pFuncDB, int ln, int iStackPtr);
-int dbgEntrFunc(dbgFuncDB_t *pFuncDB, int line);
+int dbgEntrFunc(dbgFuncDB_t **ppFuncDB, const char *file, const char *func, int line);
void dbgExitFunc(dbgFuncDB_t *pFuncDB, int iStackPtrRestore, int iRet);
void dbgSetExecLocation(int iStackPtr, int line);
void dbgSetThrdName(uchar *pszName);
@@ -100,9 +100,9 @@ void dbgPrintAllDebugInfo(void);
/* macros */
#ifdef RTINST
-# define BEGINfunc static dbgFuncDB_t dbgFuncDB=dbgFuncDB_t_INITIALIZER; int dbgCALLStaCK_POP_POINT = dbgEntrFunc(&dbgFuncDB,__LINE__);
-# define ENDfunc dbgExitFunc(&dbgFuncDB, dbgCALLStaCK_POP_POINT, RS_RET_NO_IRET);
-# define ENDfuncIRet dbgExitFunc(&dbgFuncDB, dbgCALLStaCK_POP_POINT, iRet);
+# define BEGINfunc static dbgFuncDB_t *pdbgFuncDB; int dbgCALLStaCK_POP_POINT = dbgEntrFunc(&pdbgFuncDB, __FILE__, __func__, __LINE__);
+# define ENDfunc dbgExitFunc(pdbgFuncDB, dbgCALLStaCK_POP_POINT, RS_RET_NO_IRET);
+# define ENDfuncIRet dbgExitFunc(pdbgFuncDB, dbgCALLStaCK_POP_POINT, iRet);
# define ASSERT(x) assert(x)
#else
# define BEGINfunc
@@ -130,11 +130,11 @@ void dbgPrintAllDebugInfo(void);
/* debug aides */
#ifdef RTINST
-#define d_pthread_mutex_lock(x) dbgMutexLock(x, &dbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
-#define d_pthread_mutex_unlock(x) dbgMutexUnlock(x, &dbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
-#define d_pthread_cond_wait(cond, mut) dbgCondWait(cond, mut, &dbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
-#define d_pthread_cond_timedwait(cond, mut, to) dbgCondTimedWait(cond, mut, to, &dbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
-#define d_free(x) dbgFree(x, &dbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
+#define d_pthread_mutex_lock(x) dbgMutexLock(x, pdbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
+#define d_pthread_mutex_unlock(x) dbgMutexUnlock(x, pdbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
+#define d_pthread_cond_wait(cond, mut) dbgCondWait(cond, mut, pdbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
+#define d_pthread_cond_timedwait(cond, mut, to) dbgCondTimedWait(cond, mut, to, pdbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
+#define d_free(x) dbgFree(x, pdbgFuncDB, __LINE__, dbgCALLStaCK_POP_POINT )
#else
#define d_pthread_mutex_lock(x) pthread_mutex_lock(x)
#define d_pthread_mutex_unlock(x) pthread_mutex_unlock(x)