Changeset 19181 in vbox for trunk/src/VBox
- Timestamp:
- Apr 24, 2009 6:36:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/DBGFDisas.cpp
r18927 r19181 292 292 293 293 /** 294 * Disassembles the one instruction according to the specified flags and address. 295 * 296 * @returns VBox status code. 297 * @param pVM VM handle. 298 * @param pVCpu VMCPU handle. 294 * Disassembles the one instruction according to the specified flags and 295 * address, internal worker executing on the EMT of the specified virtual CPU. 296 * 297 * @returns VBox status code. 298 * @param pVM The VM handle. 299 * @param pVCpu The virtual CPU handle. 299 300 * @param Sel The code selector. This used to determin the 32/16 bit ness and 300 301 * calculation of the actual instruction address. 301 * @param GCPtr The code address relative to the base of Sel. 302 * @param pGCPtr Pointer to the variable holding the code address 303 * relative to the base of Sel. 302 304 * @param fFlags Flags controlling where to start and how to format. 303 305 * A combination of the DBGF_DISAS_FLAGS_* \#defines. … … 306 308 * @param pcbInstr Where to return the size of the instruction. 307 309 */ 308 VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr, unsigned fFlags, char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr)309 { 310 /* If not specified, assume CPU 0. */311 if (!pVCpu) 312 pVCpu = &pVM->aCpus[0];310 static DECLCALLBACK(int) 311 dbgfR3DisasInstrExOnVCpu(PVM pVM, PVMCPU pVCpu, RTSEL Sel, PRTGCPTR pGCPtr, unsigned fFlags, 312 char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr) 313 { 314 RTGCPTR GCPtr = *pGCPtr; 313 315 314 316 /* … … 514 516 515 517 /** 518 * Disassembles the one instruction according to the specified flags and address. 519 * 520 * @returns VBox status code. 521 * @param pVM VM handle. 522 * @param pVCpu The virtual CPU handle, defaults to CPU 0 if NULL. 523 * @param Sel The code selector. This used to determin the 32/16 bit ness and 524 * calculation of the actual instruction address. 525 * @param GCPtr The code address relative to the base of Sel. 526 * @param fFlags Flags controlling where to start and how to format. 527 * A combination of the DBGF_DISAS_FLAGS_* \#defines. 528 * @param pszOutput Output buffer. 529 * @param cchOutput Size of the output buffer. 530 * @param pcbInstr Where to return the size of the instruction. 531 * 532 * @remarks May have to switch to the EMT of the virtual CPU in order to do 533 * address conversion. 534 */ 535 VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr, unsigned fFlags, 536 char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr) 537 { 538 /* If not specified, assume CPU 0. */ 539 if (!pVCpu) 540 pVCpu = &pVM->aCpus[0]; 541 542 int rc; 543 if (VMCPU_IS_EMT(pVCpu)) /* not necessary, but it's faster. */ 544 rc = dbgfR3DisasInstrExOnVCpu(pVM, pVCpu, Sel, &GCPtr, fFlags, pszOutput, cchOutput, pcbInstr); 545 else 546 { 547 PVMREQ pReq = NULL; 548 rc = VMR3ReqCall(pVCpu->pVMR3, VMREQDEST_FROM_VMCPU(pVCpu), &pReq, RT_INDEFINITE_WAIT, 549 (PFNRT)dbgfR3DisasInstrExOnVCpu, 8, 550 pVM, pVCpu, Sel, &GCPtr, fFlags, pszOutput, cchOutput, pcbInstr); 551 if (RT_SUCCESS(rc)) 552 { 553 rc = pReq->iStatus; 554 VMR3ReqFree(pReq); 555 } 556 } 557 return rc; 558 } 559 560 561 /** 516 562 * Disassembles an instruction. 517 563 * Addresses will be tried resolved to symbols 518 564 * 519 565 * @returns VBox status code. 520 * @param 521 * @param pVCpu VMCPU handle.522 * @param 523 * 524 * @param 525 * @param 526 * @param 566 * @param pVM VM handle. 567 * @param pVCpu The virtual CPU handle, defaults to CPU 0 if NULL. 568 * @param Sel The code selector. This used to determin the 32/16 bit ness and 569 * calculation of the actual instruction address. 570 * @param GCPtr The code address relative to the base of Sel. 571 * @param pszOutput Output buffer. 572 * @param cchOutput Size of the output buffer. 527 573 */ 528 574 VMMR3DECL(int) DBGFR3DisasInstr(PVM pVM, PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr, char *pszOutput, uint32_t cchOutput) … … 537 583 * 538 584 * @returns VBox status code. 539 * @param 540 * @param 541 * @param 585 * @param pVM VM handle. 586 * @param pszOutput Output buffer. 587 * @param cchOutput Size of the output buffer. 542 588 */ 543 589 VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVM pVM, char *pszOutput, uint32_t cchOutput) … … 552 598 * 553 599 * @returns VBox status code. 554 * @param 555 * @param 600 * @param pVM VM handle. 601 * @param pszPrefix Short prefix string to the dissassembly string. (optional) 556 602 */ 557 603 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVM pVM, const char *pszPrefix) … … 576 622 * 577 623 * @returns VBox status code. 578 * @param 579 * @param pVCpu VMCPU handle.580 * @param 581 * 582 * @param 624 * @param pVM VM handle. 625 * @param pVCpu The virtual CPU handle, defaults to CPU 0 if NULL. 626 * @param Sel The code selector. This used to determin the 32/16 bit-ness and 627 * calculation of the actual instruction address. 628 * @param GCPtr The code address relative to the base of Sel. 583 629 */ 584 630 VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVM pVM, PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr)
Note:
See TracChangeset
for help on using the changeset viewer.