VirtualBox

Changeset 99900 in vbox for trunk


Ignore:
Timestamp:
May 22, 2023 1:14:20 PM (20 months ago)
Author:
vboxsync
Message:

VMM/EM: Added .iemrecompiled debugger command. bugref:10369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EMR3Dbg.cpp

    r99897 r99900  
    4141
    4242
    43 /** @callback_method_impl{FNDBGCCMD,
    44  * Implements the '.alliem' command. }
    45  */
    46 static DECLCALLBACK(int) emR3DbgCmdAllIem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     43/**
     44 * Common worker for the  '.alliem' and '.iemrecompiled' commands.
     45 */
     46static int emR3DbgCmdSetPolicyCommon(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs,
     47                                     EMEXECPOLICY enmPolicy, const char *pszPolicy)
    4748{
    4849    int  rc;
     
    5152    if (cArgs == 0)
    5253    {
    53         rc = EMR3QueryExecutionPolicy(pUVM, EMEXECPOLICY_IEM_ALL, &f);
     54        rc = EMR3QueryExecutionPolicy(pUVM, enmPolicy, &f);
    5455        if (RT_FAILURE(rc))
    55             return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "EMR3QueryExecutionPolicy(,EMEXECPOLICY_IEM_ALL,");
    56         DBGCCmdHlpPrintf(pCmdHlp, f ? "alliem: enabled\n" : "alliem: disabled\n");
     56            return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "EMR3QueryExecutionPolicy(,%s,", pszPolicy);
     57        DBGCCmdHlpPrintf(pCmdHlp, f ? "%s: enabled\n" : "%s: disabled\n", pszPolicy);
    5758    }
    5859    else
     
    6162        if (RT_FAILURE(rc))
    6263            return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGCCmdHlpVarToBool");
    63         rc = EMR3SetExecutionPolicy(pUVM, EMEXECPOLICY_IEM_ALL, f);
     64        rc = EMR3SetExecutionPolicy(pUVM, enmPolicy, f);
    6465        if (RT_FAILURE(rc))
    65             return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "EMR3SetExecutionPolicy(,EMEXECPOLICY_IEM_ALL,%RTbool)", f);
     66            return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "EMR3SetExecutionPolicy(,%s,%RTbool)", pszPolicy, f);
    6667    }
    6768    return VINF_SUCCESS;
     69}
     70
     71
     72/** @callback_method_impl{FNDBGCCMD,
     73 * Implements the '.alliem' command. }
     74 */
     75static DECLCALLBACK(int) emR3DbgCmdAllIem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     76{
     77    return emR3DbgCmdSetPolicyCommon(pCmd, pCmdHlp, pUVM, paArgs, cArgs, EMEXECPOLICY_IEM_ALL, "EMEXECPOLICY_IEM_ALL");
     78}
     79
     80
     81/** @callback_method_impl{FNDBGCCMD,
     82 * Implements the '.iemrecompiled' command. }
     83 */
     84static DECLCALLBACK(int) emR3DbgCmdIemRecompiled(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     85{
     86    return emR3DbgCmdSetPolicyCommon(pCmd, pCmdHlp, pUVM, paArgs, cArgs, EMEXECPOLICY_IEM_RECOMPILED, "EMEXECPOLICY_IEM_RECOMPILED");
    6887}
    6988
     
    7796    {
    7897        "alliem", 0, 1, &g_BoolArg, 1, 0, emR3DbgCmdAllIem, "[boolean]",
    79         "Enables or disabled executing ALL code in IEM, if no arguments are given it displays the current status."
     98        "Enables or disables executing ALL code in IEM, if no arguments are given it displays the current status."
     99    },
     100    {
     101        "iemrecompiled", 0, 1, &g_BoolArg, 1, 0, emR3DbgCmdIemRecompiled, "[boolean]",
     102        "Enables or disables recompiled ALL-in-IEM execution, if no arguments are given it displays the current status."
    80103    },
    81104};
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