Browse Source

VmExtractDebugTrace() provides information about a kind of call.

Both VmExtractDebugTrace() and VmDebugTrace structure should provide information whether it was object call or a static method call.
release/v0.1
Rafal Kupiec 3 years ago
parent
commit
a2acf64272
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 6 additions and 4 deletions
  1. +5
    -4
      engine/vm.c
  2. +1
    -0
      include/ph7int.h

+ 5
- 4
engine/vm.c 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) {


+ 1
- 0
include/ph7int.h 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 */


Loading…
Cancel
Save