VirtualBox

Changeset 19639 in vbox


Ignore:
Timestamp:
May 12, 2009 3:22:14 PM (16 years ago)
Author:
vboxsync
Message:

Disassembler changes for guest SMP

Location:
trunk
Files:
7 edited

Legend:

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

    r19575 r19639  
    788788
    789789VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, unsigned fFlags, char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr);
    790 VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVM pVM, char *pszOutput, uint32_t cbOutput);
    791 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVM pVM, const char *pszPrefix);
     790VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput);
     791VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix);
    792792
    793793/** @def DBGFR3DisasInstrCurrentLog
     
    795795 * All registers and data will be displayed. Addresses will be attempted resolved to symbols.
    796796 */
    797 /** @todo SMP */
    798797#ifdef LOG_ENABLED
    799 # define DBGFR3DisasInstrCurrentLog(pVM, pszPrefix) \
     798# define DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix) \
    800799    do { \
    801800        if (LogIsEnabled()) \
    802             DBGFR3DisasInstrCurrentLogInternal(pVM, pszPrefix); \
     801            DBGFR3DisasInstrCurrentLogInternal(pVCpu, pszPrefix); \
    803802    } while (0)
    804803#else
    805 # define DBGFR3DisasInstrCurrentLog(pVM, pszPrefix) do { } while (0)
     804# define DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix) do { } while (0)
    806805#endif
    807806
    808 VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVM pVM, RTSEL Sel, RTGCPTR GCPtr);
     807VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr);
    809808
    810809/** @def DBGFR3DisasInstrLog
     
    814813 */
    815814#ifdef LOG_ENABLED
    816 # define DBGFR3DisasInstrLog(pVM, Sel, GCPtr) \
     815# define DBGFR3DisasInstrLog(pVCpu, Sel, GCPtr) \
    817816    do { \
    818817        if (LogIsEnabled()) \
    819             DBGFR3DisasInstrLogInternal(pVM, Sel, GCPtr); \
     818            DBGFR3DisasInstrLogInternal(pVCpu, Sel, GCPtr); \
    820819    } while (0)
    821820#else
    822 # define DBGFR3DisasInstrLog(pVM, Sel, GCPtr) do { } while (0)
     821# define DBGFR3DisasInstrLog(pVCpu, Sel, GCPtr) do { } while (0)
    823822#endif
    824823
  • trunk/src/VBox/VMM/CPUM.cpp

    r19636 r19639  
    14371437{
    14381438    char szInstruction[256];
    1439     int rc = DBGFR3DisasInstrCurrent(pVM, szInstruction, sizeof(szInstruction));
     1439    /* @todo SMP support! */
     1440    PVMCPU pVCpu = VMMGetCpu(pVM);
     1441    if (!pVCpu)
     1442        pVCpu = &pVM->aCpus[0];
     1443
     1444    int rc = DBGFR3DisasInstrCurrent(pVCpu, szInstruction, sizeof(szInstruction));
    14401445    if (RT_SUCCESS(rc))
    14411446        pHlp->pfnPrintf(pHlp, "\nCPUM: %s\n\n", szInstruction);
  • trunk/src/VBox/VMM/DBGFDisas.cpp

    r19463 r19639  
    582582 *
    583583 * @returns VBox status code.
    584  * @param   pVM             VM handle.
     584 * @param   pVCpu           VMCPU handle.
    585585 * @param   pszOutput       Output buffer.
    586586 * @param   cchOutput       Size of the output buffer.
    587587 */
    588 VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVM pVM, char *pszOutput, uint32_t cchOutput)
     588VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cchOutput)
    589589{
    590590    *pszOutput = '\0';
    591     PVMCPU pVCpu = VMMGetCpu(pVM);
    592591    AssertReturn(pVCpu, VERR_INVALID_CONTEXT);
    593     return DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0, DBGF_DISAS_FLAGS_CURRENT_GUEST,
     592    return DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, 0, 0, DBGF_DISAS_FLAGS_CURRENT_GUEST,
    594593                              pszOutput, cchOutput, NULL);
    595594}
     
    601600 *
    602601 * @returns VBox status code.
    603  * @param   pVM             VM handle.
     602 * @param   pVCpu           VMCPU handle.
    604603 * @param   pszPrefix       Short prefix string to the dissassembly string. (optional)
    605604 */
    606 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVM pVM, const char *pszPrefix)
     605VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix)
    607606{
    608607    char szBuf[256];
    609608    szBuf[0] = '\0';
    610     int rc = DBGFR3DisasInstrCurrent(pVM, &szBuf[0], sizeof(szBuf));
     609    int rc = DBGFR3DisasInstrCurrent(pVCpu, &szBuf[0], sizeof(szBuf));
    611610    if (RT_FAILURE(rc))
    612611        RTStrPrintf(szBuf, sizeof(szBuf), "DBGFR3DisasInstrCurrentLog failed with rc=%Rrc\n", rc);
     
    631630 * @param   GCPtr           The code address relative to the base of Sel.
    632631 */
    633 VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVM pVM, RTSEL Sel, RTGCPTR GCPtr)
    634 {
    635     PVMCPU pVCpu = VMMGetCpu(pVM);
    636     AssertReturn(pVCpu, VERR_INVALID_CONTEXT);
    637 
     632VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr)
     633{
    638634    char szBuf[256];
    639635    szBuf[0] = '\0';
    640     int rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, Sel, GCPtr, 0, &szBuf[0], sizeof(szBuf), NULL);
     636    int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, Sel, GCPtr, 0, &szBuf[0], sizeof(szBuf), NULL);
    641637    if (RT_FAILURE(rc))
    642638        RTStrPrintf(szBuf, sizeof(szBuf), "DBGFR3DisasInstrLog(, %RTsel, %RGv) failed with rc=%Rrc\n", Sel, GCPtr, rc);
  • trunk/src/VBox/VMM/EM.cpp

    r19613 r19639  
    12461246    {
    12471247        DBGFR3PrgStep(pVCpu);
    1248         DBGFR3DisasInstrCurrentLog(pVM, "RSS: ");
     1248        DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
    12491249        rc = emR3RawStep(pVM, pVCpu);
    12501250        if (rc != VINF_SUCCESS)
     
    12681268    {
    12691269        DBGFR3PrgStep(pVCpu);
    1270         DBGFR3DisasInstrCurrentLog(pVM, "RSS: ");
     1270        DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
    12711271        rc = emR3HwAccStep(pVM, pVCpu);
    12721272        if (    rc != VINF_SUCCESS
     
    12911291    {
    12921292        DBGFR3PrgStep(pVCpu);
    1293         DBGFR3DisasInstrCurrentLog(pVM, "RSS: ");
     1293        DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
    12941294        emR3RemStep(pVM, pVCpu);
    12951295        if (emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx) != EMSTATE_REM)
     
    13401340    {
    13411341        DBGFR3InfoLog(pVM, "cpumguest", pszPrefix);
    1342         DBGFR3DisasInstrCurrentLog(pVM, pszPrefix);
     1342        DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix);
    13431343    }
    13441344#endif /* LOG_ENABLED */
     
    16191619#ifdef LOGGING_ENABLED
    16201620        DBGFR3InfoLog(pVM, "cpumguest", "Guest trap");
    1621         DBGFR3DisasInstrCurrentLog(pVM, "Guest trap");
     1621        DBGFR3DisasInstrCurrentLog(pVCpu, "Guest trap");
    16221622#endif
    16231623        return VINF_EM_RESCHEDULE_HWACC;
     
    17421742#ifdef LOG_ENABLED
    17431743    DBGFR3InfoLog(pVM, "cpumguest", "Guest trap");
    1744     DBGFR3DisasInstrCurrentLog(pVM, "Guest trap");
     1744    DBGFR3DisasInstrCurrentLog(pVCpu, "Guest trap");
    17451745
    17461746    /* Get guest page information. */
     
    17931793                if (RT_SUCCESS(rc))
    17941794                {
    1795                     DBGFR3DisasInstrCurrentLog(pVM, "Patched sysenter instruction");
     1795                    DBGFR3DisasInstrCurrentLog(pVCpu, "Patched sysenter instruction");
    17961796                    return VINF_EM_RESCHEDULE_RAW;
    17971797                }
     
    18771877#ifdef LOG_ENABLED
    18781878        DBGFR3InfoLog(pVM, "cpumguest", "Trap in patch code");
    1879         DBGFR3DisasInstrCurrentLog(pVM, "Patch code");
     1879        DBGFR3DisasInstrCurrentLog(pVCpu, "Patch code");
    18801880
    18811881        DISCPUSTATE Cpu;
     
    20492049                DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
    20502050#endif
    2051                 DBGFR3DisasInstrCurrentLog(pVM, "Patched privileged instruction");
     2051                DBGFR3DisasInstrCurrentLog(pVCpu, "Patched privileged instruction");
    20522052                return VINF_SUCCESS;
    20532053            }
     
    20592059    {
    20602060        DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
    2061         DBGFR3DisasInstrCurrentLog(pVM, "Privileged instr: ");
     2061        DBGFR3DisasInstrCurrentLog(pVCpu, "Privileged instr: ");
    20622062    }
    20632063#endif
     
    22012201                    {
    22022202                        DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
    2203                         DBGFR3DisasInstrCurrentLog(pVM, "Privileged instr: ");
     2203                        DBGFR3DisasInstrCurrentLog(pVCpu, "Privileged instr: ");
    22042204                    }
    22052205#endif
  • trunk/src/VBox/VMM/TRPM.cpp

    r19286 r19639  
    14511451# ifdef LOG_ENABLED
    14521452        DBGFR3InfoLog(pVM, "cpumguest", "TRPMInject");
    1453         DBGFR3DisasInstrCurrentLog(pVM, "TRPMInject");
     1453        DBGFR3DisasInstrCurrentLog(pVCpu, "TRPMInject");
    14541454# endif
    14551455
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r19367 r19639  
    567567static const REMPARMDESC g_aArgsDBGFR3DisasInstrCurrentLogInternal[] =
    568568{
    569     { REMPARMDESC_FLAGS_INT,        sizeof(PVM), NULL },
     569    { REMPARMDESC_FLAGS_INT,        sizeof(PVMCPU), NULL },
    570570    { REMPARMDESC_FLAGS_INT,        sizeof(char *), NULL }
    571571};
  • trunk/src/recompiler/VBoxRecompiler.c

    r19459 r19639  
    36163616     */
    36173617    if (fLog)
    3618         rc = DBGFR3DisasInstrCurrentLogInternal(pVM, pszPrefix);
     3618        rc = DBGFR3DisasInstrCurrentLogInternal(env->pVCpu, pszPrefix);
    36193619
    36203620    return RT_SUCCESS(rc);
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