Module: sip-router
Branch: master
Commit: d1e456b251602e1336e4dbede1e9f8b5d1c19415
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d1e456b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Sep 17 14:47:49 2013 +0200
debugger: new parameter cfgpkgcheck to do pkg memory check before each action
---
modules/debugger/debugger_api.c | 16 ++++++++++++++++
modules/debugger/debugger_mod.c | 2 ++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/modules/debugger/debugger_api.c b/modules/debugger/debugger_api.c
index 7a11631..56d2975 100644
--- a/modules/debugger/debugger_api.c
+++ b/modules/debugger/debugger_api.c
@@ -152,6 +152,11 @@ int _dbg_cfgtrace = 0;
/**
*
*/
+int _dbg_cfgpkgcheck = 0;
+
+/**
+ *
+ */
int _dbg_breakpoint = 0;
/**
@@ -302,6 +307,17 @@ int dbg_cfg_trace(void *data)
an = dbg_get_action_name(a);
+ if(_dbg_cfgpkgcheck!=0)
+ {
+#ifdef q_malloc_h
+ LM_DBG("checking pkg memory before action %.*s (line %d)\n",
+ an->len, an->s, a->cline);
+ qm_check(mem_block);
+#else
+ LM_DBG("cfg pkg check is disbled due to missing qm handler\n");
+#endif
+ }
+
if(_dbg_pid_list[process_no].set&DBG_CFGTRACE_ON)
{
if(is_printable(_dbg_cfgtrace_level))
diff --git a/modules/debugger/debugger_mod.c b/modules/debugger/debugger_mod.c
index 87724ce..2f0caa7 100644
--- a/modules/debugger/debugger_mod.c
+++ b/modules/debugger/debugger_mod.c
@@ -53,6 +53,7 @@ static int w_dbg_dump(struct sip_msg* msg, char* mask, char* level);
/* parameters */
extern int _dbg_cfgtrace;
+extern int _dbg_cfgpkgcheck;
extern int _dbg_breakpoint;
extern int _dbg_cfgtrace_level;
extern int _dbg_cfgtrace_facility;
@@ -89,6 +90,7 @@ static param_export_t params[]={
{"mod_level_mode", INT_PARAM, &default_dbg_cfg.mod_level_mode},
{"mod_level", STR_PARAM|USE_FUNC_PARAM, (void*)dbg_mod_level_param},
{"reset_msgid", INT_PARAM, &_dbg_reset_msgid},
+ {"cfgpkgcheck", INT_PARAM, &_dbg_cfgpkgcheck},
{0, 0, 0}
};