VirtualBox

Changeset 12663 in vbox


Ignore:
Timestamp:
Sep 23, 2008 10:16:45 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
36956
Message:

#1865: DBGF, nothing really relevant here just some cleaning up.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/dbgf.h

    r9387 r12663  
    5050 * @{
    5151 */
    52 
    53 /**
    54  * \#DB (Debug event) handler.
    55  *
    56  * @returns VBox status code.
    57  *          VINF_SUCCESS means we completely handled this trap,
    58  *          other codes are passed execution to host context.
    59  *
    60  * @param   pVM         The VM handle.
    61  * @param   pRegFrame   Pointer to the register frame for the trap.
    62  * @param   uDr6        The DR6 register value.
    63  */
    6452DBGFGCDECL(int) DBGFGCTrap01Handler(PVM pVM, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6);
    65 
    66 /**
    67  * \#BP (Breakpoint) handler.
    68  *
    69  * @returns VBox status code.
    70  *          VINF_SUCCESS means we completely handled this trap,
    71  *          other codes are passed execution to host context.
    72  *
    73  * @param   pVM         The VM handle.
    74  * @param   pRegFrame   Pointer to the register frame for the trap.
    75  */
    7653DBGFGCDECL(int) DBGFGCTrap03Handler(PVM pVM, PCPUMCTXCORE pRegFrame);
    77 
    7854/** @} */
    7955#endif
     
    8460 * @{
    8561 */
    86 
    87 /**
    88  * \#DB (Debug event) handler.
    89  *
    90  * @returns VBox status code.
    91  *          VINF_SUCCESS means we completely handled this trap,
    92  *          other codes are passed execution to host context.
    93  *
    94  * @param   pVM         The VM handle.
    95  * @param   pRegFrame   Pointer to the register frame for the trap.
    96  * @param   uDr6        The DR6 register value.
    97  */
    9862DBGFR0DECL(int) DBGFR0Trap01Handler(PVM pVM, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6);
    99 
    100 /**
    101  * \#BP (Breakpoint) handler.
    102  *
    103  * @returns VBox status code.
    104  *          VINF_SUCCESS means we completely handled this trap,
    105  *          other codes are passed execution to host context.
    106  *
    107  * @param   pVM         The VM handle.
    108  * @param   pRegFrame   Pointer to the register frame for the trap.
    109  */
    11063DBGFR0DECL(int) DBGFR0Trap03Handler(PVM pVM, PCPUMCTXCORE pRegFrame);
    111 
    11264/** @} */
    11365#endif
     
    11668
    11769/**
    118  *  Mixed address.
     70 * Mixed address.
    11971 */
    12072typedef struct DBGFADDRESS
     
    172124/** @} */
    173125
    174 /**
    175  * Creates a mixed address from a Sel:off pair.
    176  *
    177  * @returns VBox status code.
    178  * @param   pVM         The VM handle.
    179  * @param   pAddress    Where to store the mixed address.
    180  * @param   Sel         The selector part.
    181  * @param   off         The offset part.
    182  */
    183126DBGFR3DECL(int) DBGFR3AddrFromSelOff(PVM pVM, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off);
    184 
    185 /**
    186  * Creates a mixed address from a flat address.
    187  *
    188  * @returns pAddress.
    189  * @param   pVM         The VM handle.
    190  * @param   pAddress    Where to store the mixed address.
    191  * @param   FlatPtr     The flat pointer.
    192  */
    193127DBGFR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr);
    194 
    195 /**
    196  * Creates a mixed address from a guest physical address.
    197  *
    198  * @param   pVM         The VM handle.
    199  * @param   pAddress    Where to store the mixed address.
    200  * @param   PhysAddr    The guest physical address.
    201  */
    202128DBGFR3DECL(void) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr);
    203 
    204 /**
    205  * Checks if the specified address is valid (checks the structure pointer too).
    206  *
    207  * @returns true if valid.
    208  * @returns false if invalid.
    209  * @param   pVM         The VM handle.
    210  * @param   pAddress    The address to validate.
    211  */
    212129DBGFR3DECL(bool) DBGFR3AddrIsValid(PVM pVM, PCDBGFADDRESS pAddress);
    213130
     
    366283#endif
    367284
    368 /**
    369  * Initializes the DBGF.
    370  *
    371  * @returns VBox status code.
    372  * @param   pVM     VM handle.
    373  */
    374 DBGFR3DECL(int) DBGFR3Init(PVM pVM);
    375 
    376 /**
    377  * Termiantes and cleans up resources allocated by the DBGF.
    378  *
    379  * @returns VBox status code.
    380  * @param   pVM     VM Handle.
    381  */
    382 DBGFR3DECL(int) DBGFR3Term(PVM pVM);
    383 
    384 /**
    385  * Applies relocations to data and code managed by this
    386  * component. This function will be called at init and
    387  * whenever the VMM need to relocate it self inside the GC.
    388  *
    389  * @param   pVM         VM handle.
    390  * @param   offDelta    Relocation delta relative to old location.
    391  */
    392 DBGFR3DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta);
    393 
    394 /**
    395  * Forced action callback.
    396  * The VMM will call this from it's main loop when VM_FF_DBGF is set.
    397  *
    398  * The function checks and executes pending commands from the debugger.
    399  *
    400  * @returns VINF_SUCCESS normally.
    401  * @returns VERR_DBGF_RAISE_FATAL_ERROR to pretend a fatal error happend.
    402  * @param   pVM         VM Handle.
    403  */
    404 DBGFR3DECL(int) DBGFR3VMMForcedAction(PVM pVM);
    405 
    406 /**
    407  * Send a generic debugger event which takes no data.
    408  *
    409  * @returns VBox status.
    410  * @param   pVM         The VM handle.
    411  * @param   enmEvent    The event to send.
    412  */
    413 DBGFR3DECL(int) DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent);
    414 
    415 /**
    416  * Send a debugger event which takes the full source file location.
    417  *
    418  * @returns VBox status.
    419  * @param   pVM         The VM handle.
    420  * @param   enmEvent    The event to send.
    421  * @param   pszFile     Source file.
    422  * @param   uLine       Line number in source file.
    423  * @param   pszFunction Function name.
    424  * @param   pszFormat   Message which accompanies the event.
    425  * @param   ...         Message arguments.
    426  */
    427 DBGFR3DECL(int) DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, ...);
    428 
    429 /**
    430  * Send a debugger event which takes the full source file location.
    431  *
    432  * @returns VBox status.
    433  * @param   pVM         The VM handle.
    434  * @param   enmEvent    The event to send.
    435  * @param   pszFile     Source file.
    436  * @param   uLine       Line number in source file.
    437  * @param   pszFunction Function name.
    438  * @param   pszFormat   Message which accompanies the event.
    439  * @param   args        Message arguments.
    440  */
    441 DBGFR3DECL(int) DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, va_list args);
    442 
    443 /**
    444  * Send a debugger event which takes the two assertion messages.
    445  *
    446  * @returns VBox status.
    447  * @param   pVM         The VM handle.
    448  * @param   enmEvent    The event to send.
    449  * @param   pszMsg1     First assertion message.
    450  * @param   pszMsg2     Second assertion message.
    451  */
    452 DBGFR3DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
    453 
    454 /**
    455  * Breakpoint was hit somewhere.
    456  * Figure out which breakpoint it is and notify the debugger.
    457  *
    458  * @returns VBox status.
    459  * @param   pVM         The VM handle.
    460  * @param   enmEvent    DBGFEVENT_BREAKPOINT_HYPER or DBGFEVENT_BREAKPOINT.
    461  */
    462 DBGFR3DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent);
    463 
    464 /**
    465  * Attaches a debugger to the specified VM.
    466  *
    467  * Only one debugger at a time.
    468  *
    469  * @returns VBox status code.
    470  * @param   pVM     VM Handle.
    471  */
    472 DBGFR3DECL(int) DBGFR3Attach(PVM pVM);
    473 
    474 /**
    475  * Detaches a debugger from the specified VM.
    476  *
    477  * Caller must be attached to the VM.
    478  *
    479  * @returns VBox status code.
    480  * @param   pVM     VM Handle.
    481  */
    482 DBGFR3DECL(int) DBGFR3Detach(PVM pVM);
    483 
    484 /**
    485  * Wait for a debug event.
    486  *
    487  * @returns VBox status. Will not return VBOX_INTERRUPTED.
    488  * @param   pVM         VM handle.
    489  * @param   cMillies    Number of millies to wait.
    490  * @param   ppEvent     Where to store the event pointer.
    491  */
    492 DBGFR3DECL(int) DBGFR3EventWait(PVM pVM, unsigned cMillies, PCDBGFEVENT *ppEvent);
    493 
    494 /**
    495  * Halts VM execution.
    496  *
    497  * After calling this the VM isn't actually halted till an DBGFEVENT_HALT_DONE
    498  * arrives. Until that time it's not possible to issue any new commands.
    499  *
    500  * @returns VBox status.
    501  * @param   pVM     VM handle.
    502  */
    503 DBGFR3DECL(int) DBGFR3Halt(PVM pVM);
    504 
    505 /**
    506  * Checks if the VM is halted by the debugger.
    507  *
    508  * @returns True if halted.
    509  * @returns False if not halted.
    510  * @param   pVM     VM handle.
    511  */
    512 DBGFR3DECL(bool) DBGFR3IsHalted(PVM pVM);
    513 
    514 /**
    515  * Checks if the the debugger can wait for events or not.
    516  *
    517  * This function is only used by lazy, multiplexing debuggers. :-)
    518  *
    519  * @returns True if waitable.
    520  * @returns False if not waitable.
    521  * @param   pVM     VM handle.
    522  */
    523 DBGFR3DECL(bool) DBGFR3CanWait(PVM pVM);
    524 
    525 /**
    526  * Resumes VM execution.
    527  *
    528  * There is no receipt event on this command.
    529  *
    530  * @returns VBox status.
    531  * @param   pVM     VM handle.
    532  */
    533 DBGFR3DECL(int) DBGFR3Resume(PVM pVM);
    534 
    535 /**
    536  * Step Into.
    537  *
    538  * A single step event is generated from this command.
    539  * The current implementation is not reliable, so don't rely on the event comming.
    540  *
    541  * @returns VBox status.
    542  * @param   pVM     VM handle.
    543  */
    544 DBGFR3DECL(int) DBGFR3Step(PVM pVM);
    545 
    546 /**
    547  * Call this to single step rawmode or recompiled mode.
    548  *
    549  * You must pass down the return code to the EM loop! That's
    550  * where the actual single stepping take place (at least in the
    551  * current implementation).
    552  *
    553  * @returns VINF_EM_DBG_STEP
    554  * @thread  EMT
    555  */
    556 DBGFR3DECL(int) DBGFR3PrgStep(PVM pVM);
     285DBGFR3DECL(int)     DBGFR3Init(PVM pVM);
     286DBGFR3DECL(int)     DBGFR3Term(PVM pVM);
     287DBGFR3DECL(void)    DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta);
     288DBGFR3DECL(int)     DBGFR3VMMForcedAction(PVM pVM);
     289DBGFR3DECL(int)     DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent);
     290DBGFR3DECL(int)     DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, ...);
     291DBGFR3DECL(int)     DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, va_list args);
     292DBGFR3DECL(int)     DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
     293DBGFR3DECL(int)     DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent);
     294DBGFR3DECL(int)     DBGFR3Attach(PVM pVM);
     295DBGFR3DECL(int)     DBGFR3Detach(PVM pVM);
     296DBGFR3DECL(int)     DBGFR3EventWait(PVM pVM, unsigned cMillies, PCDBGFEVENT *ppEvent);
     297DBGFR3DECL(int)     DBGFR3Halt(PVM pVM);
     298DBGFR3DECL(bool)    DBGFR3IsHalted(PVM pVM);
     299DBGFR3DECL(bool)    DBGFR3CanWait(PVM pVM);
     300DBGFR3DECL(int)     DBGFR3Resume(PVM pVM);
     301DBGFR3DECL(int)     DBGFR3Step(PVM pVM);
     302DBGFR3DECL(int)     DBGFR3PrgStep(PVM pVM);
    557303
    558304
     
    637383
    638384
    639 /**
    640  * Sets a breakpoint (int 3 based).
    641  *
    642  * @returns VBox status code.
    643  * @param   pVM         The VM handle.
    644  * @param   pAddress    The address of the breakpoint.
    645  * @param   iHitTrigger The hit count at which the breakpoint start triggering.
    646  *                      Use 0 (or 1) if it's gonna trigger at once.
    647  * @param   iHitDisable The hit count which disables the breakpoint.
    648  *                      Use ~(uint64_t) if it's never gonna be disabled.
    649  * @param   piBp        Where to store the breakpoint id. (optional)
    650  * @thread  Any thread.
    651  */
    652 DBGFR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp);
    653 
    654 /**
    655  * Sets a register breakpoint.
    656  *
    657  * @returns VBox status code.
    658  * @param   pVM         The VM handle.
    659  * @param   pAddress    The address of the breakpoint.
    660  * @param   iHitTrigger The hit count at which the breakpoint start triggering.
    661  *                      Use 0 (or 1) if it's gonna trigger at once.
    662  * @param   iHitDisable The hit count which disables the breakpoint.
    663  *                      Use ~(uint64_t) if it's never gonna be disabled.
    664  * @param   fType       The access type (one of the X86_DR7_RW_* defines).
    665  * @param   cb          The access size - 1,2,4 or 8 (the latter is AMD64 long mode only.
    666  *                      Must be 1 if fType is X86_DR7_RW_EO.
    667  * @param   piBp        Where to store the breakpoint id. (optional)
    668  * @thread  Any thread.
    669  */
    670 DBGFR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
    671                                uint8_t fType, uint8_t cb, PRTUINT piBp);
    672 
    673 /**
    674  * Sets a recompiler breakpoint.
    675  *
    676  * @returns VBox status code.
    677  * @param   pVM         The VM handle.
    678  * @param   pAddress    The address of the breakpoint.
    679  * @param   iHitTrigger The hit count at which the breakpoint start triggering.
    680  *                      Use 0 (or 1) if it's gonna trigger at once.
    681  * @param   iHitDisable The hit count which disables the breakpoint.
    682  *                      Use ~(uint64_t) if it's never gonna be disabled.
    683  * @param   piBp        Where to store the breakpoint id. (optional)
    684  * @thread  Any thread.
    685  */
    686 DBGFR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp);
    687 
    688 /**
    689  * Clears a breakpoint.
    690  *
    691  * @returns VBox status code.
    692  * @param   pVM         The VM handle.
    693  * @param   iBp         The id of the breakpoint which should be removed (cleared).
    694  * @thread  Any thread.
    695  */
    696 DBGFR3DECL(int) DBGFR3BpClear(PVM pVM, RTUINT iBp);
    697 
    698 /**
    699  * Enables a breakpoint.
    700  *
    701  * @returns VBox status code.
    702  * @param   pVM         The VM handle.
    703  * @param   iBp         The id of the breakpoint which should be enabled.
    704  * @thread  Any thread.
    705  */
    706 DBGFR3DECL(int) DBGFR3BpEnable(PVM pVM, RTUINT iBp);
    707 
    708 /**
    709  * Disables a breakpoint.
    710  *
    711  * @returns VBox status code.
    712  * @param   pVM         The VM handle.
    713  * @param   iBp         The id of the breakpoint which should be disabled.
    714  * @thread  Any thread.
    715  */
    716 DBGFR3DECL(int) DBGFR3BpDisable(PVM pVM, RTUINT iBp);
     385DBGFR3DECL(int)     DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp);
     386DBGFR3DECL(int)     DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
     387                                   uint8_t fType, uint8_t cb, PRTUINT piBp);
     388DBGFR3DECL(int)     DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp);
     389DBGFR3DECL(int)     DBGFR3BpClear(PVM pVM, RTUINT iBp);
     390DBGFR3DECL(int)     DBGFR3BpEnable(PVM pVM, RTUINT iBp);
     391DBGFR3DECL(int)     DBGFR3BpDisable(PVM pVM, RTUINT iBp);
    717392
    718393/**
     
    728403typedef FNDBGFBPENUM *PFNDBGFBPENUM;
    729404
    730 /**
    731  * Enumerate the breakpoints.
    732  *
    733  * @returns VBox status code.
    734  * @param   pVM         The VM handle.
    735  * @param   pfnCallback The callback function.
    736  * @param   pvUser      The user argument to pass to the callback.
    737  * @thread  Any thread but the callback will be called from EMT.
    738  */
    739 DBGFR3DECL(int) DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
    740 
    741 
    742 /**
    743  * Gets the hardware breakpoint configuration as DR7.
    744  *
    745  * @returns DR7 from the DBGF point of view.
    746  * @param   pVM         The VM handle.
    747  */
    748 DBGFDECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM);
    749 
    750 /**
    751  * Gets the address of the hardware breakpoint number 0.
    752  *
    753  * @returns DR0 from the DBGF point of view.
    754  * @param   pVM         The VM handle.
    755  */
    756 DBGFDECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM);
    757 
    758 /**
    759  * Gets the address of the hardware breakpoint number 1.
    760  *
    761  * @returns DR1 from the DBGF point of view.
    762  * @param   pVM         The VM handle.
    763  */
    764 DBGFDECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM);
    765 
    766 /**
    767  * Gets the address of the hardware breakpoint number 2.
    768  *
    769  * @returns DR2 from the DBGF point of view.
    770  * @param   pVM         The VM handle.
    771  */
    772 DBGFDECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM);
    773 
    774 /**
    775  * Gets the address of the hardware breakpoint number 3.
    776  *
    777  * @returns DR3 from the DBGF point of view.
    778  * @param   pVM         The VM handle.
    779  */
    780 DBGFDECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM);
    781 
    782 /**
    783  * Returns single stepping state
    784  *
    785  * @returns stepping or not
    786  * @param   pVM         The VM handle.
    787  */
    788 DBGFDECL(bool) DBGFIsStepping(PVM pVM);
     405DBGFR3DECL(int)         DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
     406DBGFDECL(RTGCUINTREG)   DBGFBpGetDR7(PVM pVM);
     407DBGFDECL(RTGCUINTREG)   DBGFBpGetDR0(PVM pVM);
     408DBGFDECL(RTGCUINTREG)   DBGFBpGetDR1(PVM pVM);
     409DBGFDECL(RTGCUINTREG)   DBGFBpGetDR2(PVM pVM);
     410DBGFDECL(RTGCUINTREG)   DBGFBpGetDR3(PVM pVM);
     411DBGFDECL(bool)          DBGFIsStepping(PVM pVM);
     412
     413
    789414
    790415
     
    870495/** @} */
    871496
    872 
    873 /**
    874  * Register a info handler owned by a device.
    875  *
    876  * @returns VBox status code.
    877  * @param   pVM         VM handle.
    878  * @param   pszName     The identifier of the info.
    879  * @param   pszDesc     The description of the info and any arguments the handler may take.
    880  * @param   pfnHandler  The handler function to be called to display the info.
    881  * @param   pDevIns     The device instance owning the info.
    882  */
    883497DBGFR3DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);
    884 
    885 /**
    886  * Register a info handler owned by a driver.
    887  *
    888  * @returns VBox status code.
    889  * @param   pVM         VM handle.
    890  * @param   pszName     The identifier of the info.
    891  * @param   pszDesc     The description of the info and any arguments the handler may take.
    892  * @param   pfnHandler  The handler function to be called to display the info.
    893  * @param   pDrvIns     The driver instance owning the info.
    894  */
    895498DBGFR3DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);
    896 
    897 /**
    898  * Register a info handler owned by an internal component.
    899  *
    900  * @returns VBox status code.
    901  * @param   pVM         VM handle.
    902  * @param   pszName     The identifier of the info.
    903  * @param   pszDesc     The description of the info and any arguments the handler may take.
    904  * @param   pfnHandler  The handler function to be called to display the info.
    905  */
    906499DBGFR3DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);
    907 
    908 /**
    909  * Register a info handler owned by an internal component.
    910  *
    911  * @returns VBox status code.
    912  * @param   pVM         VM handle.
    913  * @param   pszName     The identifier of the info.
    914  * @param   pszDesc     The description of the info and any arguments the handler may take.
    915  * @param   pfnHandler  The handler function to be called to display the info.
    916  * @param   fFlags      Flags, see the DBGFINFO_FLAGS_*.
    917  */
    918500DBGFR3DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags);
    919 
    920 /**
    921  * Register a info handler owned by an external component.
    922  *
    923  * @returns VBox status code.
    924  * @param   pVM         VM handle.
    925  * @param   pszName     The identifier of the info.
    926  * @param   pszDesc     The description of the info and any arguments the handler may take.
    927  * @param   pfnHandler  The handler function to be called to display the info.
    928  * @param   pvUser      User argument to be passed to the handler.
    929  */
    930501DBGFR3DECL(int) DBGFR3InfoRegisterExternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser);
    931 
    932 /**
    933  * Deregister one(/all) info handler(s) owned by a device.
    934  *
    935  * @returns VBox status code.
    936  * @param   pVM         VM Handle.
    937  * @param   pDevIns     Device instance.
    938  * @param   pszName     The identifier of the info. If NULL all owned by the device.
    939  */
    940502DBGFR3DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName);
    941 
    942 /**
    943  * Deregister one(/all) info handler(s) owned by a driver.
    944  *
    945  * @returns VBox status code.
    946  * @param   pVM         VM Handle.
    947  * @param   pDrvIns     Driver instance.
    948  * @param   pszName     The identifier of the info. If NULL all owned by the driver.
    949  */
    950503DBGFR3DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);
    951 
    952 /**
    953  * Deregister a info handler owned by an internal component.
    954  *
    955  * @returns VBox status code.
    956  * @param   pVM         VM Handle.
    957  * @param   pszName     The identifier of the info. If NULL all owned by the device.
    958  */
    959504DBGFR3DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName);
    960 
    961 /**
    962  * Deregister a info handler owned by an external component.
    963  *
    964  * @returns VBox status code.
    965  * @param   pVM         VM Handle.
    966  * @param   pszName     The identifier of the info. If NULL all owned by the device.
    967  */
    968505DBGFR3DECL(int) DBGFR3InfoDeregisterExternal(PVM pVM, const char *pszName);
    969 
    970 /**
    971  * Display a piece of info writing to the supplied handler.
    972  *
    973  * @returns VBox status code.
    974  * @param   pVM         VM handle.
    975  * @param   pszName     The identifier of the info to display.
    976  * @param   pszArgs     Arguments to the info handler.
    977  * @param   pHlp        The output helper functions. If NULL the logger will be used.
    978  */
    979506DBGFR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
    980507
     
    996523#endif
    997524
    998 
    999 /**
    1000  * Changes the logger group settings.
    1001  *
    1002  * @returns VBox status code.
    1003  * @param   pVM                 The VM handle.
    1004  * @param   pszGroupSettings    The group settings string. (VBOX_LOG)
    1005  */
    1006 DBGFR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings);
    1007 
    1008 /**
    1009  * Changes the logger flag settings.
    1010  *
    1011  * @returns VBox status code.
    1012  * @param   pVM                 The VM handle.
    1013  * @param   pszFlagSettings     The flag settings string. (VBOX_LOG_FLAGS)
    1014  */
    1015 DBGFR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings);
    1016 
    1017 /**
    1018  * Changes the logger destination settings.
    1019  *
    1020  * @returns VBox status code.
    1021  * @param   pVM                 The VM handle.
    1022  * @param   pszDestSettings     The destination settings string. (VBOX_LOG_DEST)
    1023  */
    1024 DBGFR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings);
    1025 
    1026 
    1027525/**
    1028526 * Enumeration callback for use with DBGFR3InfoEnum.
     
    1039537typedef FNDBGFINFOENUM *PFNDBGFINFOENUM;
    1040538
    1041 /**
    1042  * Enumerate all the register info handlers.
    1043  *
    1044  * @returns VBox status code.
    1045  * @param   pVM             VM handle.
    1046  * @param   pfnCallback     Pointer to callback function.
    1047  * @param   pvUser          User argument to pass to the callback.
    1048  */
    1049539DBGFR3DECL(int) DBGFR3InfoEnum(PVM pVM, PFNDBGFINFOENUM pfnCallback, void *pvUser);
    1050 
    1051 /**
    1052  * Gets the logger info helper.
    1053  * The returned info helper will unconditionally write all output to the log.
    1054  *
    1055  * @returns Pointer to the logger info helper.
    1056  */
    1057540DBGFR3DECL(PCDBGFINFOHLP) DBGFR3InfoLogHlp(void);
    1058 
    1059 /**
    1060  * Gets the release logger info helper.
    1061  * The returned info helper will unconditionally write all output to the release log.
    1062  *
    1063  * @returns Pointer to the release logger info helper.
    1064  */
    1065541DBGFR3DECL(PCDBGFINFOHLP) DBGFR3InfoLogRelHlp(void);
     542
     543
     544
     545DBGFR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings);
     546DBGFR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings);
     547DBGFR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings);
    1066548
    1067549
     
    1106588typedef const DBGFLINE *PCDBGFLINE;
    1107589
    1108 
    1109 /**
    1110  * Load debug info, optionally related to a specific module.
    1111  *
    1112  * @returns VBox status.
    1113  * @param   pVM             VM Handle.
    1114  * @param   pszFilename     Path to the file containing the symbol information.
    1115  *                          This can be the executable image, a flat symbol file of some kind or stripped debug info.
    1116  * @param   AddressDelta    The value to add to the loaded symbols.
    1117  * @param   pszName         Short hand name for the module. If not related to a module specify NULL.
    1118  * @param   Address         Address which the image is loaded at. This will be used to reference the module other places in the api.
    1119  *                          Ignored when pszName is NULL.
    1120  * @param   cbImage         Size of the image.
    1121  *                          Ignored when pszName is NULL.
    1122  */
    1123 DBGFR3DECL(int) DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage);
    1124 
    1125 /**
    1126  * Interface used by PDMR3LdrRelocate for telling us that a GC module has been relocated.
    1127  *
    1128  * @param   pVM             The VM handle.
    1129  * @param   OldImageBase    The old image base.
    1130  * @param   NewImageBase    The new image base.
    1131  * @param   cbImage         The image size.
    1132  * @param   pszFilename     The image filename.
    1133  * @param   pszName         The module name.
    1134  */
    1135 DBGFR3DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, unsigned cbImage,
    1136                                       const char *pszFilename, const char *pszName);
    1137 
    1138 /**
    1139  * Adds a symbol to the debug info manager.
    1140  *
    1141  * @returns VBox status.
    1142  * @param   pVM             VM Handle.
    1143  * @param   ModuleAddress   Module address. Use 0 if no module.
    1144  * @param   SymbolAddress   Symbol address
    1145  * @param   cbSymbol        Size of the symbol. Use 0 if info not available.
    1146  * @param   pszSymbol       Symbol name.
    1147  */
    1148 DBGFR3DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol);
    1149 
    1150 /**
    1151  * Find symbol by address (nearest).
    1152  *
    1153  * @returns VBox status.
    1154  * @param   pVM                 VM handle.
    1155  * @param   Address             Address.
    1156  * @param   poffDisplacement    Where to store the symbol displacement from Address.
    1157  * @param   pSymbol             Where to store the symbol info.
    1158  */
    1159 DBGFR3DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol);
    1160 
    1161 /**
    1162  * Find symbol by name (first).
    1163  *
    1164  * @returns VBox status.
    1165  * @param   pVM                 VM handle.
    1166  * @param   pszSymbol           Symbol name.
    1167  * @param   pSymbol             Where to store the symbol info.
    1168  */
    1169 DBGFR3DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol);
    1170 
    1171 /**
    1172  * Find symbol by address (nearest), allocate return buffer.
    1173  *
    1174  * @returns Pointer to the symbol. Must be freed using DBGFR3SymbolFree().
    1175  * @returns NULL if the symbol was not found or if we're out of memory.
    1176  * @param   pVM                 VM handle.
    1177  * @param   Address             Address.
    1178  * @param   poffDisplacement    Where to store the symbol displacement from Address.
    1179  */
     590DBGFR3DECL(int)         DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage);
     591DBGFR3DECL(void)        DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, unsigned cbImage,
     592                                             const char *pszFilename, const char *pszName);
     593DBGFR3DECL(int)         DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol);
     594DBGFR3DECL(int)         DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol);
     595DBGFR3DECL(int)         DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol);
    1180596DBGFR3DECL(PDBGFSYMBOL) DBGFR3SymbolByAddrAlloc(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);
    1181 
    1182 /**
    1183  * Find symbol by name (first), allocate return buffer.
    1184  *
    1185  * @returns Pointer to the symbol. Must be freed using DBGFR3SymbolFree().
    1186  * @returns NULL if the symbol was not found or if we're out of memory.
    1187  * @param   pVM                 VM handle.
    1188  * @param   pszSymbol           Symbol name.
    1189  * @param   ppSymbol            Where to store the pointer to the symbol info.
    1190  */
    1191597DBGFR3DECL(PDBGFSYMBOL) DBGFR3SymbolByNameAlloc(PVM pVM, const char *pszSymbol);
    1192 
    1193 /**
    1194  * Frees a symbol returned by DBGFR3SymbolbyNameAlloc() or DBGFR3SymbolByAddressAlloc().
    1195  *
    1196  * @param   pSymbol         Pointer to the symbol.
    1197  */
    1198 DBGFR3DECL(void) DBGFR3SymbolFree(PDBGFSYMBOL pSymbol);
    1199 
    1200 /**
    1201  * Find line by address (nearest).
    1202  *
    1203  * @returns VBox status.
    1204  * @param   pVM                 VM handle.
    1205  * @param   Address             Address.
    1206  * @param   poffDisplacement    Where to store the line displacement from Address.
    1207  * @param   pLine               Where to store the line info.
    1208  */
    1209 DBGFR3DECL(int) DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine);
    1210 
    1211 /**
    1212  * Find line by address (nearest), allocate return buffer.
    1213  *
    1214  * @returns Pointer to the line. Must be freed using DBGFR3LineFree().
    1215  * @returns NULL if the line was not found or if we're out of memory.
    1216  * @param   pVM                 VM handle.
    1217  * @param   Address             Address.
    1218  * @param   poffDisplacement    Where to store the line displacement from Address.
    1219  */
    1220 DBGFR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);
    1221 
    1222 /**
    1223  * Frees a line returned by DBGFR3LineByAddressAlloc().
    1224  *
    1225  * @param   pLine           Pointer to the line.
    1226  */
    1227 DBGFR3DECL(void) DBGFR3LineFree(PDBGFLINE pLine);
     598DBGFR3DECL(void)        DBGFR3SymbolFree(PDBGFSYMBOL pSymbol);
     599DBGFR3DECL(int)         DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine);
     600DBGFR3DECL(PDBGFLINE)   DBGFR3LineByAddrAlloc(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);
     601DBGFR3DECL(void)        DBGFR3LineFree(PDBGFLINE pLine);
     602
    1228603
    1229604/**
     
    1260635} DBGFRETURNTYPE;
    1261636
    1262 
    1263637/**
    1264638 * Figures the size of the return state on the stack.
     
    1365739/** @} */
    1366740
    1367 /**
    1368  * Begins a stack walk.
    1369  * This will construct and obtain the first frame.
    1370  *
    1371  * @returns VINF_SUCCESS on success.
    1372  * @returns VERR_NO_MEMORY if we're out of memory.
    1373  * @param   pVM         The VM handle.
    1374  * @param   pFrame      The stack frame info structure.
    1375  *                      On input this structure must be memset to zero.
    1376  *                      If wanted, the AddrPC, AddrStack and AddrFrame fields may be set
    1377  *                      to valid addresses after memsetting it. Any of those fields not set
    1378  *                      will be fetched from the guest CPU state.
    1379  *                      On output the structure will contain all the information we were able to
    1380  *                      obtain about the stack frame.
    1381  */
    1382741DBGFR3DECL(int) DBGFR3StackWalkBeginGuest(PVM pVM, PDBGFSTACKFRAME pFrame);
    1383 
    1384 /**
    1385  * Begins a stack walk.
    1386  * This will construct and obtain the first frame.
    1387  *
    1388  * @returns VINF_SUCCESS on success.
    1389  * @returns VERR_NO_MEMORY if we're out of memory.
    1390  * @param   pVM         The VM handle.
    1391  * @param   pFrame      The stack frame info structure.
    1392  *                      On input this structure must be memset to zero.
    1393  *                      If wanted, the AddrPC, AddrStack and AddrFrame fields may be set
    1394  *                      to valid addresses after memsetting it. Any of those fields not set
    1395  *                      will be fetched from the hypervisor CPU state.
    1396  *                      On output the structure will contain all the information we were able to
    1397  *                      obtain about the stack frame.
    1398  */
    1399742DBGFR3DECL(int) DBGFR3StackWalkBeginHyper(PVM pVM, PDBGFSTACKFRAME pFrame);
    1400 
    1401 /**
    1402  * Gets the next stack frame.
    1403  *
    1404  * @returns VINF_SUCCESS
    1405  * @returns VERR_NO_MORE_FILES if not more stack frames.
    1406  * @param   pVM         The VM handle.
    1407  * @param   pFrame      Pointer to the current frame on input, content is replaced with the next frame on successful return.
    1408  */
    1409743DBGFR3DECL(int) DBGFR3StackWalkNext(PVM pVM, PDBGFSTACKFRAME pFrame);
    1410 
    1411 /**
    1412  * Ends a stack walk process.
    1413  *
    1414  * This *must* be called after a successful first call to any of the stack
    1415  * walker functions. If not called we will leak memory or other resources.
    1416  *
    1417  * @param   pVM         The VM handle.
    1418  * @param   pFrame      The stackframe as returned by the last stack walk call.
    1419  */
    1420744DBGFR3DECL(void) DBGFR3StackWalkEnd(PVM pVM, PDBGFSTACKFRAME pFrame);
    1421745
     
    1442766#define DBGF_SEL_FLAT                       1
    1443767
    1444 /**
    1445  * Disassembles the one instruction according to the specified flags and address.
    1446  *
    1447  * @returns VBox status code.
    1448  * @param       pVM             VM handle.
    1449  * @param       Sel             The code selector. This used to determin the 32/16 bit ness and
    1450  *                              calculation of the actual instruction address.
    1451  *                              Use DBGF_SEL_FLAT for specifying a flat address.
    1452  * @param       GCPtr           The code address relative to the base of Sel.
    1453  * @param       fFlags          Flags controlling where to start and how to format.
    1454  *                              A combination of the DBGF_DISAS_FLAGS_* #defines.
    1455  * @param       pszOutput       Output buffer.
    1456  * @param       cchOutput       Size of the output buffer.
    1457  * @param       pcbInstr        Where to return the size of the instruction.
    1458  */
    1459768DBGFR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, RTSEL Sel, RTGCPTR GCPtr, unsigned fFlags, char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr);
    1460 
    1461 /**
    1462  * Disassembles the current instruction.
    1463  * Addresses will be tried resolved to symbols
    1464  *
    1465  * @returns VBox status code.
    1466  * @param       pVM             VM handle.
    1467  * @param       Sel             The code selector. This used to determin the 32/16 bit ness and
    1468  *                              calculation of the actual instruction address.
    1469  *                              Use DBGF_SEL_FLAT for specifying a flat address.
    1470  * @param       GCPtr           The code address relative to the base of Sel.
    1471  * @param       pszOutput       Output buffer.
    1472  * @param       cbOutput        Size of the output buffer.
    1473  */
    1474769DBGFR3DECL(int) DBGFR3DisasInstr(PVM pVM, RTSEL Sel, RTGCPTR GCPtr, char *pszOutput, uint32_t cbOutput);
    1475 
    1476 /**
    1477  * Disassembles the current instruction.
    1478  * All registers and data will be displayed. Addresses will be attempted resolved to symbols
    1479  *
    1480  * @returns VBox status code.
    1481  * @param       pVM             VM handle.
    1482  * @param       pszOutput       Output buffer.
    1483  * @param       cbOutput        Size of the output buffer.
    1484  */
    1485770DBGFR3DECL(int) DBGFR3DisasInstrCurrent(PVM pVM, char *pszOutput, uint32_t cbOutput);
    1486 
    1487 /**
    1488  * Disassembles the current guest context instruction and writes it to the log.
    1489  * All registers and data will be displayed. Addresses will be attempted resolved to symbols.
    1490  *
    1491  * @returns VBox status code.
    1492  * @param       pVM             VM handle.
    1493  * @param       pszPrefix       Short prefix string to the dissassembly string. (optional)
    1494  */
    1495771DBGFR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVM pVM, const char *pszPrefix);
    1496772
     
    1509785#endif
    1510786
    1511 /**
    1512  * Disassembles the specified guest context instruction and writes it to the log.
    1513  * Addresses will be attempted resolved to symbols.
    1514  *
    1515  * @returns VBox status code.
    1516  * @param       pVM             VM handle.
    1517  * @param       Sel             The code selector. This used to determin the 32/16 bit-ness and
    1518  *                              calculation of the actual instruction address.
    1519  * @param       GCPtr           The code address relative to the base of Sel.
    1520  */
    1521787DBGFR3DECL(int) DBGFR3DisasInstrLogInternal(PVM pVM, RTSEL Sel, RTGCPTR GCPtr);
    1522788
     
    1692958
    1693959#endif
     960
  • trunk/src/VBox/VMM/DBGF.cpp

    r11820 r12663  
    2121
    2222
    23 /** @page   pg_dbgf     DBGC - The Debugger Facility
    24  *
    25  * The purpose of the DBGC is to provide an interface for debuggers to manipulate
    26  * the VMM without having to mess up the source code for each of them. The DBGF
    27  * is always built in and will always work when a debugger attaches to the VM.
    28  * The DBGF provides the basic debugger features, such as halting execution,
    29  * handling breakpoints and single step execution.
     23/** @page   pg_dbgf     DBGF - The Debugger Facility
     24 *
     25 * The purpose of the DBGF is to provide an interface for debuggers to
     26 * manipulate the VMM without having to mess up the source code for each of
     27 * them. The DBGF is always built in and will always work when a debugger
     28 * attaches to the VM. The DBGF provides the basic debugger features, such as
     29 * halting execution, handling breakpoints, single step execution, instruction
     30 * disassembly, info querying, OS specific diggers, symbol and module
     31 * management.
    3032 *
    3133 * The interface is working in a manner similar to the win32, linux and os2
    3234 * debugger interfaces. It interface has an asynchronous nature. This comes from
    33  * the fact that the VMM and the Debugger are running in different threads.
    34  * They are refered to as the "emulation thread" and the "debugger thread",
    35  * or as the "ping thread" and the "pong thread, respectivly. (The last set
    36  * of names comes from the use of the Ping-Pong synchronization construct from
    37  * the RTSem API.)
    38  *
    39  *
    40  *
    41  * @section sec_dbgf_scenario   Debugger Scenario
     35 * the fact that the VMM and the Debugger are running in different threads. They
     36 * are refered to as the "emulation thread" and the "debugger thread", or as the
     37 * "ping thread" and the "pong thread, respectivly. (The last set of names comes
     38 * from the use of the Ping-Pong synchronization construct from the RTSem API.)
     39 *
     40 *
     41 *
     42 * @section sec_dbgf_scenario   Usage Scenario
    4243 *
    4344 * The debugger starts by attaching to the VM. For pratical reasons we limit the
    44  * number of concurrently attached debuggers to 1 per VM. The action of attaching
    45  * to the VM causes the VM to check and generate debug events.
     45 * number of concurrently attached debuggers to 1 per VM. The action of
     46 * attaching to the VM causes the VM to check and generate debug events.
    4647 *
    4748 * The debugger then will wait/poll for debug events and issue commands.
     
    5354 * An event can be a respons to an command issued previously, the hitting of a
    5455 * breakpoint, or running into a bad/fatal VMM condition. The debugger now have
    55  * the ping and must respond to the event at hand - the VMM is waiting.  This
     56 * the ping and must respond to the event at hand - the VMM is waiting. This
    5657 * usually means that the user of the debugger must do something, but it doesn't
    5758 * have to. The debugger is free to call any DBGF function (nearly at least)
     
    6263 *
    6364 * When the user eventually terminates the debugging session or selects another
    64  * VM, the debugger detaches from the VM. This means that breakpoints are disabled
    65  * and that the emulation thread no longer polls for debugger commands.
    66  *
    67  */
    68 
     65 * VM, the debugger detaches from the VM. This means that breakpoints are
     66 * disabled and that the emulation thread no longer polls for debugger commands.
     67 *
     68 */
    6969
    7070
     
    9393*   Internal Functions                                                         *
    9494*******************************************************************************/
    95 static int dbgfr3VMMWait(PVM pVM);
    96 static int dbgfr3VMMCmd(PVM pVM, DBGFCMD enmCmd, PDBGFCMDDATA pCmdData, bool *pfResumeExecution);
     95static int dbgfR3VMMWait(PVM pVM);
     96static int dbgfR3VMMCmd(PVM pVM, DBGFCMD enmCmd, PDBGFCMDDATA pCmdData, bool *pfResumeExecution);
    9797
    9898
     
    104104 * @param   enmCmd  The command.
    105105 */
    106 DECLINLINE(DBGFCMD) dbgfr3SetCmd(PVM pVM, DBGFCMD enmCmd)
     106DECLINLINE(DBGFCMD) dbgfR3SetCmd(PVM pVM, DBGFCMD enmCmd)
    107107{
    108108    DBGFCMD rc;
     
    189189                 */
    190190                DBGFCMDDATA     CmdData = pVM->dbgf.s.VMMCmdData;
    191                 DBGFCMD         enmCmd = dbgfr3SetCmd(pVM, DBGFCMD_NO_COMMAND);
     191                DBGFCMD         enmCmd = dbgfR3SetCmd(pVM, DBGFCMD_NO_COMMAND);
    192192                if (enmCmd != DBGFCMD_NO_COMMAND)
    193193                {
    194194                    bool fResumeExecution = false;
    195                     rc = dbgfr3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution);
     195                    rc = dbgfR3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution);
    196196                    if (enmCmd == DBGFCMD_DETACH_DEBUGGER)
    197197                        break;
     
    304304        bool            fResumeExecution;
    305305        DBGFCMDDATA     CmdData = pVM->dbgf.s.VMMCmdData;
    306         DBGFCMD         enmCmd = dbgfr3SetCmd(pVM, DBGFCMD_NO_COMMAND);
    307         rc = dbgfr3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution);
     306        DBGFCMD         enmCmd = dbgfR3SetCmd(pVM, DBGFCMD_NO_COMMAND);
     307        rc = dbgfR3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution);
    308308        if (!fResumeExecution)
    309             rc = dbgfr3VMMWait(pVM);
     309            rc = dbgfR3VMMWait(pVM);
    310310    }
    311311    return rc;
     
    410410    int rc = RTSemPing(&pVM->dbgf.s.PingPong);
    411411    if (VBOX_SUCCESS(rc))
    412         rc = dbgfr3VMMWait(pVM);
     412        rc = dbgfR3VMMWait(pVM);
    413413
    414414    pVM->dbgf.s.fStoppedInHyper = false;
     
    582582 * @param   pVM     VM handle.
    583583 */
    584 static int dbgfr3VMMWait(PVM pVM)
    585 {
    586     LogFlow(("dbgfr3VMMWait:\n"));
     584static int dbgfR3VMMWait(PVM pVM)
     585{
     586    LogFlow(("dbgfR3VMMWait:\n"));
    587587
    588588    /** @todo stupid GDT/LDT sync hack. go away! */
     
    605605            if (rc != VERR_TIMEOUT)
    606606            {
    607                 LogFlow(("dbgfr3VMMWait: returns %Vrc\n", rc));
     607                LogFlow(("dbgfR3VMMWait: returns %Vrc\n", rc));
    608608                return rc;
    609609            }
     
    611611            if (VM_FF_ISSET(pVM, VM_FF_REQUEST))
    612612            {
    613                 LogFlow(("dbgfr3VMMWait: Processes requests...\n"));
     613                LogFlow(("dbgfR3VMMWait: Processes requests...\n"));
    614614                rc = VMR3ReqProcessU(pVM->pUVM);
    615                 LogFlow(("dbgfr3VMMWait: VMR3ReqProcess -> %Vrc rcRet=%Vrc\n", rc, rcRet));
     615                LogFlow(("dbgfR3VMMWait: VMR3ReqProcess -> %Vrc rcRet=%Vrc\n", rc, rcRet));
    616616                if (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST)
    617617                {
     
    628628                        case VINF_EM_TERMINATE:
    629629                        case VINF_EM_OFF:
    630                             LogFlow(("dbgfr3VMMWait: returns %Vrc\n", rc));
     630                            LogFlow(("dbgfR3VMMWait: returns %Vrc\n", rc));
    631631                            return rc;
    632632
     
    648648                else if (VBOX_FAILURE(rc))
    649649                {
    650                     LogFlow(("dbgfr3VMMWait: returns %Vrc\n", rc));
     650                    LogFlow(("dbgfR3VMMWait: returns %Vrc\n", rc));
    651651                    return rc;
    652652                }
     
    659659        bool            fResumeExecution;
    660660        DBGFCMDDATA     CmdData = pVM->dbgf.s.VMMCmdData;
    661         DBGFCMD         enmCmd = dbgfr3SetCmd(pVM, DBGFCMD_NO_COMMAND);
    662         int rc = dbgfr3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution);
     661        DBGFCMD         enmCmd = dbgfR3SetCmd(pVM, DBGFCMD_NO_COMMAND);
     662        int rc = dbgfR3VMMCmd(pVM, enmCmd, &CmdData, &fResumeExecution);
    663663        if (fResumeExecution)
    664664        {
     
    669669                     &&  (rc < rcRet || rcRet == VINF_SUCCESS))
    670670                rcRet = rc;
    671             LogFlow(("dbgfr3VMMWait: returns %Vrc\n", rcRet));
     671            LogFlow(("dbgfR3VMMWait: returns %Vrc\n", rcRet));
    672672            return rcRet;
    673673        }
     
    687687 * @param   pfResumeExecution   Where to store the resume execution / continue waiting indicator.
    688688 */
    689 static int dbgfr3VMMCmd(PVM pVM, DBGFCMD enmCmd, PDBGFCMDDATA pCmdData, bool *pfResumeExecution)
     689static int dbgfR3VMMCmd(PVM pVM, DBGFCMD enmCmd, PDBGFCMDDATA pCmdData, bool *pfResumeExecution)
    690690{
    691691    bool    fSendEvent;
     
    847847    if (pVM->dbgf.s.PingPong.enmSpeaker == RTPINGPONGSPEAKER_PONG)
    848848    {
    849         enmCmd = dbgfr3SetCmd(pVM, DBGFCMD_DETACH_DEBUGGER);
     849        enmCmd = dbgfR3SetCmd(pVM, DBGFCMD_DETACH_DEBUGGER);
    850850        int rc = RTSemPong(&pVM->dbgf.s.PingPong);
    851851        if (VBOX_FAILURE(rc))
     
    858858    else
    859859    {
    860         enmCmd = dbgfr3SetCmd(pVM, DBGFCMD_DETACH_DEBUGGER);
     860        enmCmd = dbgfR3SetCmd(pVM, DBGFCMD_DETACH_DEBUGGER);
    861861        LogFunc(("enmCmd=%d (ping)\n", enmCmd));
    862862    }
     
    948948     * Send command.
    949949     */
    950     dbgfr3SetCmd(pVM, DBGFCMD_HALT);
     950    dbgfR3SetCmd(pVM, DBGFCMD_HALT);
    951951
    952952    return VINF_SUCCESS;
     
    10201020     * Send the ping back to the emulation thread telling it to run.
    10211021     */
    1022     dbgfr3SetCmd(pVM, DBGFCMD_GO);
     1022    dbgfR3SetCmd(pVM, DBGFCMD_GO);
    10231023    int rc = RTSemPong(&pVM->dbgf.s.PingPong);
    10241024    AssertRC(rc);
     
    10561056     * Send the ping back to the emulation thread telling it to run.
    10571057     */
    1058     dbgfr3SetCmd(pVM, DBGFCMD_SINGLE_STEP);
     1058    dbgfR3SetCmd(pVM, DBGFCMD_SINGLE_STEP);
    10591059    int rc = RTSemPong(&pVM->dbgf.s.PingPong);
    10601060    AssertRC(rc);
  • trunk/src/VBox/VMM/DBGFAddr.cpp

    r8819 r12663  
    158158    return true;
    159159}
     160
  • trunk/src/VBox/VMM/DBGFBp.cpp

    r11311 r12663  
    5656
    5757
     58
    5859/**
    5960 * Initialize the breakpoint stuff.
  • trunk/src/VBox/VMM/DBGFDisas.cpp

    r9846 r12663  
    4242
    4343/*******************************************************************************
    44 *   Internal Functions                                                         *
     44*   Structures and Typedefs                                                    *
    4545*******************************************************************************/
    46 static DECLCALLBACK(int) dbgfR3DisasInstrRead(RTUINTPTR pSrc, uint8_t *pDest, uint32_t size, void *pvUserdata);
    47 
    48 
    4946/**
    5047 * Structure used when disassembling and instructions in DBGF.
     
    8077
    8178
     79/*******************************************************************************
     80*   Internal Functions                                                         *
     81*******************************************************************************/
     82static DECLCALLBACK(int) dbgfR3DisasInstrRead(RTUINTPTR pSrc, uint8_t *pDest, uint32_t size, void *pvUserdata);
     83
     84
    8285
    8386/**
  • trunk/src/VBox/VMM/DBGFInfo.cpp

    r8155 r12663  
    390390
    391391
    392 
    393392/**
    394393 * Register a info handler owned by an external component.
     
    631630}
    632631
     632
    633633/**
    634634 * Deregister a info handler owned by an internal component.
  • trunk/src/VBox/VMM/DBGFInternal.h

    r8802 r12663  
    8484{
    8585    uint32_t    uDummy;
    86 
    8786} DBGFCMDDATA;
    8887/** Pointer to DBGF Command Data. */
     
    205204     * Set if a debugger is attached, elsewise it's clear.
    206205     */
    207     volatile bool           fAttached;
     206    bool volatile           fAttached;
    208207
    209208    /** Stopped in the Hypervisor.
     
    211210     * the hypervisor and have to restrict the available operations.
    212211     */
    213     volatile bool           fStoppedInHyper;
     212    bool volatile           fStoppedInHyper;
    214213
    215214    /**
     
    232231     * when it have processed it.
    233232     */
    234     volatile DBGFCMD        enmVMMCmd;
     233    DBGFCMD volatile        enmVMMCmd;
    235234    /** The Command data.
    236235     * Not all commands take data. */
  • trunk/src/VBox/VMM/DBGFLog.cpp

    r8155 r12663  
    1919 * additional information or have any questions.
    2020 */
    21 
    2221
    2322
  • trunk/src/VBox/VMM/DBGFStack.cpp

    r8155 r12663  
    6464
    6565
    66 
    67 
    6866/**
    6967 * Internal worker routine.
     
    7674 *      4  return address
    7775 *      0  old ebp; current ebp points here
     76 *
     77 * @todo Add AMD64 support (needs teaming up with the module management for
     78 *       unwind tables).
    7879 */
    7980static int dbgfR3StackWalk(PVM pVM, PDBGFSTACKFRAME pFrame)
  • trunk/src/VBox/VMM/DBGFSym.cpp

    r9182 r12663  
    4949#include <stdio.h> /* for fopen(). */ /** @todo use iprt/stream.h! */
    5050#include <stdlib.h>
    51 
    5251
    5352
  • trunk/src/VBox/VMM/VMMGC/DBGFGC.cpp

    r9212 r12663  
    22/** @file
    33 * DBGF - Debugger Facility, GC part.
     4 *
     5 * Almost identical to DBGFR0.cpp, except for the fInHyper stuff.
    46 */
    57
  • trunk/src/VBox/VMM/VMMR0/DBGFR0.cpp

    r11311 r12663  
    22/** @file
    33 * DBGF - Debugger Facility, R0 part.
     4 *
     5 * Almost identical to DBGFGC.cpp, except for the fInHyper stuff.
    46 */
    57
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette