dbg.h revision ca3da10d05961c339b5180fbd40a54587d6bad35
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * IPRT - Debugging Routines.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Copyright (C) 2008-2009 Sun Microsystems, Inc.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * This file is part of VirtualBox Open Source Edition (OSE), as
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * available from http://www.virtualbox.org. This file is free software;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * you can redistribute it and/or modify it under the terms of the GNU
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * General Public License (GPL) as published by the Free Software
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Foundation, in version 2 as it comes in the "COPYING" file of the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * The contents of this file may alternatively be used under the terms
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * of the Common Development and Distribution License Version 1.0
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * VirtualBox OSE distribution, in which case the provisions of the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * CDDL are applicable instead of those of the GPL.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * You may elect to license modified versions of this file under the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * terms and conditions of either the GPL or the CDDL or both.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Clara, CA 95054 USA or visit http://www.sun.com if you need
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * additional information or have any questions.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** @defgroup grp_rt_dbg RTDbg - Debugging Routines
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * @ingroup grp_rt
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** Debug segment index. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** Pointer to a debug segment index. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** Pointer to a const debug segment index. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** NIL debug segment index. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** The last normal segment index. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** Special segment index that indicates that the offset is a relative
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * virtual address (RVA). I.e. an offset from the start of the module. */
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk/** Special segment index that indicates that the offset is a absolute. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** The last valid special segment index. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** The last valid special segment index. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define RTDBGSEGIDX_SPECIAL_FIRST (RTDBGSEGIDX_LAST + 1U)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** Max length (including '\\0') of a symbol name. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define RTDBG_SYMBOL_NAME_LENGTH (512 - 8 - 4 - 4 - 4)
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk * Debug symbol.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /** Symbol value (address).
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * This depends a bit who you ask. It will be the same as offSeg when you
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk /** Offset into the segment specified by iSeg. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /** Segment number. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /** Symbol size. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /** Symbol Flags. (reserved). */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /** Symbol name. */
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk/** Pointer to debug symbol. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** Pointer to const debug symbol. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Allocate a new symbol structure.
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk * @returns Pointer to a new structure on success, NULL on failure.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Duplicates a symbol structure.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * @returns Pointer to duplicate on success, NULL on failure.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * @param pSymbol The symbol to duplicate.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkRTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymbol);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Free a symbol structure previously allocated by a RTDbg method.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * @param pSymbol The symbol to free. NULL is ignored.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkRTDECL(void) RTDbgSymbolFree(PRTDBGSYMBOL pSymbol);
typedef struct RTDBGLINE
} RTDBGLINE;
RTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszName);
RTDECL(int) RTDbgAsCreateV(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, va_list va);
RTDECL(int) RTDbgAsCreateF(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, ...);
RTDECL(int) RTDbgAsModuleLink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTUINTPTR ImageAddr, uint32_t fFlags);
RTDECL(int) RTDbgAsModuleLinkSeg(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr, uint32_t fFlags);
RTDECL(int) RTDbgAsModuleByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTDBGMOD phMod, PRTUINTPTR pAddr, PRTDBGSEGIDX piSeg);
RTDECL(int) RTDbgAsModuleByName(RTDBGAS hDbgAs, const char *pszName, uint32_t iName, PRTDBGMOD phMod);
RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags);
RTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol);
RTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymbol);
RTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine);
RTDECL(int) RTDbgModCreateDeferred(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR cb, uint32_t fFlags);
RTDECL(int) RTDbgModCreateFromImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t fFlags);
RTDECL(int) RTDbgModCreateFromMap(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR uSubtrahend, uint32_t fFlags);
RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags);
RTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol);
RTDECL(int) RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymbol);
RTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off);
RTDECL(int) RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLine);