aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2007-06-29 02:28:05 +0000
committervlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2007-06-29 02:28:05 +0000
commit0faf003d77005533876da64cbb505850a2a9ef40 (patch)
treeaad0ac55821df372fbdfd469db656c2f9dcc32a6
parent0de7baa9f2607d6decf493317005a781c7f4f1da (diff)
more debugging
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1355 59561ff5-6e30-0410-9f3c-9617f08c8826
-rw-r--r--skeletons/per_support.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/skeletons/per_support.c b/skeletons/per_support.c
index 9406d963..e572fa8c 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 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
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;
}