Browse code

script engine: better debugging info

Andrei Pelinescu-Onciul authored on 11/12/2008 18:27:24
Showing 1 changed files
... ...
@@ -296,13 +296,14 @@ static int exp_optimize_left(struct expr* exp)
296 296
 {
297 297
 	struct rval_expr* rve;
298 298
 	struct rvalue* rval;
299
-	int old_type, old_op;
299
+	int old_ltype, old_rtype, old_op;
300 300
 	int ret;
301 301
 	
302 302
 	ret=0;
303 303
 	if (exp->type!=ELEM_T)
304 304
 		return 0;
305
-	old_type=exp->l_type;
305
+	old_ltype=exp->l_type;
306
+	old_rtype=exp->r_type;
306 307
 	old_op=exp->op;
307 308
 	if (exp->l_type==RVEXP_O){
308 309
 		rve=exp->l.param;
... ...
@@ -385,8 +386,8 @@ static int exp_optimize_left(struct expr* exp)
385 385
 		}
386 386
 	}
387 387
 	if (ret>0)
388
-		DBG("left EXP optimized succesfully: %d op %d to %d op %d\n",
389
-			old_type, old_op, exp->l_type, exp->op);
388
+		DBG("left EXP optimized: op%d(_O%d_, ST%d) => op%d(_O%d_, ST%d)\n",
389
+			old_op, old_ltype, old_rtype, exp->op, exp->l_type, exp->r_type);
390 390
 	return ret;
391 391
 }
392 392
 
... ...
@@ -399,13 +400,14 @@ static int exp_optimize_right(struct expr* exp)
399 399
 {
400 400
 	struct rval_expr* rve;
401 401
 	struct rvalue* rval;
402
-	int old_type, old_op;
402
+	int old_ltype, old_rtype, old_op;
403 403
 	int ret;
404 404
 	
405 405
 	ret=0;
406 406
 	if ((exp->type!=ELEM_T) ||(exp->op==NO_OP))
407 407
 		return 0;
408
-	old_type=exp->r_type;
408
+	old_ltype=exp->l_type;
409
+	old_rtype=exp->r_type;
409 410
 	old_op=exp->op;
410 411
 	if (exp->r_type==RVE_ST){
411 412
 		rve=exp->r.param;
... ...
@@ -481,8 +483,8 @@ static int exp_optimize_right(struct expr* exp)
481 481
 		}
482 482
 	}
483 483
 	if (ret>0)
484
-		DBG("right EXP optimized succesfully: %d op %d to %d op %d\n",
485
-			old_type, old_op, exp->r_type, exp->op);
484
+		DBG("right EXP optimized: op%d(O%d, _ST%d_) => op%d(O%d, _ST%d_)\n",
485
+			old_op, old_ltype, old_rtype, exp->op, exp->l_type, exp->r_type);
486 486
 	return ret;
487 487
 }
488 488