From ce621cc49c821a998eb558638451284f88cc4585 Mon Sep 17 00:00:00 2001 From: belliash Date: Mon, 27 Aug 2018 12:42:02 +0200 Subject: [PATCH] Implement VmExtractPeekDebugTrace(); --- engine/vm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/engine/vm.c b/engine/vm.c index 1edfdb8..fbb42db 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -1822,6 +1822,17 @@ PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace, sxbool bA pVm->pFrame = oFrame; return rc; } +/* + * This routine is used to dump the peek frame from debug stacktrace. + */ +PH7_PRIVATE sxi32 VmExtractPeekDebugTrace(ph7_vm *pVm, VmDebugTrace *pDebug) { + SySet *pTrace; + /* Populate debug stacktrace */ + if(VmExtractDebugTrace(&(*pVm), &pTrace, FALSE) != SXRET_OK || SySetGetNextEntry(&pTrace, (void **)&pDebug) != SXRET_OK) { + return SXERR_MEM; + } + return SXRET_OK; +} /* * This routine is used to dump PH7 byte-code instructions to a human readable * format.