VirtualBox

Changeset 5667 in vbox for trunk/include


Ignore:
Timestamp:
Nov 11, 2007 4:28:47 AM (17 years ago)
Author:
vboxsync
Message:

Debugger interface for searching memory. Fixed a const mixup.

Location:
trunk/include/VBox
Files:
3 edited

Legend:

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

    r5605 r5667  
    131131/** A flat address. */
    132132#define DBGFADDRESS_FLAGS_FLAT          3
     133/** A physical address. */
     134#define DBGFADDRESS_FLAGS_PHYS          4
    133135/** The address type mask. */
    134 #define DBGFADDRESS_FLAGS_TYPE_MASK     3
     136#define DBGFADDRESS_FLAGS_TYPE_MASK     7
    135137
    136138/** Set if the address is valid. */
    137 #define DBGFADDRESS_FLAGS_VALID         RT_BIT(2)
     139#define DBGFADDRESS_FLAGS_VALID         RT_BIT(3)
    138140
    139141/** The address is within the hypervisor memoary area (HMA).
    140142 * If not set, the address can be assumed to be a guest address. */
    141 #define DBGFADDRESS_FLAGS_HMA           RT_BIT(3)
     143#define DBGFADDRESS_FLAGS_HMA           RT_BIT(4)
    142144
    143145/** Checks if the mixed address is flat or not. */
    144146#define DBGFADDRESS_IS_FLAT(pAddress)    ( ((pAddress)->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_FLAT )
     147/** Checks if the mixed address is flat or not. */
     148#define DBGFADDRESS_IS_PHYS(pAddress)    ( ((pAddress)->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_PHYS )
    145149/** Checks if the mixed address is far 16:16 or not. */
    146150#define DBGFADDRESS_IS_FAR16(pAddress)   ( ((pAddress)->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_FAR16 )
     
    150154#define DBGFADDRESS_IS_FAR64(pAddress)   ( ((pAddress)->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_FAR64 )
    151155/** Checks if the mixed address is valid. */
    152 #define DBGFADDRESS_IS_VALID(pAddress)   ( (pAddress)->fFlags & DBGFADDRESS_FLAGS_VALID )
     156#define DBGFADDRESS_IS_VALID(pAddress)   ( !!((pAddress)->fFlags & DBGFADDRESS_FLAGS_VALID) )
     157/** Checks if the address is flagged as within the HMA. */
     158#define DBGFADDRESS_IS_HMA(pAddress)     ( !!((pAddress)->fFlags & DBGFADDRESS_FLAGS_HMA) )
    153159/** @} */
    154160
     
    172178 */
    173179DBGFR3DECL(void) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr);
     180
     181/**
     182 * Creates a mixed address from a guest physical address.
     183 *
     184 * @param   pVM         The VM handle.
     185 * @param   pAddress    Where to store the mixed address.
     186 * @param   PhysAddr    The guest physical address.
     187 */
     188DBGFR3DECL(void) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr);
    174189
    175190/**
  • trunk/include/VBox/err.h

    r5513 r5667  
    224224/** The breakpoint already exists. */
    225225#define VINF_DBGF_BP_ALREADY_EXIST          1207
     226/** The byte string was not found. */
     227#define VERR_DBGF_MEM_NOT_FOUND             (-1208)
    226228/** @} */
    227229
  • trunk/include/VBox/pgm.h

    r5040 r5667  
    810810/**
    811811 * Invalidates the GC page mapping TLB.
    812  * 
     812 *
    813813 * @param   pVM     The VM handle.
    814814 */
     
    817817/**
    818818 * Invalidates the ring-0 page mapping TLB.
    819  * 
     819 *
    820820 * @param   pVM     The VM handle.
    821821 */
     
    824824/**
    825825 * Invalidates the ring-3 page mapping TLB.
    826  * 
     826 *
    827827 * @param   pVM     The VM handle.
    828828 */
    829829PDMDECL(void) PGMPhysInvalidatePageR3MapTLB(PVM pVM);
    830830
    831 /** 
     831/**
    832832 * Page mapping lock.
    833  * 
    834  * @remarks This doesn't work in structures shared between 
     833 *
     834 * @remarks This doesn't work in structures shared between
    835835 *          ring-3, ring-0 and/or GC.
    836836 */
     
    857857 * scarse resources (R0 and GC) in the mapping cache. When you're done
    858858 * with the page, call PGMPhysReleasePageMappingLock() ASAP to release it.
    859  * 
    860  * This API will assume your intention is to write to the page, and will 
    861  * therefore replace shared and zero pages. If you do not intend to modify 
     859 *
     860 * This API will assume your intention is to write to the page, and will
     861 * therefore replace shared and zero pages. If you do not intend to modify
    862862 * the page, use the PGMPhysGCPhys2CCPtrReadOnly() API.
    863863 *
     
    899899 * @thread  Any thread.
    900900 */
    901 PGMDECL(int) PGMPhysGCPhys2CCPtrReadOnly(PVM pVM, RTGCPHYS GCPhys, void * const *ppv, PPGMPAGEMAPLOCK pLock);
     901PGMDECL(int) PGMPhysGCPhys2CCPtrReadOnly(PVM pVM, RTGCPHYS GCPhys, void const **ppv, PPGMPAGEMAPLOCK pLock);
    902902
    903903/**
     
    908908 * with the page, call PGMPhysReleasePageMappingLock() ASAP to release it.
    909909 *
    910  * This API will assume your intention is to write to the page, and will 
    911  * therefore replace shared and zero pages. If you do not intend to modify 
     910 * This API will assume your intention is to write to the page, and will
     911 * therefore replace shared and zero pages. If you do not intend to modify
    912912 * the page, use the PGMPhysGCPtr2CCPtrReadOnly() API.
    913913 *
     
    953953 * @thread  EMT
    954954 */
    955 PGMDECL(int) PGMPhysGCPtr2CCPtrReadOnly(PVM pVM, RTGCPTR GCPtr, void * const *ppv, PPGMPAGEMAPLOCK pLock);
     955PGMDECL(int) PGMPhysGCPtr2CCPtrReadOnly(PVM pVM, RTGCPTR GCPtr, void const **ppv, PPGMPAGEMAPLOCK pLock);
    956956
    957957/**
    958958 * Release the mapping of a guest page.
    959  * 
     959 *
    960960 * This is the counter part of PGMPhysGCPhys2CCPtr, PGMPhysGCPhys2CCPtrReadOnly
    961961 * PGMPhysGCPtr2CCPtr and PGMPhysGCPtr2CCPtrReadOnly.
     
    969969/**
    970970 * Checks if the lock structure is valid
    971  * 
     971 *
    972972 * @param   pVM         The VM handle.
    973973 * @param   pLock       The lock structure initialized by the mapping function.
     
    13111311 * @{
    13121312 */
    1313 /** 
     1313/**
    13141314 * Worker function for PGMR3PhysAllocateHandyPages and pgmPhysEnsureHandyPage.
    1315  * 
     1315 *
    13161316 * @returns The following VBox status codes.
    13171317 * @retval  VINF_SUCCESS on success. FF cleared.
    13181318 * @retval  VINF_EM_NO_MEMORY if we're out of memory. The FF is set in this case.
    1319  * 
    1320  * @param   pVM         The VM handle.
    1321  * 
     1319 *
     1320 * @param   pVM         The VM handle.
     1321 *
    13221322 * @remarks Must be called from within the PGM critical section.
    13231323 */
     
    13251325
    13261326/** @} */
    1327 #endif 
     1327#endif
    13281328
    13291329
     
    17841784/**
    17851785 * For VMMCALLHOST_PGM_MAP_CHUNK, considered internal.
    1786  * 
     1786 *
    17871787 * @returns see pgmR3PhysChunkMap.
    17881788 * @param   pVM         The VM handle.
     
    17931793/**
    17941794 * Invalidates the TLB for the ring-3 mapping cache.
    1795  * 
     1795 *
    17961796 * @param   pVM         The VM handle.
    17971797 */
     
    18001800/**
    18011801 * Response to VM_FF_PGM_NEED_HANDY_PAGES and VMMCALLHOST_PGM_ALLOCATE_HANDY_PAGES.
    1802  * 
     1802 *
    18031803 * @returns VBox status code.
    18041804 * @retval  VINF_SUCCESS on success. FF cleared.
    18051805 * @retval  VINF_EM_NO_MEMORY if we're out of memory. The FF is not cleared in this case.
    1806  * 
     1806 *
    18071807 * @param   pVM         The VM handle.
    18081808 */
     
    18191819
    18201820/**
    1821  * Converts a HC pointer to a GC physical address. 
    1822  * 
     1821 * Converts a HC pointer to a GC physical address.
     1822 *
    18231823 * Only for the debugger.
    18241824 *
     
    18261826 * @retval  VINF_SUCCESS on success, *pGCPhys is set.
    18271827 * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
    1828  * 
     1828 *
    18291829 * @param   pVM     The VM handle.
    18301830 * @param   HCPtr   The HC pointer to convert.
     
    18401840 * @retval  VERR_PGM_PHYS_PAGE_RESERVED it it's a valid GC physical page but has no physical backing.
    18411841 * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
    1842  * 
     1842 *
    18431843 * @param   pVM     The VM handle.
    18441844 * @param   HCPtr   The HC pointer to convert.
     
    18491849/**
    18501850 * Converts a HC physical address to a GC physical address.
    1851  * 
     1851 *
    18521852 * Only for the debugger.
    18531853 *
     
    18551855 * @retval  VINF_SUCCESS on success, *pGCPhys is set.
    18561856 * @retval  VERR_INVALID_POINTER if the HC physical address is not within the GC physical memory.
    1857  * 
     1857 *
    18581858 * @param   pVM     The VM handle.
    18591859 * @param   HCPhys  The HC physical address to convert.
     
    18621862PGMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys);
    18631863
     1864/**
     1865 * Scans guest physical memory for a byte string.
     1866 *
     1867 * Only for the debugger.
     1868 *
     1869 * @returns VBox status codes:
     1870 * @retval  VINF_SUCCESS and *pGCPtrHit on success.
     1871 * @retval  VERR_DBGF_MEM_NOT_FOUND if not found.
     1872 * @retval  VERR_INVALID_POINTER if any of the pointer arguments are invalid.
     1873 * @retval  VERR_INVALID_ARGUMENT if any other arguments are invalid.
     1874 *
     1875 * @param   pVM             Pointer to the shared VM structure.
     1876 * @param   GCPhys          Where to start searching.
     1877 * @param   cbRange         The number of bytes to search. Max 256 bytes.
     1878 * @param   pabNeedle       The byte string to search for.
     1879 * @param   cbNeedle        The length of the byte string.
     1880 * @param   pGCPhysHit      Where to store the address of the first occurence on success.
     1881 */
     1882PDMR3DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit);
     1883
     1884/**
     1885 * Scans virtual memory for a byte string.
     1886 *
     1887 * Only for the debugger.
     1888 *
     1889 * @returns VBox status codes:
     1890 * @retval  VINF_SUCCESS and *pGCPtrHit on success.
     1891 * @retval  VERR_DBGF_MEM_NOT_FOUND if not found.
     1892 * @retval  VERR_INVALID_POINTER if any of the pointer arguments are invalid.
     1893 * @retval  VERR_INVALID_ARGUMENT if any other arguments are invalid.
     1894 *
     1895 * @param   pVM             Pointer to the shared VM structure.
     1896 * @param   GCPtr           Where to start searching.
     1897 * @param   cbRange         The number of bytes to search. Max 256 bytes.
     1898 * @param   pabNeedle       The byte string to search for.
     1899 * @param   cbNeedle        The length of the byte string.
     1900 * @param   pGCPtrHit       Where to store the address of the first occurence on success.
     1901 */
     1902PDMR3DECL(int) PGMR3DbgScanVirtual(PVM pVM, RTGCUINTPTR GCPtr, RTGCUINTPTR cbRange, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit);
     1903
    18641904/** @} */
    18651905
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