Changeset 2250 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 19, 2007 11:38:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/DBGFInfo.cpp
r23 r2250 183 183 * @param pszName The identifier of the info. 184 184 * @param pszDesc The description of the info and any arguments the handler may take. 185 * @param fFlags The flags. 185 186 * @param ppInfo Where to store the created 186 187 */ 187 static int dbgfR3InfoRegister(PVM pVM, const char *pszName, const char *pszDesc, PDBGFINFO *ppInfo)188 static int dbgfR3InfoRegister(PVM pVM, const char *pszName, const char *pszDesc, uint32_t fFlags, PDBGFINFO *ppInfo) 188 189 { 189 190 /* 190 191 * Validate. 191 192 */ 192 if (!pszName) 193 { 194 AssertMsgFailed(("!pszName\n")); 195 return VERR_INVALID_PARAMETER; 196 } 197 if (!pszDesc) 198 { 199 AssertMsgFailed(("!pszDesc\n")); 200 return VERR_INVALID_PARAMETER; 201 } 193 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 194 AssertReturn(*pszName, VERR_INVALID_PARAMETER); 195 AssertPtrReturn(pszDesc, VERR_INVALID_POINTER); 196 AssertMsgReturn(!(fFlags & ~(DBGFINFO_FLAGS_RUN_ON_EMT)), ("fFlags=%#x\n", fFlags), VERR_INVALID_PARAMETER); 202 197 203 198 /* … … 210 205 { 211 206 pInfo->enmType = DBGFINFOTYPE_INVALID; 207 pInfo->fFlags = fFlags; 212 208 pInfo->pszDesc = pszDesc; 213 209 pInfo->cchName = cchName - 1; … … 280 276 */ 281 277 PDBGFINFO pInfo; 282 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, &pInfo);278 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo); 283 279 if (VBOX_SUCCESS(rc)) 284 280 { … … 326 322 */ 327 323 PDBGFINFO pInfo; 328 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, &pInfo);324 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo); 329 325 if (VBOX_SUCCESS(rc)) 330 326 { … … 350 346 DBGFR3DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler) 351 347 { 352 LogFlow(("DBGFR3InfoRegisterInternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p\n", 353 pszName, pszName, pszDesc, pszDesc, pfnHandler)); 348 return DBGFR3InfoRegisterInternalEx(pVM, pszName, pszDesc, pfnHandler, 0); 349 } 350 351 352 /** 353 * Register a info handler owned by an internal component. 354 * 355 * @returns VBox status code. 356 * @param pVM VM handle. 357 * @param pszName The identifier of the info. 358 * @param pszDesc The description of the info and any arguments the handler may take. 359 * @param pfnHandler The handler function to be called to display the info. 360 * @param fFlags Flags, see the DBGFINFO_FLAGS_*. 361 */ 362 DBGFR3DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags) 363 { 364 LogFlow(("DBGFR3InfoRegisterInternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p fFlags=%x\n", 365 pszName, pszName, pszDesc, pszDesc, pfnHandler, fFlags)); 354 366 355 367 /* … … 366 378 */ 367 379 PDBGFINFO pInfo; 368 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, &pInfo);380 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, fFlags, &pInfo); 369 381 if (VBOX_SUCCESS(rc)) 370 382 { … … 407 419 */ 408 420 PDBGFINFO pInfo; 409 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, &pInfo);421 int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo); 410 422 if (VBOX_SUCCESS(rc)) 411 423 { … … 700 712 AssertRC(rc); 701 713 rc = VINF_SUCCESS; 714 PVMREQ pReq = NULL; 702 715 switch (Info.enmType) 703 716 { 704 717 case DBGFINFOTYPE_DEV: 705 Info.u.Dev.pfnHandler(Info.u.Dev.pDevIns, pHlp, pszArgs); 718 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 719 rc = VMR3ReqCallVoid(pVM, &pReq, RT_INDEFINITE_WAIT, (PFNRT)Info.u.Dev.pfnHandler, 3, Info.u.Dev.pDevIns, pHlp, pszArgs); 720 else 721 Info.u.Dev.pfnHandler(Info.u.Dev.pDevIns, pHlp, pszArgs); 706 722 break; 723 707 724 case DBGFINFOTYPE_DRV: 708 Info.u.Drv.pfnHandler(Info.u.Drv.pDrvIns, pHlp, pszArgs); 725 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 726 rc = VMR3ReqCallVoid(pVM, &pReq, RT_INDEFINITE_WAIT, (PFNRT)Info.u.Drv.pfnHandler, 3, Info.u.Drv.pDrvIns, pHlp, pszArgs); 727 else 728 Info.u.Drv.pfnHandler(Info.u.Drv.pDrvIns, pHlp, pszArgs); 709 729 break; 730 710 731 case DBGFINFOTYPE_INT: 711 Info.u.Int.pfnHandler(pVM, pHlp, pszArgs); 732 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 733 rc = VMR3ReqCallVoid(pVM, &pReq, RT_INDEFINITE_WAIT, (PFNRT)Info.u.Int.pfnHandler, 3, pVM, pHlp, pszArgs); 734 else 735 Info.u.Int.pfnHandler(pVM, pHlp, pszArgs); 712 736 break; 737 713 738 case DBGFINFOTYPE_EXT: 714 Info.u.Ext.pfnHandler(Info.u.Ext.pvUser, pHlp, pszArgs); 739 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 740 rc = VMR3ReqCallVoid(pVM, &pReq, RT_INDEFINITE_WAIT, (PFNRT)Info.u.Ext.pfnHandler, 3, Info.u.Ext.pvUser, pHlp, pszArgs); 741 else 742 Info.u.Ext.pfnHandler(Info.u.Ext.pvUser, pHlp, pszArgs); 715 743 break; 744 716 745 default: 717 746 AssertMsgFailed(("Invalid info type enmType=%d\n", Info.enmType)); … … 719 748 break; 720 749 } 750 VMR3ReqFree(pReq); 721 751 } 722 752 else
Note:
See TracChangeset
for help on using the changeset viewer.