- Timestamp:
- Feb 17, 2021 2:02:53 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/VBox/vmm/dbgfflowtrace.h (modified) (1 diff)
-
src/VBox/VMM/VMMR3/DBGFR3FlowTrace.cpp (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/dbgfflowtrace.h
r87140 r87781 93 93 /** Callback. */ 94 94 DBGFFLOWTRACEPROBEENTRYTYPE_CALLBACK, 95 /** Halt in the debugger when the entry is collected. */ 96 DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER, 95 97 /** 32bit hack. */ 96 98 DBGFFLOWTRACEPROBEENTRYTYPE_32BIT_HACK = 0x7fffffff -
trunk/src/VBox/VMM/VMMR3/DBGFR3FlowTrace.cpp
r87776 r87781 693 693 * Collects all the data specified in the given probe. 694 694 * 695 * @returns nothing.695 * @returns Flag whether to enter the debugger. 696 696 * @param pUVM The user mode VM handle. 697 697 * @param idCpu The virtual CPU ID. … … 702 702 * @param pbBuf Poitner to the memory buffer holding additional data. 703 703 */ 704 static voiddbgfR3FlowTraceModProbeCollectData(PUVM pUVM, VMCPUID idCpu,704 static bool dbgfR3FlowTraceModProbeCollectData(PUVM pUVM, VMCPUID idCpu, 705 705 PDBGFFLOWTRACEMODINT pTraceMod, 706 706 PCDBGFADDRESS pAddrProbe, … … 708 708 PDBGFFLOWTRACEPROBEVAL pVal, uint8_t *pbBuf) 709 709 { 710 bool fDbgDefer = false; 711 710 712 for (uint32_t i = 0; i < pProbe->cEntries; i++) 711 713 { … … 753 755 pEntry->Type.Callback.pvUser); 754 756 break; 757 case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER: 758 fDbgDefer = true; 759 break; 755 760 default: 756 761 AssertFailed(); … … 759 764 pVal++; 760 765 } 766 767 return fDbgDefer; 761 768 } 762 769 … … 775 782 PDBGFFLOWTRACEMODINT pTraceMod = pProbeLoc->pTraceMod; 776 783 bool fDisabledModule = false; 784 bool fDbgDefer = false; 777 785 778 786 /* Check whether the trace module is still active and we are tracing the correct VCPU. */ … … 805 813 if (pRecord) 806 814 { 807 dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, &pProbeLoc->AddrProbe, pProbe,808 &pRecord->aVal[0], pbBuf);815 fDbgDefer = dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, &pProbeLoc->AddrProbe, pProbe, 816 &pRecord->aVal[0], pbBuf); 809 817 if (pTraceMod->pProbeCmn) 810 dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, NULL, pTraceMod->pProbeCmn,811 pRecord->paValCmn, pbBufCmn);818 fDbgDefer = dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, NULL, pTraceMod->pProbeCmn, 819 pRecord->paValCmn, pbBufCmn); 812 820 813 821 RTSemFastMutexRequest(pTraceMod->hMtx); … … 832 840 } 833 841 834 return VINF_SUCCESS;842 return fDbgDefer ? VINF_DBGF_BP_HALT : VINF_SUCCESS; 835 843 } 836 844 … … 856 864 RTListForEach(&pThis->LstProbes, pProbeLoc, DBGFFLOWTRACEMODPROBELOC, NdProbes) 857 865 { 866 uint16_t fBpFlags = DBGF_BP_F_ENABLED; 867 868 if (pProbeLoc->fFlags & DBGF_FLOW_TRACE_PROBE_ADD_F_BEFORE_EXEC) 869 fBpFlags |= DBGF_BP_F_HIT_EXEC_BEFORE; 870 if (pProbeLoc->fFlags & DBGF_FLOW_TRACE_PROBE_ADD_F_AFTER_EXEC) 871 fBpFlags |= DBGF_BP_F_HIT_EXEC_AFTER; 872 858 873 rc = DBGFR3BpSetInt3Ex(pThis->pUVM, pThis->hBpOwner, pProbeLoc, 859 874 0 /*idSrcCpu*/, &pProbeLoc->AddrProbe, DBGF_BP_F_DEFAULT, … … 976 991 pEntry->Type.Callback.pfnCallback = NULL; 977 992 pEntry->Type.Callback.pvUser = NULL; 993 break; 994 case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER: 978 995 break; 979 996 default: … … 1103 1120 pDst->Type.Callback.pvUser = pSrc->Type.Callback.pvUser; 1104 1121 break; 1122 case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER: 1123 break; 1105 1124 default: 1106 1125 rc = VERR_INVALID_PARAMETER; … … 1145 1164 case DBGFFLOWTRACEPROBEENTRYTYPE_CALLBACK: 1146 1165 case DBGFFLOWTRACEPROBEENTRYTYPE_REG: 1166 case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER: 1147 1167 break; 1148 1168 default: … … 1260 1280 DBGF_FLOW_TRACE_PROBE_ADD_F_BEFORE_EXEC); 1261 1281 } 1262 1263 if (RT_SUCCESS(rc)) 1282 else 1264 1283 { 1265 1284 DBGFFLOWBBENDTYPE enmType = DBGFR3FlowBbGetType(hFlowBb); 1266 uint32_t cInstr = DBGFR3FlowBbGetInstrCount(hFlowBb);1267 rc = DBGFR3FlowBbQueryInstr(hFlowBb, cInstr - 1, &AddrInstr, NULL, NULL);1285 uint32_t cInstr = enmType == DBGFFLOWBBENDTYPE_EXIT ? DBGFR3FlowBbGetInstrCount(hFlowBb) - 1 : 0; 1286 rc = DBGFR3FlowBbQueryInstr(hFlowBb, cInstr, &AddrInstr, NULL, NULL); 1268 1287 if (RT_SUCCESS(rc)) 1269 1288 {
Note:
See TracChangeset
for help on using the changeset viewer.

