Index: /trunk/include/VBox/vmm/dbgfflowtrace.h
===================================================================
--- /trunk/include/VBox/vmm/dbgfflowtrace.h	(revision 87780)
+++ /trunk/include/VBox/vmm/dbgfflowtrace.h	(revision 87781)
@@ -93,4 +93,6 @@
     /** Callback. */
     DBGFFLOWTRACEPROBEENTRYTYPE_CALLBACK,
+    /** Halt in the debugger when the entry is collected. */
+    DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER,
     /** 32bit hack. */
     DBGFFLOWTRACEPROBEENTRYTYPE_32BIT_HACK = 0x7fffffff
Index: /trunk/src/VBox/VMM/VMMR3/DBGFR3FlowTrace.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/DBGFR3FlowTrace.cpp	(revision 87780)
+++ /trunk/src/VBox/VMM/VMMR3/DBGFR3FlowTrace.cpp	(revision 87781)
@@ -693,5 +693,5 @@
  * Collects all the data specified in the given probe.
  *
- * @returns nothing.
+ * @returns Flag whether to enter the debugger.
  * @param   pUVM                    The user mode VM handle.
  * @param   idCpu                   The virtual CPU ID.
@@ -702,5 +702,5 @@
  * @param   pbBuf                   Poitner to the memory buffer holding additional data.
  */
-static void dbgfR3FlowTraceModProbeCollectData(PUVM pUVM, VMCPUID idCpu,
+static bool dbgfR3FlowTraceModProbeCollectData(PUVM pUVM, VMCPUID idCpu,
                                                PDBGFFLOWTRACEMODINT pTraceMod,
                                                PCDBGFADDRESS pAddrProbe,
@@ -708,4 +708,6 @@
                                                PDBGFFLOWTRACEPROBEVAL pVal, uint8_t *pbBuf)
 {
+    bool fDbgDefer = false;
+
     for (uint32_t i = 0; i < pProbe->cEntries; i++)
     {
@@ -753,4 +755,7 @@
                                                        pEntry->Type.Callback.pvUser);
                 break;
+            case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER:
+                fDbgDefer = true;
+                break;
             default:
                 AssertFailed();
@@ -759,4 +764,6 @@
         pVal++;
     }
+
+    return fDbgDefer;
 }
 
@@ -775,4 +782,5 @@
     PDBGFFLOWTRACEMODINT pTraceMod = pProbeLoc->pTraceMod;
     bool fDisabledModule = false;
+    bool fDbgDefer = false;
 
     /* Check whether the trace module is still active and we are tracing the correct VCPU. */
@@ -805,9 +813,9 @@
     if (pRecord)
     {
-        dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, &pProbeLoc->AddrProbe, pProbe,
-                                           &pRecord->aVal[0], pbBuf);
+        fDbgDefer = dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, &pProbeLoc->AddrProbe, pProbe,
+                                                       &pRecord->aVal[0], pbBuf);
         if (pTraceMod->pProbeCmn)
-            dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, NULL, pTraceMod->pProbeCmn,
-                                               pRecord->paValCmn, pbBufCmn);
+            fDbgDefer = dbgfR3FlowTraceModProbeCollectData(pTraceMod->pUVM, idCpu, pTraceMod, NULL, pTraceMod->pProbeCmn,
+                                                           pRecord->paValCmn, pbBufCmn);
 
         RTSemFastMutexRequest(pTraceMod->hMtx);
@@ -832,5 +840,5 @@
     }
 
-    return VINF_SUCCESS;
+    return fDbgDefer ? VINF_DBGF_BP_HALT : VINF_SUCCESS;
 }
 
@@ -856,4 +864,11 @@
     RTListForEach(&pThis->LstProbes, pProbeLoc, DBGFFLOWTRACEMODPROBELOC, NdProbes)
     {
+        uint16_t fBpFlags = DBGF_BP_F_ENABLED;
+
+        if (pProbeLoc->fFlags & DBGF_FLOW_TRACE_PROBE_ADD_F_BEFORE_EXEC)
+            fBpFlags |= DBGF_BP_F_HIT_EXEC_BEFORE;
+        if (pProbeLoc->fFlags & DBGF_FLOW_TRACE_PROBE_ADD_F_AFTER_EXEC)
+            fBpFlags |= DBGF_BP_F_HIT_EXEC_AFTER;
+
         rc = DBGFR3BpSetInt3Ex(pThis->pUVM, pThis->hBpOwner, pProbeLoc,
                                0 /*idSrcCpu*/, &pProbeLoc->AddrProbe, DBGF_BP_F_DEFAULT,
@@ -976,4 +991,6 @@
                 pEntry->Type.Callback.pfnCallback = NULL;
                 pEntry->Type.Callback.pvUser      = NULL;
+                break;
+            case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER:
                 break;
             default:
@@ -1103,4 +1120,6 @@
                 pDst->Type.Callback.pvUser      = pSrc->Type.Callback.pvUser;
                 break;
+            case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER:
+                break;
             default:
                 rc = VERR_INVALID_PARAMETER;
@@ -1145,4 +1164,5 @@
             case DBGFFLOWTRACEPROBEENTRYTYPE_CALLBACK:
             case DBGFFLOWTRACEPROBEENTRYTYPE_REG:
+            case DBGFFLOWTRACEPROBEENTRYTYPE_DEBUGGER:
                 break;
             default:
@@ -1260,10 +1280,9 @@
                                                         DBGF_FLOW_TRACE_PROBE_ADD_F_BEFORE_EXEC);
                     }
-
-                    if (RT_SUCCESS(rc))
+                    else
                     {
                         DBGFFLOWBBENDTYPE enmType = DBGFR3FlowBbGetType(hFlowBb);
-                        uint32_t cInstr = DBGFR3FlowBbGetInstrCount(hFlowBb);
-                        rc = DBGFR3FlowBbQueryInstr(hFlowBb, cInstr - 1, &AddrInstr, NULL, NULL);
+                        uint32_t cInstr = enmType == DBGFFLOWBBENDTYPE_EXIT ? DBGFR3FlowBbGetInstrCount(hFlowBb) - 1 : 0;
+                        rc = DBGFR3FlowBbQueryInstr(hFlowBb, cInstr, &AddrInstr, NULL, NULL);
                         if (RT_SUCCESS(rc))
                         {
