From 818b21babf251e268e2768f037a18ef85403414b Mon Sep 17 00:00:00 2001 From: v0-e Date: Mon, 15 Jan 2024 15:13:02 +0000 Subject: [PATCH 1/4] jer: Remove implicit variables in ASN_DEBUGs --- skeletons/constr_CHOICE_jer.c | 8 ++++---- skeletons/constr_SEQUENCE_jer.c | 4 ++-- skeletons/constr_SET_OF_jer.c | 7 +++---- skeletons/constr_SET_jer.c | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/skeletons/constr_CHOICE_jer.c b/skeletons/constr_CHOICE_jer.c index 960fa8e8b..674cd1573 100644 --- a/skeletons/constr_CHOICE_jer.c +++ b/skeletons/constr_CHOICE_jer.c @@ -140,12 +140,12 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(buf_ptr, ch_size, NULL); - ASN_DEBUG("JER/CHOICE checked [%c%c%c%c] vs [%s], scv=%d", + ASN_DEBUG("JER/CHOICE checked [%c%c%c%c], scv=%d", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - json_key, scv); + scv); /* Skip the extensions section */ if(ctx->phase == 4) { @@ -249,12 +249,12 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("Unexpected JSON key [%c%c%c%c] in CHOICE [%s]" - " (ph=%d, key=%s)", + " (ph=%d)", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - td->name, ctx->phase, json_key); + td->name, ctx->phase); break; } diff --git a/skeletons/constr_SEQUENCE_jer.c b/skeletons/constr_SEQUENCE_jer.c index fd0a539eb..ab1bed41e 100644 --- a/skeletons/constr_SEQUENCE_jer.c +++ b/skeletons/constr_SEQUENCE_jer.c @@ -145,8 +145,8 @@ SEQUENCE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(ptr, ch_size, NULL); - ASN_DEBUG("JER/SEQUENCE: scv = %d, ph=%d [%s]", - scv, ctx->phase, json_key); + ASN_DEBUG("JER/SEQUENCE: scv = %d, ph=%d", + scv, ctx->phase); /* Skip the extensions section */ diff --git a/skeletons/constr_SET_OF_jer.c b/skeletons/constr_SET_OF_jer.c index a900a7d46..87b926ac2 100644 --- a/skeletons/constr_SET_OF_jer.c +++ b/skeletons/constr_SET_OF_jer.c @@ -79,8 +79,7 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t tmprval = {RC_OK, 0}; /* Invoke the inner type decoder, m.b. multiple times */ - ASN_DEBUG("JER/SET OF element [%s]", elm_tag(*element->name) ? - element->name : element->type->xml_tag); + ASN_DEBUG("JER/SET OF element [%s]", element->type->xml_tag); tmprval = element->type->op->jer_decoder(opt_codec_ctx, element->type, &ctx->ptr, @@ -124,8 +123,8 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(buf_ptr, ch_size, NULL); - ASN_DEBUG("JER/SET OF: scv = %d, ph=%d t=%s", - scv, ctx->phase, json_key); + ASN_DEBUG("JER/SET OF: scv = %d, ph=%d", + scv, ctx->phase); switch(scv) { case JCK_AEND: if(ctx->phase == 0) break; diff --git a/skeletons/constr_SET_jer.c b/skeletons/constr_SET_jer.c index 1bc285b74..a8c5a17af 100644 --- a/skeletons/constr_SET_jer.c +++ b/skeletons/constr_SET_jer.c @@ -147,8 +147,8 @@ SET_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(ptr, ch_size, NULL); - ASN_DEBUG("JER/SET: scv = %d, ph=%d [%s]", - scv, ctx->phase, json_key); + ASN_DEBUG("JER/SET: scv = %d, ph=%d", + scv, ctx->phase); /* Skip the extensions section */ From 290bfa2ff2e3ac7d71a0a610caf3bf3558295b0e Mon Sep 17 00:00:00 2001 From: v0-e Date: Wed, 17 Jan 2024 12:40:56 +0000 Subject: [PATCH 2/4] Revert "jer: Remove implicit variables in ASN_DEBUGs" This reverts commit 818b21babf251e268e2768f037a18ef85403414b. --- skeletons/constr_CHOICE_jer.c | 8 ++++---- skeletons/constr_SEQUENCE_jer.c | 4 ++-- skeletons/constr_SET_OF_jer.c | 7 ++++--- skeletons/constr_SET_jer.c | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/skeletons/constr_CHOICE_jer.c b/skeletons/constr_CHOICE_jer.c index 674cd1573..960fa8e8b 100644 --- a/skeletons/constr_CHOICE_jer.c +++ b/skeletons/constr_CHOICE_jer.c @@ -140,12 +140,12 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(buf_ptr, ch_size, NULL); - ASN_DEBUG("JER/CHOICE checked [%c%c%c%c], scv=%d", + ASN_DEBUG("JER/CHOICE checked [%c%c%c%c] vs [%s], scv=%d", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - scv); + json_key, scv); /* Skip the extensions section */ if(ctx->phase == 4) { @@ -249,12 +249,12 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("Unexpected JSON key [%c%c%c%c] in CHOICE [%s]" - " (ph=%d)", + " (ph=%d, key=%s)", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - td->name, ctx->phase); + td->name, ctx->phase, json_key); break; } diff --git a/skeletons/constr_SEQUENCE_jer.c b/skeletons/constr_SEQUENCE_jer.c index ab1bed41e..fd0a539eb 100644 --- a/skeletons/constr_SEQUENCE_jer.c +++ b/skeletons/constr_SEQUENCE_jer.c @@ -145,8 +145,8 @@ SEQUENCE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(ptr, ch_size, NULL); - ASN_DEBUG("JER/SEQUENCE: scv = %d, ph=%d", - scv, ctx->phase); + ASN_DEBUG("JER/SEQUENCE: scv = %d, ph=%d [%s]", + scv, ctx->phase, json_key); /* Skip the extensions section */ diff --git a/skeletons/constr_SET_OF_jer.c b/skeletons/constr_SET_OF_jer.c index 87b926ac2..a900a7d46 100644 --- a/skeletons/constr_SET_OF_jer.c +++ b/skeletons/constr_SET_OF_jer.c @@ -79,7 +79,8 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t tmprval = {RC_OK, 0}; /* Invoke the inner type decoder, m.b. multiple times */ - ASN_DEBUG("JER/SET OF element [%s]", element->type->xml_tag); + ASN_DEBUG("JER/SET OF element [%s]", elm_tag(*element->name) ? + element->name : element->type->xml_tag); tmprval = element->type->op->jer_decoder(opt_codec_ctx, element->type, &ctx->ptr, @@ -123,8 +124,8 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(buf_ptr, ch_size, NULL); - ASN_DEBUG("JER/SET OF: scv = %d, ph=%d", - scv, ctx->phase); + ASN_DEBUG("JER/SET OF: scv = %d, ph=%d t=%s", + scv, ctx->phase, json_key); switch(scv) { case JCK_AEND: if(ctx->phase == 0) break; diff --git a/skeletons/constr_SET_jer.c b/skeletons/constr_SET_jer.c index a8c5a17af..1bc285b74 100644 --- a/skeletons/constr_SET_jer.c +++ b/skeletons/constr_SET_jer.c @@ -147,8 +147,8 @@ SET_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(ptr, ch_size, NULL); - ASN_DEBUG("JER/SET: scv = %d, ph=%d", - scv, ctx->phase); + ASN_DEBUG("JER/SET: scv = %d, ph=%d [%s]", + scv, ctx->phase, json_key); /* Skip the extensions section */ From e43041cbe19ab8accd204957667050a8e2ce10ae Mon Sep 17 00:00:00 2001 From: v0-e Date: Wed, 17 Jan 2024 13:19:43 +0000 Subject: [PATCH 3/4] jer: Replace implicit variables in ASN_DEBUGs --- skeletons/constr_CHOICE_jer.c | 6 +++--- skeletons/constr_SEQUENCE_jer.c | 2 +- skeletons/constr_SET_OF_jer.c | 5 ++--- skeletons/constr_SET_jer.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/skeletons/constr_CHOICE_jer.c b/skeletons/constr_CHOICE_jer.c index 960fa8e8b..1dc32e96c 100644 --- a/skeletons/constr_CHOICE_jer.c +++ b/skeletons/constr_CHOICE_jer.c @@ -145,7 +145,7 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - json_key, scv); + td->name, scv); /* Skip the extensions section */ if(ctx->phase == 4) { @@ -249,12 +249,12 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("Unexpected JSON key [%c%c%c%c] in CHOICE [%s]" - " (ph=%d, key=%s)", + " (ph=%d)", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - td->name, ctx->phase, json_key); + td->name, ctx->phase); break; } diff --git a/skeletons/constr_SEQUENCE_jer.c b/skeletons/constr_SEQUENCE_jer.c index fd0a539eb..4d08adacc 100644 --- a/skeletons/constr_SEQUENCE_jer.c +++ b/skeletons/constr_SEQUENCE_jer.c @@ -146,7 +146,7 @@ SEQUENCE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, scv = jer_check_sym(ptr, ch_size, NULL); ASN_DEBUG("JER/SEQUENCE: scv = %d, ph=%d [%s]", - scv, ctx->phase, json_key); + scv, ctx->phase, td->name); /* Skip the extensions section */ diff --git a/skeletons/constr_SET_OF_jer.c b/skeletons/constr_SET_OF_jer.c index a900a7d46..e9434094c 100644 --- a/skeletons/constr_SET_OF_jer.c +++ b/skeletons/constr_SET_OF_jer.c @@ -79,8 +79,7 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t tmprval = {RC_OK, 0}; /* Invoke the inner type decoder, m.b. multiple times */ - ASN_DEBUG("JER/SET OF element [%s]", elm_tag(*element->name) ? - element->name : element->type->xml_tag); + ASN_DEBUG("JER/SET OF element [%s]", element->type->xml_tag); tmprval = element->type->op->jer_decoder(opt_codec_ctx, element->type, &ctx->ptr, @@ -125,7 +124,7 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, scv = jer_check_sym(buf_ptr, ch_size, NULL); ASN_DEBUG("JER/SET OF: scv = %d, ph=%d t=%s", - scv, ctx->phase, json_key); + scv, ctx->phase, td->name); switch(scv) { case JCK_AEND: if(ctx->phase == 0) break; diff --git a/skeletons/constr_SET_jer.c b/skeletons/constr_SET_jer.c index 1bc285b74..7782b0b3f 100644 --- a/skeletons/constr_SET_jer.c +++ b/skeletons/constr_SET_jer.c @@ -148,7 +148,7 @@ SET_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, scv = jer_check_sym(ptr, ch_size, NULL); ASN_DEBUG("JER/SET: scv = %d, ph=%d [%s]", - scv, ctx->phase, json_key); + scv, ctx->phase, td->name); /* Skip the extensions section */ From 0d3f1b17b1ffdcd45f0645578c29b0dbcd0be086 Mon Sep 17 00:00:00 2001 From: v0-e Date: Mon, 22 Jan 2024 14:24:48 +0000 Subject: [PATCH 4/4] jer: CHOICE and SET OF decode debug info enhancements --- skeletons/constr_CHOICE_jer.c | 4 ++-- skeletons/constr_SET_OF_jer.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/skeletons/constr_CHOICE_jer.c b/skeletons/constr_CHOICE_jer.c index 1dc32e96c..7d265aa74 100644 --- a/skeletons/constr_CHOICE_jer.c +++ b/skeletons/constr_CHOICE_jer.c @@ -140,7 +140,7 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, } scv = jer_check_sym(buf_ptr, ch_size, NULL); - ASN_DEBUG("JER/CHOICE checked [%c%c%c%c] vs [%s], scv=%d", + ASN_DEBUG("JER/CHOICE checked [%c%c%c%c] of [%s], scv=%d", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', @@ -248,7 +248,7 @@ CHOICE_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, break; } - ASN_DEBUG("Unexpected JSON key [%c%c%c%c] in CHOICE [%s]" + ASN_DEBUG("Unexpected JSON token [%c%c%c%c] in CHOICE [%s]" " (ph=%d)", ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', diff --git a/skeletons/constr_SET_OF_jer.c b/skeletons/constr_SET_OF_jer.c index e9434094c..1245b7018 100644 --- a/skeletons/constr_SET_OF_jer.c +++ b/skeletons/constr_SET_OF_jer.c @@ -79,7 +79,8 @@ SET_OF_decode_jer(const asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t tmprval = {RC_OK, 0}; /* Invoke the inner type decoder, m.b. multiple times */ - ASN_DEBUG("JER/SET OF element [%s]", element->type->xml_tag); + ASN_DEBUG("JER/SET OF element [%s]", + (*element->name) ? element->name : element->type->xml_tag); tmprval = element->type->op->jer_decoder(opt_codec_ctx, element->type, &ctx->ptr,