different debug


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@780 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1fix/asn1fix.c b/libasn1fix/asn1fix.c
index cb7128c..509a0c2 100644
--- a/libasn1fix/asn1fix.c
+++ b/libasn1fix/asn1fix.c
@@ -347,7 +347,7 @@
 		etype = top_parent->expr_type;
 	else	etype = A1TC_INVALID;
 
-	DEBUG("asn1f_resolve_constraints(%s)", arg->expr->Identifier);
+	DEBUG("(%s)", arg->expr->Identifier);
 
 	ret = asn1constraint_resolve(arg, arg->expr->module,
 		arg->expr->constraints, etype, 0);
@@ -367,7 +367,7 @@
 	int rvalue = 0;
 	int ret;
 
-	DEBUG("asn1f_check_constraints(%s{%d/%d})",
+	DEBUG("(%s{%d/%d})",
 		arg->expr->Identifier,
 		arg->expr->meta_type, arg->expr->expr_type);
 
diff --git a/libasn1fix/asn1fix_bitstring.c b/libasn1fix/asn1fix_bitstring.c
index 4ef945d..8297f27 100644
--- a/libasn1fix/asn1fix_bitstring.c
+++ b/libasn1fix/asn1fix_bitstring.c
@@ -13,8 +13,7 @@
 	if(expr->meta_type == AMT_VALUE) {
 		asn1p_expr_t *ttype;
 
-		DEBUG("%s(%s) for line %d", __func__,
-			expr->Identifier, expr->_lineno);
+		DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno);
 
 		ttype = asn1f_find_terminal_type(arg, expr);
 		if(ttype && ttype->expr_type == ASN_BASIC_BIT_STRING) {
@@ -31,7 +30,7 @@
 	asn1p_expr_t *expr = arg->expr;
 	int r_value = 0;
 
-	DEBUG("%s(%s) for line %d", __func__,
+	DEBUG("(%s) for line %d",
 		expr->Identifier, expr->_lineno);
 
 	switch(expr->value->type) {
diff --git a/libasn1fix/asn1fix_class.c b/libasn1fix/asn1fix_class.c
index a764f1a..3542e0c 100644
--- a/libasn1fix/asn1fix_class.c
+++ b/libasn1fix/asn1fix_class.c
@@ -32,9 +32,7 @@
 
 	assert(ref->comp_count > 1);
 
-	DEBUG("%s(%s) for line %d", __func__,
-		asn1f_printable_reference(ref),
-		ref->_lineno);
+	DEBUG("(%s) for line %d", asn1f_printable_reference(ref), ref->_lineno);
 
 	/*
 	 * Fetch the first part of the reference (OBJECT or ObjectSet).
diff --git a/libasn1fix/asn1fix_compat.c b/libasn1fix/asn1fix_compat.c
index aef26c0..2efa8e8 100644
--- a/libasn1fix/asn1fix_compat.c
+++ b/libasn1fix/asn1fix_compat.c
@@ -13,7 +13,7 @@
 	atype = a->expr_type;
 	btype = b->expr_type;
 
-	DEBUG("%s(%s:%x@%d, %s:%x@%d)", __func__,
+	DEBUG("(%s:%x@%d, %s:%x@%d)",
 		a->Identifier, atype, a->_lineno,
 		b->Identifier, btype, b->_lineno);
 
diff --git a/libasn1fix/asn1fix_constr.c b/libasn1fix/asn1fix_constr.c
index 79fd0d8..794845b 100644
--- a/libasn1fix/asn1fix_constr.c
+++ b/libasn1fix/asn1fix_constr.c
@@ -104,8 +104,7 @@
 		return 0;
 	}
 
-	DEBUG("%s(%s) for line %d", __func__,
-		expr->Identifier, expr->_lineno);
+	DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno);
 
 	TQ_INIT(&root_list);
 	TQ_INIT(&ext_list);
@@ -181,8 +180,7 @@
 	int component_number = 0;
 	int r_value = 0;
 
-	DEBUG("%s(%s) for line %d", __func__,
-		expr->Identifier, expr->_lineno);
+	DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno);
 
 	/*
 	 * Fix the top-level type itself first.
@@ -296,8 +294,7 @@
 		return 0;
 	}
 
-	DEBUG("%s(%s) for line %d", __func__,
-		expr->Identifier, expr->_lineno);
+	DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno);
 
 	TQ_FOR(v, &(expr->members), next) {
 		int must_explicit;
diff --git a/libasn1fix/asn1fix_constraint.c b/libasn1fix/asn1fix_constraint.c
index 9a32b49..441a9fb 100644
--- a/libasn1fix/asn1fix_constraint.c
+++ b/libasn1fix/asn1fix_constraint.c
@@ -124,6 +124,8 @@
 	int rvalue = 0;
 	int ret;
 
+	DEBUG("%s", arg->expr->Identifier);
+
 	if(!ct) return 0;
 
 	/* Don't touch information object classes */
diff --git a/libasn1fix/asn1fix_cstring.c b/libasn1fix/asn1fix_cstring.c
index 9cbb42c..215336b 100644
--- a/libasn1fix/asn1fix_cstring.c
+++ b/libasn1fix/asn1fix_cstring.c
@@ -17,8 +17,7 @@
 		int buflen = expr->value->value.string.size;
 		int start = 0;
 
-		DEBUG("%s(%s) for line %d", __func__,
-			expr->Identifier, expr->_lineno);
+		DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno);
 
 		while(_asn1f_cstring_find_line_pattern(buf + start, &cp)) {
 			assert(cp.length);
diff --git a/libasn1fix/asn1fix_dereft.c b/libasn1fix/asn1fix_dereft.c
index 352df7b..19af0e8 100644
--- a/libasn1fix/asn1fix_dereft.c
+++ b/libasn1fix/asn1fix_dereft.c
@@ -15,8 +15,8 @@
 		return 0;	/* Just ignore it */
 	}
 
-	DEBUG("%s(\"%s\":%x ::= \"%s\") for line %d",
-		__func__, expr->Identifier, expr->expr_type,
+	DEBUG("(\"%s\":%x ::= \"%s\") for line %d",
+		expr->Identifier, expr->expr_type,
 		asn1f_printable_value(expr->value),
 		expr->_lineno);
 
diff --git a/libasn1fix/asn1fix_enum.c b/libasn1fix/asn1fix_enum.c
index d0c0f25..ce2fc2f 100644
--- a/libasn1fix/asn1fix_enum.c
+++ b/libasn1fix/asn1fix_enum.c
@@ -15,7 +15,7 @@
 	if(expr->expr_type != ASN_BASIC_ENUMERATED)
 		return 0;	/* Just ignore it */
 
-	DEBUG("%s(%s)", __func__, expr->Identifier);
+	DEBUG("(%s)", expr->Identifier);
 
 	/*
 	 * 1. Scan the enumeration values in search for inconsistencies.
diff --git a/libasn1fix/asn1fix_integer.c b/libasn1fix/asn1fix_integer.c
index 729d1e3..e0304bd 100644
--- a/libasn1fix/asn1fix_integer.c
+++ b/libasn1fix/asn1fix_integer.c
@@ -23,7 +23,7 @@
 	if(expr->expr_type != ASN_BASIC_INTEGER)
 		return 0;	/* Just ignore it */
 
-	DEBUG("%s(\"%s\", %x) for line %d", __func__,
+	DEBUG("(\"%s\", %x) for line %d",
 		expr->Identifier, expr->expr_type, expr->_lineno);
 
 	/*
diff --git a/libasn1fix/asn1fix_internal.h b/libasn1fix/asn1fix_internal.h
index d4a5e84..9ca2904 100644
--- a/libasn1fix/asn1fix_internal.h
+++ b/libasn1fix/asn1fix_internal.h
@@ -104,8 +104,9 @@
 		int _save_errno = errno;			\
 		if(code < 0) {					\
 			if(arg->debug)				\
-			arg->debug(code, fmt " in %s (%s:%d)",	\
-				##args,				\
+				arg->debug(code,		\
+				"%s: " fmt " in %s (%s:%d)",	\
+				__func__, ##args,		\
 				arg->mod->source_file_name,	\
 				__FILE__, __LINE__);		\
 		} else if(arg->eh) {				\
diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c
index 134d504..3fdaf30 100644
--- a/libasn1fix/asn1fix_param.c
+++ b/libasn1fix/asn1fix_param.c
@@ -15,8 +15,8 @@
 	assert(expr->expr_type == A1TC_PARAMETRIZED);
 	assert(expr->reference);
 
-	DEBUG("%s(\"%s\" ::= \"%s\" { %s }) for line %d",
-		__func__, expr->Identifier,
+	DEBUG("(\"%s\" ::= \"%s\" { %s }) for line %d",
+		expr->Identifier,
 		asn1f_printable_reference(expr->reference),
 		asn1f_printable_value(expr->value),
 		expr->_lineno);
diff --git a/libasn1fix/asn1fix_retrieve.c b/libasn1fix/asn1fix_retrieve.c
index 4e0eee9..cbf6bae 100644
--- a/libasn1fix/asn1fix_retrieve.c
+++ b/libasn1fix/asn1fix_retrieve.c
@@ -152,7 +152,7 @@
 	 * All other forms are not implemented at this moment.
 	 */
 
-	DEBUG("%s(%s) in %s for line %d", __func__,
+	DEBUG("(%s) in %s for line %d",
 		asn1f_printable_reference(ref),
 		mod->Identifier,
 		ref->_lineno);
@@ -292,8 +292,8 @@
 		ref = expr->reference;
 	}
 
-	DEBUG("%s:%s(%s->%s) for line %d",
-		__func__, type_or_value?"VALUE":"TYPE",
+	DEBUG("%s(%s->%s) for line %d",
+		type_or_value?"VALUE":"TYPE",
 		expr->Identifier, asn1f_printable_reference(ref),
 		expr->_lineno);
 
diff --git a/libasn1fix/asn1fix_value.c b/libasn1fix/asn1fix_value.c
index ab7e9a3..c40d58a 100644
--- a/libasn1fix/asn1fix_value.c
+++ b/libasn1fix/asn1fix_value.c
@@ -16,14 +16,14 @@
 	if(expr->value->type != ATV_REFERENCED)
 		return 0;
 
-	DEBUG("%s(=\"%s\", %x)", __func__,
+	DEBUG("(=\"%s\", %x)",
 		asn1f_printable_value(expr->value), expr->expr_type);
 
 	/*
 	 * 1. Find the terminal type for this assignment.
 	 */
 	type_expr = asn1f_find_terminal_type(arg, expr);
-	DEBUG("%s(): terminal type %p", __func__, type_expr);
+	DEBUG("terminal type %p", type_expr);
 	if(type_expr == 0) {
 		FATAL("Terminal type for is %s not found", expr->Identifier);
 		return -1;
@@ -148,7 +148,7 @@
 	&& type_expr->expr_type != ASN_BASIC_ENUMERATED)
 		return 0;
 
-	DEBUG("%s(for %s in %s %x) for line %d", __func__,
+	DEBUG("(for %s in %s %x) for line %d",
 		asn1f_printable_value(value_expr->value),
 		type_expr->Identifier,
 		type_expr->expr_type,