dbg.h revision 3a4a6501d0ccd629d9951b644d380c7bb2d46086
/* $Id$ */
/** @file
* IPRT - Debugging Routines.
*/
/*
* Copyright (C) 2008-2009 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef ___iprt_dbg_h
#define ___iprt_dbg_h
/** @defgroup grp_rt_dbg RTDbg - Debugging Routines
* @ingroup grp_rt
* @{
*/
/** Debug segment index. */
typedef uint32_t RTDBGSEGIDX;
/** Pointer to a debug segment index. */
typedef RTDBGSEGIDX *PRTDBGSEGIDX;
/** Pointer to a const debug segment index. */
typedef RTDBGSEGIDX const *PCRTDBGSEGIDX;
/** 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. */
/**
* Debug symbol.
*/
typedef struct RTDBGSYMBOL
{
/** Symbol value (address). */
/** Segment number when applicable or NIL_RTDBGSEGIDX. */
/** Symbol size. */
/** Symbol Flags. (reserved). */
/** Symbol name. */
char szName[RTDBG_SYMBOL_NAME_LENGTH];
} RTDBGSYMBOL;
/** Pointer to debug symbol. */
typedef RTDBGSYMBOL *PRTDBGSYMBOL;
/** Pointer to const debug symbol. */
typedef const RTDBGSYMBOL *PCRTDBGSYMBOL;
/**
* Debug line number information.
*/
typedef struct RTDBGLINE
{
/** Address. */
/** Segment number when applicable or NIL_RTDBGSEGIDX. */
/** Line number. */
/** Filename. */
char szFilename[260];
} RTDBGLINE;
/** Pointer to debug line number. */
typedef RTDBGLINE *PRTDBGLINE;
/** Pointer to const debug line number. */
typedef const RTDBGLINE *PCRTDBGLINE;
/** @defgroup grp_rt_dbgas RTDbgAs - Debug Address Space
* @{
*/
RTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, const char *pszName, RTUINTPTR FirstAddr, RTUINTPTR LastAddr);
RTDECL(int) RTDbgAsModuleLinkSeg(PRTDBGAS phDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr);
/** @} */
/** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interperter
* @{
*/
RTDECL(int) RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, const char *pszImgFile, const char *pszDbgFile);
RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t cb);
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) RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLine);
RTDECL(int) RTDbgModLineByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE *ppLine);
/** @} */
/** @} */
#endif