X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=type_decoder.c;h=b04747e8f784716074b46462fbe5faa628cc8fca;hp=b90bdea04686219355fe382ba7796ff8867d6ea5;hb=4c58713b0d536f37b8630ebd142185aa56946335;hpb=43dc03965ffa8967884cf320660b0934463f3739 diff --git a/type_decoder.c b/type_decoder.c index b90bdea..b04747e 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -31,7 +31,7 @@ typedef struct { } srd_Decoder; /* This is only used for nicer srd_dbg() output. */ -static const char *output_type_name(unsigned int idx) +SRD_PRIV const char *output_type_name(unsigned int idx) { static const char names[][16] = { "OUTPUT_ANN", @@ -355,9 +355,10 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) /* Upon SRD_OUTPUT_PYTHON for stacked PDs, we have a nicer log message later. */ if (pdo->output_type != SRD_OUTPUT_PYTHON && di->next_di != NULL) { - srd_spew("Instance %s put %" PRIu64 "-%" PRIu64 " %s on oid %d.", - di->inst_id, start_sample, end_sample, - output_type_name(pdo->output_type), output_id); + srd_spew("Instance %s put %" PRIu64 "-%" PRIu64 " %s on " + "oid %d (%s).", di->inst_id, start_sample, end_sample, + output_type_name(pdo->output_type), output_id, + pdo->proto_id); } pdata.start_sample = start_sample; @@ -384,10 +385,11 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) case SRD_OUTPUT_PYTHON: for (l = di->next_di; l; l = l->next) { next_di = l->data; - srd_spew("Instance %s put %" PRIu64 "-%" PRIu64 " %s on " - "oid %d to instance %s.", di->inst_id, start_sample, + srd_spew("Instance %s put %" PRIu64 "-%" PRIu64 " %s " + "on oid %d (%s) to instance %s.", di->inst_id, + start_sample, end_sample, output_type_name(pdo->output_type), - output_id, next_di->inst_id); + output_id, pdo->proto_id, next_di->inst_id); if (!(py_res = PyObject_CallMethod( next_di->py_inst, "decode", "KKO", start_sample, end_sample, py_data))) { @@ -519,9 +521,6 @@ static PyObject *Decoder_register(PyObject *self, PyObject *args, return py_new_output_id; } - srd_dbg("Instance %s creating new output type %d for %s.", - di->inst_id, output_type, proto_id); - pdo = g_malloc(sizeof(struct srd_pd_output)); /* pdo_id is just a simple index, nothing is deleted from this list anyway. */ @@ -541,6 +540,10 @@ static PyObject *Decoder_register(PyObject *self, PyObject *args, PyGILState_Release(gstate); + srd_dbg("Instance %s creating new output type %s as oid %d (%s).", + di->inst_id, output_type_name(output_type), pdo->pdo_id, + proto_id); + return py_new_output_id; err: