Allow to dump last frame only.
All checks were successful
The build was successful.

This commit is contained in:
Rafal Kupiec 2018-08-27 12:36:21 +02:00
parent 8f7b28d46c
commit d0b0a416d0
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -1773,7 +1773,7 @@ static const char *VmInstrToString(sxi32 nOp);
/*
* This routine is used to dump the debug stacktrace based on all active frames.
*/
PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace) {
PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace, sxbool bAllFrames) {
sxi32 iDepth = 0;
sxi32 rc = SXRET_OK;
/* Initialize the container */
@ -1812,6 +1812,9 @@ PH7_PRIVATE sxi32 VmExtractDebugTrace(ph7_vm *pVm, SySet *pDebugTrace) {
break;
}
}
if(!bAllFrames) {
break;
}
/* Roll frame */
pVm->pFrame = pVm->pFrame->pParent;
}