Index: /trunk/include/VBox/VBoxTpG.h
===================================================================
--- /trunk/include/VBox/VBoxTpG.h	(revision 40891)
+++ /trunk/include/VBox/VBoxTpG.h	(revision 40892)
@@ -170,7 +170,10 @@
     uint16_t        idxEnabled;
     uint16_t        idxProvider;
+    /** The distance from this structure to the VTG object header. */
+    int32_t         offObjHdr;
     uint32_t        u32User;
+    uint32_t        u32User2;
 } VTGDESCPROBE;
-AssertCompileSize(VTGDESCPROBE, 16);
+AssertCompileSize(VTGDESCPROBE, 24);
 /** Pointer to a VTG probe descriptor. */
 typedef VTGDESCPROBE       *PVTGDESCPROBE;
@@ -269,5 +272,5 @@
 
 /** The current VTGOBJHDR::szMagic value. */
-#define VTGOBJHDR_MAGIC     "VTG Object Header v1.3\0"
+#define VTGOBJHDR_MAGIC     "VTG Object Header v1.4\0"
 
 /** The name of the VTG data object header symbol in the object file. */
Index: /trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp	(revision 40891)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp	(revision 40892)
@@ -399,4 +399,5 @@
                 /** @todo mapping? */
                 pArgDesc->dtargd_ndx = uArg;
+SUPR0Printf("supdrvDtPOps_GetArgVal: returns dtargd_native = %s for #%u\n", pArgDesc->dtargd_native, uArg);
                 LOG_DTRACE(("supdrvDtPOps_GetArgVal: returns dtargd_native = %s\n", pArgDesc->dtargd_native));
                 return;
@@ -404,4 +405,5 @@
         }
     }
+SUPR0Printf("supdrvDtPOps_GetArgVal: returns faiure for #%u\n", uArg);
 }
 
@@ -469,5 +471,8 @@
     }
 
-    /* Get the stack data. */
+    /*
+     * Get the stack data. This is a wee bit complicated on 32-bit systems
+     * since we want to support 64-bit integer arguments.
+     */
 #if ARCH_BITS == 64
     uint64_t u64Ret = pData->pauStackArgs[iArg - 5];
@@ -479,9 +484,8 @@
     else
     {
-        /* wonder if this will work... */
+        /* Similar to what we did for mac in when calling dtrace_probe(). */
         uint32_t off = 0;
         for (int i = 5; i < iArg; i++)
-            if (   (pArgList->aArgs[i].fType & VTG_TYPE_FIXED_SIZED)
-                && (pArgList->aArgs[i].fType & VTG_TYPE_SIZE_MASK) == 8)
+            if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iArg].fType))
                 off++;
         u64Ret = pData->pauStackArgs[iArg - 5 + off];
@@ -566,6 +570,43 @@
     SUPDRVDT_SETUP_STACK_DATA();
 
-    pStackData->pauStackArgs = &uArg4 + 1;
+    pStackData->pauStackArgs  = &uArg4 + 1;
+
+#if defined(RT_OS_DARWIN) && ARCH_BITS == 32
+    /*
+     * Convert arguments from uintptr_t to uint64_t.
+     */
+    PVTGDESCPROBE   pProbe   = (PVTGDESCPROBE)((PVTGPROBELOC)pVtgProbeLoc)->pbProbe;
+    AssertPtrReturnVoid(pProbe);
+    PVTGOBJHDR      pVtgHdr  = (PVTGOBJHDR)((uintptr_t)pProbe + pProbe->offObjHdr);
+    AssertPtrReturnVoid(pVtgHdr);
+    PVTGDESCARGLIST pArgList = (PVTGDESCARGLIST)((uintptr_t)pVtgHdr->paArgLists + pProbe->offArgList);
+    AssertPtrReturnVoid(pArgList);
+    if (!pArgList->fHaveLargeArgs)
+        dtrace_probe(pVtgProbeLoc->idProbe, uArg0, uArg1, uArg2, uArg3, uArg4);
+    else
+    {
+        uintptr_t *auSrcArgs = &uArg0;
+        uint32_t   iSrcArg   = 0;
+        uint32_t   iDstArg   = 0;
+        uint64_t   au64DstArgs[5];
+
+        while (   iDstArg < RT_ELEMENTS(au64DstArgs)
+               && iSrcArg < pArgList->cArgs)
+        {
+            au64DstArgs[iDstArg] = auSrcArgs[iSrcArg];
+            if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iDstArg].fType))
+                au64DstArgs[iDstArg] |= (uint64_t)auSrcArgs[++iSrcArg] << 32;
+            iSrcArg++;
+            iDstArg++;
+        }
+        while (iDstArg < RT_ELEMENTS(au64DstArgs))
+            au64DstArgs[iDstArg++] = auSrcArgs[iSrcArg++];
+
+        pStackData->pauStackArgs  = &auSrcArgs[iSrcArg];
+        dtrace_probe(pVtgProbeLoc->idProbe, au64DstArgs[0], au64DstArgs[1], au64DstArgs[2], au64DstArgs[3], au64DstArgs[4]);
+    }
+#else
     dtrace_probe(pVtgProbeLoc->idProbe, uArg0, uArg1, uArg2, uArg3, uArg4);
+#endif
 
     SUPDRVDT_CLEAR_STACK_DATA();
Index: /trunk/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp	(revision 40891)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp	(revision 40892)
@@ -315,4 +315,13 @@
         if (pVtgHdr->paProbes[i].u32User)
             return VERR_SUPDRV_VTG_BAD_PROBE;
+        if (pVtgHdr->paProbes[i].u32User2)
+            return VERR_SUPDRV_VTG_BAD_PROBE;
+        if (   pVtgHdr->paProbes[i].offObjHdr
+            != (intptr_t)pVtgHdr - (intptr_t)&pVtgHdr->paProbes[i])
+        {
+            SUPR0Printf("supdrvVtgValidate: VERR_SUPDRV_TRACER_BAD_ARG_FLAGS - iProbe=%u offObjHdr=%d expected %zd\n",
+                        i, pVtgHdr->paProbes[i].offObjHdr, (intptr_t)pVtgHdr - (intptr_t)&pVtgHdr->paProbes[i]);
+            return VERR_SUPDRV_VTG_BAD_PROBE;
+        }
 
         /* The referenced argument list. */
@@ -320,5 +329,5 @@
         if (pArgList->cArgs > 16)
         {
-            SUPR0Printf("supdrvVtgValidate: VERR_SUPDRV_TRACER_BAD_ARG_FLAGS - iProbe=%u cArgs=%u\n", i, pArgList->fHaveLargeArgs, pArgList->cArgs);
+            SUPR0Printf("supdrvVtgValidate: VERR_SUPDRV_TRACER_BAD_ARG_FLAGS - iProbe=%u cArgs=%u\n", i, pArgList->cArgs);
             return VERR_SUPDRV_VTG_BAD_ARGLIST;
         }
Index: /trunk/src/bldprogs/VBoxTpG.cpp
===================================================================
--- /trunk/src/bldprogs/VBoxTpG.cpp	(revision 40891)
+++ /trunk/src/bldprogs/VBoxTpG.cpp	(revision 40892)
@@ -516,5 +516,5 @@
                     "                ;0         1         2         3\n"
                     "                ;012345678901234567890123456789012\n"
-                    "    db          'VTG Object Header v1.3', 0, 0\n"
+                    "    db          'VTG Object Header v1.4', 0, 0\n"
                     "    dd          %u\n"
                     "    dd          0\n"
@@ -607,7 +607,7 @@
             ScmStreamPrintf(pStrm,
                             "    ; off=%u\n"
-                            "    db   %2u     ; Argument count\n"
-                            "    db   %u      ; fHaveLargeArgs\n"
-                            "    db  0, 0    ; Reserved\n"
+                            "    db        %2u  ; Argument count\n"
+                            "    db         %u  ; fHaveLargeArgs\n"
+                            "    db      0, 0  ; Reserved\n"
                             , off, pProbe->cArgs, (int)pProbe->fHaveLargeArgs);
             off += 4;
@@ -615,5 +615,5 @@
             {
                 ScmStreamPrintf(pStrm,
-                                "    dd %6u   ; type '%s' (name '%s')\n"
+                                "    dd  %8u  ; type '%s' (name '%s')\n"
                                 "    dd 0%08xh ; type flags\n",
                                 strtabGetOff(pArg->pszType), pArg->pszType, pArg->pszName,
@@ -679,5 +679,7 @@
                             "    dw NAME(g_fVTGProbeEnabled_%s_%s) - NAME(g_afVTGProbeEnabled)\n"
                             "    dw %6u  ; provider index\n"
-                            "    dd 0       ; for the application\n"
+                            "    dd NAME(g_VTGObjHeader) - NAME(g_VTGProbeData_%s_%s) ; offset to the object header\n"
+                            "    dd      0  ; for the application\n"
+                            "    dd      0  ; for the application\n"
                             ,
                             pProvider->pszName, pProbe->pszMangledName, iProbe,
@@ -685,5 +687,7 @@
                             pProbe->offArgList,
                             pProvider->pszName, pProbe->pszMangledName,
-                            iProvider);
+                            iProvider,
+                            pProvider->pszName, pProbe->pszMangledName
+                            );
             pProbe->iProbe = iProbe;
             iProbe++;
@@ -974,19 +978,16 @@
             RTListForEach(&pProbe->ArgHead, pArg, VTGARG, ListEntry)
             {
-                if (iArg < 5)
-                {
-                    if (pArg->fType & VTG_TYPE_FIXED_SIZED)
-                        ScmStreamPrintf(pStrm,
-                                        "        /*AssertCompile(sizeof(%s) <= sizeof(uint32_t));*/ \\\n"
-                                        "        /*AssertCompile(sizeof(%s) <= sizeof(uint32_t));*/ \\\n",
-                                        pArg->pszName,
-                                        pArg->pszType);
-                    else
-                        ScmStreamPrintf(pStrm,
-                                        "        AssertCompile(sizeof(%s) <= sizeof(uintptr_t)); \\\n"
-                                        "        AssertCompile(sizeof(%s) <= sizeof(uintptr_t)); \\\n",
-                                        pArg->pszName,
-                                        pArg->pszType);
-                }
+                if (pArg->fType & VTG_TYPE_FIXED_SIZED)
+                    ScmStreamPrintf(pStrm,
+                                    "        AssertCompile(sizeof(%s) == %u); \\\n"
+                                    "        AssertCompile(sizeof(%s) <= %u); \\\n",
+                                    pArg->pszType, pArg->fType & VTG_TYPE_SIZE_MASK,
+                                    pArg->pszName, pArg->fType & VTG_TYPE_SIZE_MASK);
+                else if (pArg->fType & (VTG_TYPE_POINTER | VTG_TYPE_HC_ARCH_SIZED))
+                    ScmStreamPrintf(pStrm,
+                                    "        AssertCompile(sizeof(%s) <= sizeof(uintptr_t)); \\\n"
+                                    "        AssertCompile(sizeof(%s) <= sizeof(uintptr_t)); \\\n",
+                                    pArg->pszName,
+                                    pArg->pszType);
                 iArg++;
             }
