VmExtractDebugTrace() provides information about a kind of call.
The build was successful. Details

Both VmExtractDebugTrace() and VmDebugTrace structure should provide information whether it was object call or a static method call.
This commit is contained in:
Rafal Kupiec 2018-09-02 20:15:17 +02:00
parent d135748bcd
commit a2acf64272
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 6 additions and 4 deletions

View File

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

View File

@ -1286,6 +1286,7 @@ typedef struct VmDebugTrace VmDebugTrace;
struct VmDebugTrace {
SyString *pFile; /* AerScript file name */
sxu32 nLine; /* Line in Aer source file */
sxbool bThis; /* Whether it was object call or static call */
SyString *pClassName; /* Class name */
SyString *pFuncName; /* Closure/method name */
SySet *pArg; /* List of arguments passed to closure/method */