Changeset 40892 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Apr 12, 2012 12:12:40 PM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r40889 r40892 399 399 /** @todo mapping? */ 400 400 pArgDesc->dtargd_ndx = uArg; 401 SUPR0Printf("supdrvDtPOps_GetArgVal: returns dtargd_native = %s for #%u\n", pArgDesc->dtargd_native, uArg); 401 402 LOG_DTRACE(("supdrvDtPOps_GetArgVal: returns dtargd_native = %s\n", pArgDesc->dtargd_native)); 402 403 return; … … 404 405 } 405 406 } 407 SUPR0Printf("supdrvDtPOps_GetArgVal: returns faiure for #%u\n", uArg); 406 408 } 407 409 … … 469 471 } 470 472 471 /* Get the stack data. */ 473 /* 474 * Get the stack data. This is a wee bit complicated on 32-bit systems 475 * since we want to support 64-bit integer arguments. 476 */ 472 477 #if ARCH_BITS == 64 473 478 uint64_t u64Ret = pData->pauStackArgs[iArg - 5]; … … 479 484 else 480 485 { 481 /* wonder if this will work... */486 /* Similar to what we did for mac in when calling dtrace_probe(). */ 482 487 uint32_t off = 0; 483 488 for (int i = 5; i < iArg; i++) 484 if ( (pArgList->aArgs[i].fType & VTG_TYPE_FIXED_SIZED) 485 && (pArgList->aArgs[i].fType & VTG_TYPE_SIZE_MASK) == 8) 489 if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iArg].fType)) 486 490 off++; 487 491 u64Ret = pData->pauStackArgs[iArg - 5 + off]; … … 566 570 SUPDRVDT_SETUP_STACK_DATA(); 567 571 568 pStackData->pauStackArgs = &uArg4 + 1; 572 pStackData->pauStackArgs = &uArg4 + 1; 573 574 #if defined(RT_OS_DARWIN) && ARCH_BITS == 32 575 /* 576 * Convert arguments from uintptr_t to uint64_t. 577 */ 578 PVTGDESCPROBE pProbe = (PVTGDESCPROBE)((PVTGPROBELOC)pVtgProbeLoc)->pbProbe; 579 AssertPtrReturnVoid(pProbe); 580 PVTGOBJHDR pVtgHdr = (PVTGOBJHDR)((uintptr_t)pProbe + pProbe->offObjHdr); 581 AssertPtrReturnVoid(pVtgHdr); 582 PVTGDESCARGLIST pArgList = (PVTGDESCARGLIST)((uintptr_t)pVtgHdr->paArgLists + pProbe->offArgList); 583 AssertPtrReturnVoid(pArgList); 584 if (!pArgList->fHaveLargeArgs) 585 dtrace_probe(pVtgProbeLoc->idProbe, uArg0, uArg1, uArg2, uArg3, uArg4); 586 else 587 { 588 uintptr_t *auSrcArgs = &uArg0; 589 uint32_t iSrcArg = 0; 590 uint32_t iDstArg = 0; 591 uint64_t au64DstArgs[5]; 592 593 while ( iDstArg < RT_ELEMENTS(au64DstArgs) 594 && iSrcArg < pArgList->cArgs) 595 { 596 au64DstArgs[iDstArg] = auSrcArgs[iSrcArg]; 597 if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iDstArg].fType)) 598 au64DstArgs[iDstArg] |= (uint64_t)auSrcArgs[++iSrcArg] << 32; 599 iSrcArg++; 600 iDstArg++; 601 } 602 while (iDstArg < RT_ELEMENTS(au64DstArgs)) 603 au64DstArgs[iDstArg++] = auSrcArgs[iSrcArg++]; 604 605 pStackData->pauStackArgs = &auSrcArgs[iSrcArg]; 606 dtrace_probe(pVtgProbeLoc->idProbe, au64DstArgs[0], au64DstArgs[1], au64DstArgs[2], au64DstArgs[3], au64DstArgs[4]); 607 } 608 #else 569 609 dtrace_probe(pVtgProbeLoc->idProbe, uArg0, uArg1, uArg2, uArg3, uArg4); 610 #endif 570 611 571 612 SUPDRVDT_CLEAR_STACK_DATA(); -
trunk/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
r40886 r40892 315 315 if (pVtgHdr->paProbes[i].u32User) 316 316 return VERR_SUPDRV_VTG_BAD_PROBE; 317 if (pVtgHdr->paProbes[i].u32User2) 318 return VERR_SUPDRV_VTG_BAD_PROBE; 319 if ( pVtgHdr->paProbes[i].offObjHdr 320 != (intptr_t)pVtgHdr - (intptr_t)&pVtgHdr->paProbes[i]) 321 { 322 SUPR0Printf("supdrvVtgValidate: VERR_SUPDRV_TRACER_BAD_ARG_FLAGS - iProbe=%u offObjHdr=%d expected %zd\n", 323 i, pVtgHdr->paProbes[i].offObjHdr, (intptr_t)pVtgHdr - (intptr_t)&pVtgHdr->paProbes[i]); 324 return VERR_SUPDRV_VTG_BAD_PROBE; 325 } 317 326 318 327 /* The referenced argument list. */ … … 320 329 if (pArgList->cArgs > 16) 321 330 { 322 SUPR0Printf("supdrvVtgValidate: VERR_SUPDRV_TRACER_BAD_ARG_FLAGS - iProbe=%u cArgs=%u\n", i, pArgList-> fHaveLargeArgs, pArgList->cArgs);331 SUPR0Printf("supdrvVtgValidate: VERR_SUPDRV_TRACER_BAD_ARG_FLAGS - iProbe=%u cArgs=%u\n", i, pArgList->cArgs); 323 332 return VERR_SUPDRV_VTG_BAD_ARGLIST; 324 333 }
Note:
See TracChangeset
for help on using the changeset viewer.