diff options
Diffstat (limited to 'runtime/obj.c')
-rw-r--r-- | runtime/obj.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/runtime/obj.c b/runtime/obj.c index b2739c58..ffc8f608 100644 --- a/runtime/obj.c +++ b/runtime/obj.c @@ -610,6 +610,8 @@ static rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm) number_t i; number_t iLen; uchar c; + int step = 0; /* which step was successful? */ + int64 offs; assert(pProp != NULL); @@ -630,13 +632,16 @@ static rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm) NEXTC; } CHKiRet(cstrFinalize(pProp->pcsName)); + step = 1; /* property type */ CHKiRet(objDeserializeNumber(&i, pStrm)); pProp->varType = i; + step = 2; /* size (needed for strings) */ CHKiRet(objDeserializeNumber(&iLen, pStrm)); + step = 3; /* we now need to deserialize the value */ switch(pProp->varType) { @@ -653,12 +658,44 @@ static rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm) dbgprintf("invalid VARTYPE %d\n", pProp->varType); break; } + step = 4; /* we should now be at the end of the line. So the next char must be \n */ NEXTC; if(c != '\n') ABORT_FINALIZE(RS_RET_INVALID_PROPFRAME); finalize_it: + if(Debug && iRet != RS_RET_OK) { + strm.GetCurrOffset(pStrm, &offs); + dbgprintf("error %d deserializing property name, offset %lld, step %d\n", + iRet, offs, step); + if(step >= 1) { + dbgprintf("error property name: '%s'\n", rsCStrGetSzStrNoNULL(pProp->pcsName)); + } + if(step >= 2) { + dbgprintf("error var type: '%d'\n", pProp->varType); + } + if(step >= 3) { + dbgprintf("error len: '%d'\n", (int) iLen); + } + if(step >= 4) { + switch(pProp->varType) { + case VARTYPE_STR: + dbgprintf("error data string: '%s'\n", + rsCStrGetSzStrNoNULL(pProp->val.pStr)); + break; + case VARTYPE_NUMBER: + dbgprintf("error number: %d\n", (int) pProp->val.num); + break; + case VARTYPE_SYSLOGTIME: + dbgprintf("syslog time was successfully parsed (but " + "is not displayed\n"); + break; + default: + break; + } + } + } RETiRet; } |