VirtualBox

Changeset 19288 in vbox for trunk/src


Ignore:
Timestamp:
May 1, 2009 1:09:18 PM (16 years ago)
Author:
vboxsync
Message:

DBGF,TRPM,HWACCM: Merged DBGFR0.cpp and DBGFGC.cpp into VMMRZ/DBGFRZ.cpp (new directory for things that are common to both R0 and RC).

Location:
trunk/src/VBox/VMM
Files:
2 added
1 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/Makefile.kmk

    r18792 r19288  
    333333        VMMGC/CPUMGCA.asm \
    334334        VMMGC/EMGCA.asm \
    335         VMMGC/DBGFGC.cpp \
    336335        VMMGC/IOMGC.cpp \
    337336        VMMGC/MMRamGC.cpp \
     
    345344        VMMGC/VMMGC.cpp \
    346345        VMMGC/VMMGCA.asm \
     346        VMMGC/HWACCMGCA.asm \
     347        VMMRZ/DBGFRZ.cpp \
    347348        VMMAll/CPUMAllRegs.cpp \
    348349        VMMAll/CPUMAllA.asm \
    349350        VMMAll/DBGFAll.cpp \
    350         VMMGC/HWACCMGCA.asm \
    351351        VMMAll/IOMAll.cpp \
    352352        VMMAll/IOMAllMMIO.cpp \
     
    427427        VMMR0/CPUMR0.cpp \
    428428        VMMR0/CPUMR0A.asm \
    429         VMMR0/DBGFR0.cpp \
    430429        VMMR0/GMMR0.cpp \
    431430        VMMR0/GVMMR0.cpp \
     
    440439        VMMR0/VMMR0.cpp \
    441440        VMMR0/VMMR0A.asm \
     441        VMMRZ/DBGFRZ.cpp \
    442442        VMMAll/CPUMAllA.asm \
    443443        VMMAll/CPUMAllRegs.cpp \
  • trunk/src/VBox/VMM/VMMGC/TRPMGCHandlers.cpp

    r19286 r19288  
    284284     * Now leave the rest to the DBGF.
    285285     */
    286     int rc = DBGFGCTrap01Handler(pVM, pVCpu, pRegFrame, uDr6);
     286    int rc = DBGFRZTrap01Handler(pVM, pVCpu, pRegFrame, uDr6);
    287287    if (rc == VINF_EM_RAW_GUEST_TRAP)
    288288        CPUMSetGuestDR6(pVCpu, uDr6);
     
    346346        }
    347347    }
    348     rc = DBGFGCTrap03Handler(pVM, pVCpu, pRegFrame);
     348    rc = DBGFRZTrap03Handler(pVM, pVCpu, pRegFrame);
    349349
    350350    /* anything we should do with this? Schedule it in GC? */
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r19286 r19288  
    13241324            Assert(DBGFIsStepping(pVCpu));
    13251325
    1326             rc = DBGFR0Trap01Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx), pCtx->dr[6]);
     1326            rc = DBGFRZTrap01Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx), pCtx->dr[6]);
    13271327            if (rc == VINF_EM_RAW_GUEST_TRAP)
    13281328            {
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r19286 r19288  
    24702470                uDR6  = X86_DR6_INIT_VAL;
    24712471                uDR6 |= (exitQualification & (X86_DR6_B0|X86_DR6_B1|X86_DR6_B2|X86_DR6_B3|X86_DR6_BD|X86_DR6_BS));
    2472                 rc = DBGFR0Trap01Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx), uDR6);
     2472                rc = DBGFRZTrap01Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx), uDR6);
    24732473                if (rc == VINF_EM_RAW_GUEST_TRAP)
    24742474                {
     
    25012501            }
    25022502
    2503 #ifdef DEBUG /* till after branching, enable by default after that. */
    25042503            case X86_XCPT_BP:   /* Breakpoint. */
    25052504            {
    2506                 rc = DBGFR0Trap03Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx));
     2505                rc = DBGFRZTrap03Handler(pVM, pVCpu, CPUMCTX2CORE(pCtx));
    25072506                if (rc == VINF_EM_RAW_GUEST_TRAP)
    25082507                {
     
    25172516                break;
    25182517            }
    2519 #endif
    25202518
    25212519            case X86_XCPT_GP:   /* General protection failure exception.*/
  • trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp

    r19286 r19288  
    11/* $Id$ */
    22/** @file
    3  * DBGF - Debugger Facility, GC part.
    4  *
    5  * Almost identical to DBGFR0.cpp, except for the fInHyper stuff.
     3 * DBGF - Debugger Facility, RZ part.
    64 */
    75
    86/*
    9  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    108 *
    119 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4947 * @param   uDr6        The DR6 register value.
    5048 */
    51 VMMRCDECL(int) DBGFGCTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)
     49VMMRZDECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)
    5250{
     51#ifdef IN_RC
    5352    const bool fInHyper = !(pRegFrame->ss & X86_SEL_RPL) && !pRegFrame->eflags.Bits.u1VM;
     53#else
     54    const bool fInHyper = false;
     55#endif
    5456
    5557    /** @todo Intel docs say that X86_DR6_BS has the highest priority... */
     
    6769                pVCpu->dbgf.s.iActiveBp = pVM->dbgf.s.aHwBreakpoints[iBp].iBp;
    6870                pVCpu->dbgf.s.fSingleSteppingRaw = false;
    69                 LogFlow(("DBGFGCTrap03Handler: hit hw breakpoint %d at %04x:%08x\n",
    70                          pVM->dbgf.s.aHwBreakpoints[iBp].iBp, pRegFrame->cs, pRegFrame->eip));
     71                LogFlow(("DBGFRZTrap03Handler: hit hw breakpoint %d at %04x:%RGv\n",
     72                         pVM->dbgf.s.aHwBreakpoints[iBp].iBp, pRegFrame->cs, pRegFrame->rip));
    7173
    7274                return fInHyper ? VINF_EM_DBG_HYPER_BREAKPOINT : VINF_EM_DBG_BREAKPOINT;
     
    8385    {
    8486        pVCpu->dbgf.s.fSingleSteppingRaw = false;
    85         LogFlow(("DBGFGCTrap01Handler: single step at %04x:%08x\n", pRegFrame->cs, pRegFrame->eip));
     87        LogFlow(("DBGFRZTrap01Handler: single step at %04x:%RGv\n", pRegFrame->cs, pRegFrame->rip));
    8688        return fInHyper ? VINF_EM_DBG_HYPER_STEPPED : VINF_EM_DBG_STEPPED;
    8789    }
     
    9193     * so we'll bitch if this is not a BS event.
    9294     */
    93     AssertMsg(uDr6 & X86_DR6_BS, ("hey! we're not doing guest BPs yet! dr6=%RTreg %04x:%08x\n",
    94                                   uDr6, pRegFrame->cs, pRegFrame->eip));
    95     /** @todo virtualize DRx. */
    96     LogFlow(("DBGFGCTrap01Handler: guest debug event %RTreg at %04x:%08x!\n", uDr6, pRegFrame->cs, pRegFrame->eip));
     95    AssertMsg(uDr6 & X86_DR6_BS, ("hey! we're not doing guest BPs yet! dr6=%RTreg %04x:%RGv\n",
     96                                  uDr6, pRegFrame->cs, pRegFrame->rip));
     97
     98    LogFlow(("DBGFRZTrap01Handler: guest debug event %RTreg at %04x:%RGv!\n", uDr6, pRegFrame->cs, pRegFrame->rip));
    9799    return fInHyper ? VERR_INTERNAL_ERROR : VINF_EM_RAW_GUEST_TRAP;
    98100}
     
    110112 * @param   pRegFrame   Pointer to the register frame for the trap.
    111113 */
    112 VMMRCDECL(int) DBGFGCTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
     114VMMRZDECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
    113115{
     116#ifdef IN_RC
     117    const bool fInHyper = !(pRegFrame->ss & X86_SEL_RPL) && !pRegFrame->eflags.Bits.u1VM;
     118#else
     119    const bool fInHyper = false;
     120#endif
     121
    114122    /*
    115123     * Get the trap address and look it up in the breakpoint table.
     
    120128        RTGCPTR pPc;
    121129        int rc = SELMValidateAndConvertCSAddr(pVM, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid,
     130#ifdef IN_RC
    122131                                              (RTGCPTR)((RTGCUINTPTR)pRegFrame->eip - 1),
     132#else
     133                                              (RTGCPTR)pRegFrame->rip /* no -1 in R0 */,
     134#endif
    123135                                              &pPc);
    124136        AssertRCReturn(rc, rc);
     
    132144                pVCpu->dbgf.s.iActiveBp = pVM->dbgf.s.aBreakpoints[iBp].iBp;
    133145
    134                 LogFlow(("DBGFGCTrap03Handler: hit breakpoint %d at %RGv (%04x:%08x) cHits=0x%RX64\n",
    135                          pVM->dbgf.s.aBreakpoints[iBp].iBp, pPc, pRegFrame->cs, pRegFrame->eip,
     146                LogFlow(("DBGFRZTrap03Handler: hit breakpoint %d at %RGv (%04x:%RGv) cHits=0x%RX64\n",
     147                         pVM->dbgf.s.aBreakpoints[iBp].iBp, pPc, pRegFrame->cs, pRegFrame->rip,
    136148                         pVM->dbgf.s.aBreakpoints[iBp].cHits));
    137                 return !(pRegFrame->ss & X86_SEL_RPL) && !pRegFrame->eflags.Bits.u1VM
    138                     ? VINF_EM_DBG_HYPER_BREAKPOINT
    139                     : VINF_EM_DBG_BREAKPOINT;
     149                return fInHyper
     150                     ? VINF_EM_DBG_HYPER_BREAKPOINT
     151                     : VINF_EM_DBG_BREAKPOINT;
    140152            }
    141153        }
    142154    }
    143155
    144     return !(pRegFrame->ss & X86_SEL_RPL) && !pRegFrame->eflags.Bits.u1VM
    145         ? VINF_EM_DBG_HYPER_ASSERTION
    146         : VINF_EM_RAW_GUEST_TRAP;
     156    return fInHyper
     157         ? VINF_EM_DBG_HYPER_ASSERTION
     158         : VINF_EM_RAW_GUEST_TRAP;
    147159}
    148160
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