more debugging

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1355 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/skeletons/per_support.c b/skeletons/per_support.c
index 9406d96..e572fa8 100644
--- a/skeletons/per_support.c
+++ b/skeletons/per_support.c
@@ -7,6 +7,20 @@
 #include <asn_internal.h>
 #include <per_support.h>
 
+char *
+per_data_string(asn_per_data_t *pd) {
+	static char buf[2][32];
+	static int n;
+	n = (n+1) % 2;
+	snprintf(buf[n], sizeof(buf),
+		"{m=%d span %+d[%d..%d] (%d)}",
+		pd->moved,
+		(((int)pd->buffer) & 0xf),
+		pd->nboff, pd->nbits,
+		pd->nbits - pd->nboff);
+	return buf[n];
+}
+
 void
 per_get_undo(asn_per_data_t *pd, int nbits) {
 	if((ssize_t)pd->nboff < nbits) {
@@ -89,8 +103,12 @@
 
 	accum &= (((uint32_t)1 << nbits) - 1);
 
-	ASN_DEBUG("[PER got %d bits from (%d@%d+%d) => 0x%x]",
-		nbits, pd->moved, pd->nboff, nleft, accum);
+	ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+d[%d..%d] (%d) => 0x%x]",
+		nbits, nleft,
+		pd->moved,
+		(((int)pd->buffer) & 0xf),
+		pd->nboff, pd->nbits, pd->nbits - pd->nboff,
+		accum);
 
 	return accum;
 }