dbg.h revision c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * IPRT - Debugging Routines.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Copyright (C) 2008-2009 Sun Microsystems, Inc.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * available from http://www.virtualbox.org. This file is free software;
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * you can redistribute it and/or modify it under the terms of the GNU
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * General Public License (GPL) as published by the Free Software
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * The contents of this file may alternatively be used under the terms
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * of the Common Development and Distribution License Version 1.0
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * VirtualBox OSE distribution, in which case the provisions of the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * CDDL are applicable instead of those of the GPL.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * You may elect to license modified versions of this file under the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * terms and conditions of either the GPL or the CDDL or both.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * additional information or have any questions.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** @defgroup grp_rt_dbg RTDbg - Debugging Routines
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @ingroup grp_rt
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Debug segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to a debug segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to a const debug segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** NIL debug segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** The last normal segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Special segment index that indicates that the offset is a relative
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * virtual address (RVA). I.e. an offset from the start of the module. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Special segment index that indicates that the offset is a absolute. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** The last valid special segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** The last valid special segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define RTDBGSEGIDX_SPECIAL_FIRST (RTDBGSEGIDX_LAST + 1U)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Max length (including '\\0') of a segment name. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define RTDBG_SEGMENT_NAME_LENGTH (128 - 8 - 8 - 8 - 4 - 4)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Debug module segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsynctypedef struct RTDBGSEGMENT
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** The load address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * RTUINTPTR_MAX if not applicable. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** The image relative virtual address of the segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * RTUINTPTR_MAX if not applicable. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** The segment size. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** The segment flags. (reserved) */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** The segment index. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Symbol name. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to a debug module segment. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to a const debug module segment. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Max length (including '\\0') of a symbol name. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define RTDBG_SYMBOL_NAME_LENGTH (384 - 8 - 8 - 8 - 4 - 4 - 8)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Debug symbol.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsynctypedef struct RTDBGSYMBOL
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Symbol value (address).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This depends a bit who you ask. It will be the same as offSeg when you
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Symbol size. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Offset into the segment specified by iSeg. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Segment number. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Symbol Flags. (reserved). */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Symbol ordinal.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This is set to UINT32_MAX if the ordinals aren't supported. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Symbol name. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to debug symbol. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to const debug symbol. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Allocate a new symbol structure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns Pointer to a new structure on success, NULL on failure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Duplicates a symbol structure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns Pointer to duplicate on success, NULL on failure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pSymbol The symbol to duplicate.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Free a symbol structure previously allocated by a RTDbg method.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pSymbol The symbol to free. NULL is ignored.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Max length (including '\\0') of a debug info file name. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Debug line number information.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsynctypedef struct RTDBGLINE
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This depends a bit who you ask. It will be the same as offSeg when you
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Offset into the segment specified by iSeg. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Segment number. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Line number. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Symbol ordinal.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This is set to UINT32_MAX if the ordinals aren't supported. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync /** Filename. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to debug line number. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Pointer to const debug line number. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Allocate a new line number structure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns Pointer to a new structure on success, NULL on failure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Duplicates a line number structure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns Pointer to duplicate on success, NULL on failure.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pLine The line number to duplicate.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Free a line number structure previously allocated by a RTDbg method.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pLine The line number to free. NULL is ignored.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** @defgroup grp_rt_dbgas RTDbgAs - Debug Address Space
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Creates an empty address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param phDbgAs Where to store the address space handle on success.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param FirstAddr The first address in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param LastAddr The last address in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszName The name of the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszName);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Variant of RTDbgAsCreate that takes a name format string.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param phDbgAs Where to store the address space handle on success.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param FirstAddr The first address in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param LastAddr The last address in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszNameFmt The name format of the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param va Format arguments.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsCreateV(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, va_list va);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Variant of RTDbgAsCreate that takes a name format string.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param phDbgAs Where to store the address space handle on success.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param FirstAddr The first address in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param LastAddr The last address in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszNameFmt The name format of the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param ... Format arguments.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsCreateF(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, ...);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Retains a reference to the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Release a reference to the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * When the reference count reaches zero, the address space is destroyed.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * That means unlinking all the modules it currently contains, potentially
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * causing some or all of them to be destroyed as they are managed by
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * reference counting.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle. The NIL handle is quietly
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * ignored and 0 is returned.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the name of an address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns read only address space name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * NULL if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the first address in an address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns The address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * 0 if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the last address in an address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns The address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * 0 if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the number of modules in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This can be used together with RTDbgAsModuleByIndex
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * to enumerate the modules.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns The number of modules.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(uint32_t) RTDbgAsModuleCount(RTDBGAS hDbgAs);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** @name Flags for RTDbgAsModuleLink and RTDbgAsModuleLinkSeg
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Replace all conflicting module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * (The conflicting modules will be removed the address space and their
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * references released.) */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** Mask containing the valid flags. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync#define RTDBGASLINK_FLAGS_VALID_MASK UINT32_C(0x00000001)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Links a module into the address space at the give address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * The size of the mapping is determined using RTDbgModImageSize().
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_OUT_OF_RANGE if the specified address will put the module
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * outside the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle of the module to be linked in.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param ImageAddr The address to link the module at.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param fFlags See RTDBGASLINK_FLAGS_*.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsModuleLink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTUINTPTR ImageAddr, uint32_t fFlags);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Links a segment into the address space at the give address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * The size of the mapping is determined using RTDbgModSegmentSize().
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_OUT_OF_RANGE if the specified address will put the module
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * outside the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param iSeg The segment number (0-based) of the segment to be
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * linked in.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param SegAddr The address to link the segment at.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param fFlags See RTDBGASLINK_FLAGS_*.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsModuleLinkSeg(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr, uint32_t fFlags);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Unlinks all the mappings of a module from the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if the module wasn't found.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle of the module to be unlinked.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsModuleUnlink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Unlinks the mapping at the specified address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if no module or segment is mapped at that address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr The address within the mapping to be unlinked.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsModuleUnlinkByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Get a the handle of a module in the address space by is index.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns A retained handle to the specified module. The caller must release
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * the returned reference.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * NIL_RTDBGMOD if invalid index or handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param iModule The index of the module to get.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks The module indexes may change after calls to RTDbgAsModuleLink,
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * RTDbgAsModuleLinkSeg, RTDbgAsModuleUnlink and
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * RTDbgAsModuleUnlinkByAddr.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(RTDBGMOD) RTDbgAsModuleByIndex(RTDBGAS hDbgAs, uint32_t iModule);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Queries mapping module information by handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr Address within the mapping of the module or segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param phMod Where to the return the retained module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pAddr Where to return the base address of the mapping.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param piSeg Where to return the segment index. This is set to
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * NIL if the entire module is mapped as a single
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * mapping. Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsModuleByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTDBGMOD phMod, PRTUINTPTR pAddr, PRTDBGSEGIDX piSeg);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Queries mapping module information by name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_OUT_OF_RANGE if the name index was out of range.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszName The module name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param iName There can be more than one module by the same name
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * in an address space. This argument indicates which
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * is ment. (0 based)
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param phMod Where to the return the retained module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsModuleByName(RTDBGAS hDbgAs, const char *pszName, uint32_t iName, PRTDBGMOD phMod);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Adds a symbol to a module in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if no module was found at the specified address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * custom symbols.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszSymbol The symbol name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr The address of the symbol.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param cb The size of the symbol.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param fFlags Symbol flags.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param piOrdinal Where to return the symbol ordinal on success. If
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * the interpreter doesn't do ordinals, this will be set to
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * UINT32_MAX. Optional
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query a symbol by address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code. See RTDbgModSymbolAddr for more specific ones.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr The address which closest symbol is requested.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param poffDisp Where to return the distance between the symbol
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * and address. Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pSymbol Where to return the symbol info.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query a symbol by address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr The address which closest symbol is requested.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param poffDisp Where to return the distance between the symbol
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * and address. Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param ppSymbol Where to return the pointer to the allocated
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * symbol info. Always set. Free with RTDbgSymbolFree.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query a symbol by name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_SYMBOL_NOT_FOUND if not found.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszSymbol The symbol name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pSymbol Where to return the symbol info.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsSymbolByName(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query a symbol by name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_SYMBOL_NOT_FOUND if not found.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszSymbol The symbol name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param ppSymbol Where to return the pointer to the allocated
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * symbol info. Always set. Free with RTDbgSymbolFree.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsSymbolByNameA(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query a line number by address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr The address which closest symbol is requested.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param poffDisp Where to return the distance between the line
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * number and address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pLine Where to return the line number information.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAs(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Adds a line number to a module in the address space.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if no module was found at the specified address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * custom symbols.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszFile The file name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param uLineNo The line number.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr The address of the symbol.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param piOrdinal Where to return the line number ordinal on success.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * If the interpreter doesn't do ordinals, this will be
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * set to UINT32_MAX. Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr, uint32_t *piOrdinal);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query a line number by address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgAs The address space handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param Addr The address which closest symbol is requested.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param poffDisp Where to return the distance between the line
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * number and address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param ppLine Where to return the pointer to the allocated line
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * number info. Always set. Free with RTDbgLineFree.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** @todo Missing some bits here. */
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync/** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interpreter
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Creates a module based on the default debug info container.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This can be used to manually load a module and its symbol. The primary user
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * group is the debug info interpreters, which use this API to create an
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * efficient debug info container behind the scenes and forward all queries to
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * it once the info has been loaded.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param phDbgMod Where to return the module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszName The name of the module (mandatory).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param cbSeg The size of initial segment. If zero, segments will
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * have to be added manually using RTDbgModSegmentAdd.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param fFlags Flags reserved for future extensions, MBZ for now.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, RTUINTPTR cbSeg, uint32_t fFlags);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModCreateDeferred(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR cb, uint32_t fFlags);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModCreateFromImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t fFlags);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModCreateFromMap(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR uSubtrahend, uint32_t fFlags);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Retains another reference to the module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Release a reference to the module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * When the reference count reaches zero, the module is destroyed.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle. The NIL handle is quietly ignored
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * and 0 is returned.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @remarks Will not take any locks.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the module name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns Pointer to a read only string containing the name.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(const char *) RTDbgModName(RTDBGMOD hDbgMod);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Converts an image relative address to a segment:offset address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns Segment index on success.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * NIL_RTDBGSEGIDX is returned if the module handle or the RVA are
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param uRva The image relative address to convert.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param poffSeg Where to return the segment offset. Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(RTDBGSEGIDX) RTDbgModRvaToSegOff(RTDBGMOD hDbgMod, RTUINTPTR uRva, PRTUINTPTR poffSeg);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Image size when mapped if segments are mapped adjecently.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * For ELF, PE, and Mach-O images this is (usually) a natural query, for LX and
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * NE and such it's a bit odder and the answer may not make much sense for them.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns Image mapped size.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * UINTPTR_MAX is returned if the handle is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(RTUINTPTR) RTDbgModImageSize(RTDBGMOD hDbgMod);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Adds a segment to the module. Optional feature.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This method is intended used for manually constructing debug info for a
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * module. The main usage is from other debug info interpreters that want to
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * avoid writing a debug info database and instead uses the standard container
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * behind the scenes.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_NOT_SUPPORTED if this feature isn't support by the debug info
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * interpreter. This is a common return code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_DBG_ADDRESS_WRAP if uRva+cb wraps around.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_DBG_SEGMENT_NAME_OUT_OF_RANGE if pszName is too short or long.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_PARAMETER if fFlags contains undefined flags.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_DBG_SPECIAL_SEGMENT if *piSeg is a special segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if *piSeg doesn't meet expectations.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param uRva The image relative address of the segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param cb The size of the segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pszName The segment name. Does not normally need to be
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * unique, although this is somewhat up to the
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * debug interpreter to decide.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param fFlags Segment flags. Reserved for future used, MBZ.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param piSeg The segment index or NIL_RTDBGSEGIDX on input.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * The assigned segment index on successful return.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Optional.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSegmentAdd(RTDBGMOD hDbgMod, RTUINTPTR uRva, RTUINTPTR cb, const char *pszName,
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the number of segments in the module.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This is can be used to determin the range which can be passed to
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * RTDbgModSegmentByIndex and derivates.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns The segment relative address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * NIL_RTDBGSEGIDX if the handle is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Query information about a segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This can be used together with RTDbgModSegmentCount to enumerate segments.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * The index starts a 0 and stops one below RTDbgModSegmentCount.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns IPRT status code.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if iSeg is too high.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_DBG_SPECIAL_SEGMENT if iSeg indicates a special segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param iSeg The segment index. No special segments.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param pSegInfo Where to return the segment info. The
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * RTDBGSEGMENT::Address member will be set to
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * RTUINTPTR_MAX or the load address used at link time.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSegmentByIndex(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, PRTDBGSEGMENT pSegInfo);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the size of a segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This is a just a wrapper around RTDbgModSegmentByIndex.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns The segment size.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * UINTPTR_MAX is returned if either the handle and segment index are
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param iSeg The segment index. RTDBGSEGIDX_ABS is not allowed.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * If RTDBGSEGIDX_RVA is used, the functions returns
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * the same value as RTDbgModImageSize.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(RTUINTPTR) RTDbgModSegmentSize(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * Gets the image relative address of a segment.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * This is a just a wrapper around RTDbgModSegmentByIndex.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @returns The segment relative address.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * UINTPTR_MAX is returned if either the handle and segment index are
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param hDbgMod The module handle.
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * @param iSeg The segment index. No special segment indexes
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsync * allowed (asserted).
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(RTUINTPTR) RTDbgModSegmentRva(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(uint32_t) RTDbgModSymbolCount(RTDBGMOD hDbgMod);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSymbolByIndex(RTDBGMOD hDbgMod, uint32_t iSymbol, PRTDBGSYMBOL pSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSymbolByName(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL pSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModSymbolByNameA(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t *piOrdinal);
9dca051a5f8ff457ef1692990f6ecfa280daf265vboxsyncRTDECL(int) RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLine);