DBGFAddr.cpp revision 50f998bb47f333d10515d4c12ad01a4e92a0747b
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * DBGF - Debugger Facility, Mixed Address Methods.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Copyright (C) 2006-2007 Oracle Corporation
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * available from http://www.virtualbox.org. This file is free software;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * you can redistribute it and/or modify it under the terms of the GNU
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * General Public License (GPL) as published by the Free Software
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*******************************************************************************
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Header Files *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*******************************************************************************/
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Checks if an address is in the HMA or not.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * @returns true if it's inside the HMA.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * @returns flase if it's not inside the HMA.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * @param pVM The VM handle.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * @param FlatPtr The address in question.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDECLINLINE(bool) dbgfR3IsHMA(PVM pVM, RTGCUINTPTR FlatPtr)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Common worker for DBGFR3AddrFromSelOff and DBGFR3AddrFromSelInfoOff.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncstatic int dbgfR3AddrFromSelInfoOffWorker(PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync if (pSelInfo->fFlags & (DBGFSELINFO_FLAGS_INVALID | DBGFSELINFO_FLAGS_NOT_PRESENT))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync return pSelInfo->fFlags & DBGFSELINFO_FLAGS_NOT_PRESENT
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync /** @todo This all goes voodoo in long mode. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync /* check limit. */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync /** @todo fix all these selector tests! */
return VINF_SUCCESS;
VMMR3DECL(int) DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
int rc = DBGFR3SelQueryInfo(pVM, idCpu, Sel, DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
return rc;
return rc;
return VINF_SUCCESS;
VMMR3DECL(int) DBGFR3AddrFromSelInfoOff(PVM pVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off)
return rc;
return VINF_SUCCESS;
return pAddress;
return pAddress;
static DECLCALLBACK(int) dbgfR3AddrToPhysOnVCpu(PVMCPU pVCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
int rc;
return rc;
VMMR3DECL(int) DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
int rc;
return rc;
static DECLCALLBACK(int) dbgfR3AddrToVolatileR3PtrOnVCpu(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
int rc;
if (pv)
if (fReadOnly)
if (fReadOnly)
return rc;
VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3AddrToVolatileR3PtrOnVCpu, 5, pVM, idCpu, pAddress, fReadOnly, ppvR3Ptr);
return pAddress;
return pAddress;