dbg.h revision 4a1654dd5b9f0ae4e149d909843a3ab07b8bec33
1N/A * IPRT - Debugging Routines. 1N/A * Copyright (C) 2008-2009 Sun Microsystems, Inc. 1N/A * This file is part of VirtualBox Open Source Edition (OSE), as 1N/A * you can redistribute it and/or modify it under the terms of the GNU 1N/A * General Public License (GPL) as published by the Free Software 1N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 1N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 1N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 1N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * additional information or have any questions. /** @defgroup grp_rt_dbg RTDbg - Debugging Routines /** Debug segment index. */ /** Pointer to a debug segment index. */ /** Pointer to a const debug segment index. */ /** NIL debug segment index. */ /** Special segment index that indicates that the offset is a relative * virtual address (RVA). I.e. an offset from the start of the module. */ /** Special segment index that indicates that the offset is a absolute. */ /** Max length (including '\\0') of a symbol name. */ /** Symbol value (address). */ /** Segment number when applicable or NIL_RTDBGSEGIDX. */ /** Symbol Flags. (reserved). */ /** Pointer to debug symbol. */ /** Pointer to const debug symbol. */ * Debug line number information. /** Segment number when applicable or NIL_RTDBGSEGIDX. */ /** Pointer to debug line number. */ /** Pointer to const debug line number. */ /** @defgroup grp_rt_dbgas RTDbgAs - Debug Address Space * Creates an empty address space. * @returns IPRT status code. * @param phDbgAs Where to store the address space handle on success. * @param FirstAddr The first address in the address space. * @param LastAddr The last address in the address space. * @param pszName The name of the address space. * Variant of RTDbgAsCreate that takes a name format string. * @returns IPRT status code. * @param phDbgAs Where to store the address space handle on success. * @param FirstAddr The first address in the address space. * @param LastAddr The last address in the address space. * @param pszNameFmt The name format of the address space. * @param va Format arguments. * Variant of RTDbgAsCreate that takes a name format string. * @returns IPRT status code. * @param phDbgAs Where to store the address space handle on success. * @param FirstAddr The first address in the address space. * @param LastAddr The last address in the address space. * @param pszNameFmt The name format of the address space. * @param ... Format arguments. * Destroys the address space. * This means unlinking all the modules it currently contains, potentially * causing some or all of them to be destroyed as they are managed by * @returns IPRT status code. * @param hDbgAs The address space handle. A NIL handle will * Gets the name of an address space. * @returns read only address space name. * NULL if hDbgAs is invalid. * @param hDbgAs The address space handle. * Gets the first address in an address space. * 0 if hDbgAs is invalid. * @param hDbgAs The address space handle. * Gets the last address in an address space. * 0 if hDbgAs is invalid. * @param hDbgAs The address space handle. * Gets the number of modules in the address space. * This can be used together with RTDbgAsModuleByIndex * to enumerate the modules. * @returns The number of modules. * @param hDbgAs The address space handle. * Links a module into the address space at the give address. * The size of the mapping is determined using RTDbgModImageSize(). * @returns IPRT status code. * @retval VERR_OUT_OF_RANGE if the specified address will put the module * outside the address space. * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings. * @param hDbgAs The address space handle. * @param hDbgMod The module handle of the module to be linked in. * @param ImageAddr The address to link the module at. * Links a segment into the address space at the give address. * The size of the mapping is determined using RTDbgModSegmentSize(). * @returns IPRT status code. * @retval VERR_OUT_OF_RANGE if the specified address will put the module * outside the address space. * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings. * @param hDbgAs The address space handle. * @param hDbgMod The module handle. * @param iSeg The segment number (0-based) of the segment to be * @param SegAddr The address to link the segment at. * Unlinks all the mappings of a module from the address space. * @returns IPRT status code. * @retval VERR_NOT_FOUND if the module wasn't found. * @param hDbgAs The address space handle. * @param hDbgMod The module handle of the module to be unlinked. * Unlinks the mapping at the specified address. * @returns IPRT status code. * @retval VERR_NOT_FOUND if no module or segment is mapped at that address. * @param hDbgAs The address space handle. * @param Addr The address within the mapping to be unlinked. * Get a the handle of a module in the address space by is index. * @returns A retained handle to the specified module. The caller must release * the returned reference. * NIL_RTDBGMOD if invalid index or handle. * @param hDbgAs The address space handle. * @param iModule The index of the module to get. * @remarks The module indexes may change after calls to RTDbgAsModuleLink, * RTDbgAsModuleLinkSeg, RTDbgAsModuleUnlink and * RTDbgAsModuleUnlinkByAddr. * Queries mapping module information by handle. * @returns IPRT status code. * @retval VERR_NOT_FOUND if no mapping was found at the specified address. * @param hDbgAs The address space handle. * @param Addr Address within the mapping of the module or segment. * @param phMod Where to the return the retained module handle. * @param pAddr Where to return the base address of the mapping. * @param piSeg Where to return the segment index. This is set to * NIL if the entire module is mapped as a single * Queries mapping module information by name. * @returns IPRT status code. * @retval VERR_NOT_FOUND if no mapping was found at the specified address. * @retval VERR_OUT_OF_RANGE if the name index was out of range. * @param hDbgAs The address space handle. * @param pszName The module name. * @param iName There can be more than one module by the same name * in an address space. This argument indicates which * @param phMod Where to the return the retained module handle. * Adds a symbol to a module in the address space. * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones. * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. * @retval VERR_NOT_FOUND if no module was found at the specified address. * @param hDbgAs The address space handle. * @param pszSymbol The symbol name. * @param Addr The address of the symbol. * @param cb The size of the symbol. * Query a symbol by address. * @returns IPRT status code. See RTDbgModSymbolAddr for more specific ones. * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. * @param hDbgAs The address space handle. * @param Addr The address which closest symbol is requested. * @param poffDisp Where to return the distance between the symbol * @param pSymbol Where to return the symbol info. * Query a symbol by address. * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones. * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. * @param hDbgAs The address space handle. * @param Addr The address which closest symbol is requested. * @param poffDisp Where to return the distance between the symbol * @param ppSymbol Where to return the pointer to the allocated * symbol info. Always set. Free with RTDbgSymbolFree. * Query a symbol by name. * @returns IPRT status code. * @retval VERR_SYMBOL_NOT_FOUND if not found. * @param hDbgAs The address space handle. * @param pszSymbol The symbol name. * @param pSymbol Where to return the symbol info. * Query a symbol by name. * @returns IPRT status code. * @retval VERR_SYMBOL_NOT_FOUND if not found. * @param hDbgAs The address space handle. * @param pszSymbol The symbol name. * @param ppSymbol Where to return the pointer to the allocated * symbol info. Always set. Free with RTDbgSymbolFree. * Query a line number by address. * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones. * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. * @param hDbgAs The address space handle. * @param Addr The address which closest symbol is requested. * @param poffDisp Where to return the distance between the line * @param pLine Where to return the line number information. * Query a line number by address. * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones. * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. * @param hDbgAs The address space handle. * @param Addr The address which closest symbol is requested. * @param poffDisp Where to return the distance between the line * @param ppLine Where to return the pointer to the allocated line * number info. Always set. Free with RTDbgLineFree. /** @todo Missing some bits here. */ /** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interpreter