[SR-Dev] git:andrei/script_vars: script engine: better debugging info

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Dec 11 19:42:33 CET 2008


Module: sip-router
Branch: andrei/script_vars
Commit: 5377c1fe88a9010c55cdf2b695a25b340518daf7
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5377c1fe88a9010c55cdf2b695a25b340518daf7

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Thu Dec 11 19:27:24 2008 +0100

script engine: better debugging info

---

 route.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/route.c b/route.c
index a36483b..4164284 100644
--- a/route.c
+++ b/route.c
@@ -296,13 +296,14 @@ static int exp_optimize_left(struct expr* exp)
 {
 	struct rval_expr* rve;
 	struct rvalue* rval;
-	int old_type, old_op;
+	int old_ltype, old_rtype, old_op;
 	int ret;
 	
 	ret=0;
 	if (exp->type!=ELEM_T)
 		return 0;
-	old_type=exp->l_type;
+	old_ltype=exp->l_type;
+	old_rtype=exp->r_type;
 	old_op=exp->op;
 	if (exp->l_type==RVEXP_O){
 		rve=exp->l.param;
@@ -385,8 +386,8 @@ static int exp_optimize_left(struct expr* exp)
 		}
 	}
 	if (ret>0)
-		DBG("left EXP optimized succesfully: %d op %d to %d op %d\n",
-			old_type, old_op, exp->l_type, exp->op);
+		DBG("left EXP optimized: op%d(_O%d_, ST%d) => op%d(_O%d_, ST%d)\n",
+			old_op, old_ltype, old_rtype, exp->op, exp->l_type, exp->r_type);
 	return ret;
 }
 
@@ -399,13 +400,14 @@ static int exp_optimize_right(struct expr* exp)
 {
 	struct rval_expr* rve;
 	struct rvalue* rval;
-	int old_type, old_op;
+	int old_ltype, old_rtype, old_op;
 	int ret;
 	
 	ret=0;
 	if ((exp->type!=ELEM_T) ||(exp->op==NO_OP))
 		return 0;
-	old_type=exp->r_type;
+	old_ltype=exp->l_type;
+	old_rtype=exp->r_type;
 	old_op=exp->op;
 	if (exp->r_type==RVE_ST){
 		rve=exp->r.param;
@@ -481,8 +483,8 @@ static int exp_optimize_right(struct expr* exp)
 		}
 	}
 	if (ret>0)
-		DBG("right EXP optimized succesfully: %d op %d to %d op %d\n",
-			old_type, old_op, exp->r_type, exp->op);
+		DBG("right EXP optimized: op%d(O%d, _ST%d_) => op%d(O%d, _ST%d_)\n",
+			old_op, old_ltype, old_rtype, exp->op, exp->l_type, exp->r_type);
 	return ret;
 }
 




More information about the sr-dev mailing list