Another fix in debug trace.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-09-14 22:22:37 +02:00
parent 94ae7d187b
commit faca9b7fb2
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 18 additions and 16 deletions

View File

@ -1733,22 +1733,24 @@ PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace) {
break; break;
} }
} }
aTrace.pClassName = NULL; if(aTrace.pFile) {
aTrace.bThis = FALSE; aTrace.pClassName = NULL;
if(pFunc->iFlags & VM_FUNC_CLASS_METHOD) { aTrace.bThis = FALSE;
/* Extract class name */ if(pFunc->iFlags & VM_FUNC_CLASS_METHOD) {
ph7_class *pClass; /* Extract class name */
pClass = PH7_VmExtractActiveClass(pVm, iDepth++); ph7_class *pClass;
if(pClass) { pClass = PH7_VmExtractActiveClass(pVm, iDepth++);
aTrace.pClassName = &pClass->sName; if(pClass) {
if(pVm->pFrame->pThis && pVm->pFrame->pThis->pClass == pClass) { aTrace.pClassName = &pClass->sName;
aTrace.bThis = TRUE; if(pVm->pFrame->pThis && pVm->pFrame->pThis->pClass == pClass) {
aTrace.bThis = TRUE;
}
} }
} }
} rc = SySetPut(pDebugTrace, (const void *)&aTrace);
rc = SySetPut(pDebugTrace, (const void *)&aTrace); if(rc != SXRET_OK) {
if(rc != SXRET_OK) { break;
break; }
} }
} }
/* Roll frame */ /* Roll frame */

View File

@ -1231,7 +1231,7 @@ struct ph7_vm {
int nMaxDepth; /* Maximum allowed recursion depth */ int nMaxDepth; /* Maximum allowed recursion depth */
int nExceptDepth; /* Exception depth */ int nExceptDepth; /* Exception depth */
int closure_cnt; /* Loaded closures counter */ int closure_cnt; /* Loaded closures counter */
int json_rc; /* JSON return status [refer to json_encode()/json_decode()]*/ int json_rc; /* JSON return status [refer to json_encode()/json_decode()] */
ph7_output_consumer sVmConsumer; /* Registered output consumer callback */ ph7_output_consumer sVmConsumer; /* Registered output consumer callback */
int iAssertFlags; /* Assertion flags */ int iAssertFlags; /* Assertion flags */
ph7_value sAssertCallback; /* Callback to call on failed assertions */ ph7_value sAssertCallback; /* Callback to call on failed assertions */
@ -1258,7 +1258,7 @@ struct VmFrame {
SyHash hVar; /* Variable hashtable for fast lookup */ SyHash hVar; /* Variable hashtable for fast lookup */
SySet sArg; /* Function arguments container */ SySet sArg; /* Function arguments container */
SySet sRef; /* Local reference table (VmSlot instance) */ SySet sRef; /* Local reference table (VmSlot instance) */
sxi32 iFlags; /* Frame configuration flags (See below)*/ sxi32 iFlags; /* Frame configuration flags (See below) */
sxu32 iExceptionJump; /* Exception jump destination */ sxu32 iExceptionJump; /* Exception jump destination */
}; };
#define VM_FRAME_EXCEPTION 0x01 /* Special Exception frame */ #define VM_FRAME_EXCEPTION 0x01 /* Special Exception frame */