VirtualBox

Changeset 10493 in vbox


Ignore:
Timestamp:
Jul 11, 2008 8:45:55 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
33172
Message:

Added .pgmassertcr3 debugger command.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGM.cpp

    r10436 r10493  
    633633static DECLCALLBACK(int) pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    634634static DECLCALLBACK(int) pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     635static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    635636#endif
    636637
     
    647648    { "pgmmap",     0,        0,        NULL,               0,                          NULL,               0,          pgmR3CmdMap,        "",                     "Display the mapping ranges." },
    648649    { "pgmsync",    0,        0,        NULL,               0,                          NULL,               0,          pgmR3CmdSync,       "",                     "Sync the CR3 page." },
     650    { "pgmassertcr3",  0,     0,        NULL,               0,                          NULL,               0,          pgmR3CmdAssertCR3,  "",                     "Check the shadow CR3 mapping." },
    649651    { "pgmsyncalways", 0,     0,        NULL,               0,                          NULL,               0,          pgmR3CmdSyncAlways, "",                     "Toggle permanent CR3 syncing." },
    650652};
     
    38853887     */
    38863888    if (!pVM)
    3887         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
     3889        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    38883890    if (!pVM->pgm.s.pRamRangesGC)
    38893891        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no Ram is registered.\n");
     
    39233925     */
    39243926    if (!pVM)
    3925         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
     3927        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    39263928    if (!pVM->pgm.s.pMappingsR3)
    39273929        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no mappings are registered.\n");
     
    39673969     */
    39683970    if (!pVM)
    3969         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
     3971        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    39703972
    39713973    /*
     
    39833985
    39843986/**
    3985  * The '.pgmsyncalways' command.
     3987 * The '.pgmassertcr3' command.
    39863988 *
    39873989 * @returns VBox status.
     
    39923994 * @param   cArgs       Number of arguments in the array.
    39933995 */
     3996static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
     3997{
     3998    /*
     3999     * Validate input.
     4000     */
     4001    if (!pVM)
     4002        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
     4003
     4004    int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Checking shadow CR3 page tables for consistency.\n");
     4005    if (VBOX_FAILURE(rc))
     4006        return rc;
     4007
     4008    PGMAssertCR3(pVM, CPUMGetGuestCR3(pVM), CPUMGetGuestCR4(pVM));
     4009
     4010    return VINF_SUCCESS;
     4011}
     4012
     4013
     4014/**
     4015 * The '.pgmsyncalways' command.
     4016 *
     4017 * @returns VBox status.
     4018 * @param   pCmd        Pointer to the command descriptor (as registered).
     4019 * @param   pCmdHlp     Pointer to command helper functions.
     4020 * @param   pVM         Pointer to the current VM (if any).
     4021 * @param   paArgs      Pointer to (readonly) array of arguments.
     4022 * @param   cArgs       Number of arguments in the array.
     4023 */
    39944024static DECLCALLBACK(int) pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
    39954025{
     
    39984028     */
    39994029    if (!pVM)
    4000         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
     4030        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    40014031
    40024032    /*
Note: See TracChangeset for help on using the changeset viewer.

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