dbgmodcontainer.cpp revision 7af218a7441de38fc9e814919db04bae3e917664
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <iprt/strcache.h>
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/**
* Symbol entry.
*/
typedef struct RTDBGMODCONTAINERSYMBOL
{
/** The address core. */
/** The name space core. */
/** The segent offset. */
/** The segment index. */
/** Pointer to a symbol entry in the debug info container. */
/**
* Segment entry.
*/
typedef struct RTDBGMODCONTAINERSEGMENT
{
/** The segment offset. */
/** The segment size. */
/** The segment name. */
const char *pszName;
/** Pointer to a segment entry in the debug info container. */
/**
* Instance data.
*/
typedef struct RTDBGMODCONTAINER
{
/** The name space. */
/** The address space tree. */
/** Segment table. */
/** The number of segments in the segment table. */
/** The image size. 0 means unlimited. */
/** Pointer to instance data for the debug info container. */
typedef RTDBGMODCONTAINER *PRTDBGMODCONTAINER;
/** @copydoc RTDBGMODVTDBG::pfnLineByAddr */
static DECLCALLBACK(int) rtDbgModContainer_LineByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTGCUINTPTR off, PRTGCINTPTR poffDisp, PRTDBGLINE pLine)
{
/** @todo Make it possible to add line numbers. */
return VERR_DBG_NO_LINE_NUMBERS;
}
/** @copydoc RTDBGMODVTDBG::pfnSymbolByAddr */
static DECLCALLBACK(int) rtDbgModContainer_SymbolByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTGCUINTPTR off, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol)
{
return VINF_SUCCESS;
}
/** @copydoc RTDBGMODVTDBG::pfnSymbolByName */
static DECLCALLBACK(int) rtDbgModContainer_SymbolByName(PRTDBGMODINT pMod, const char *pszSymbol, PRTDBGSYMBOL pSymbol)
{
return VINF_SUCCESS;
}
/** @copydoc RTDBGMODVTDBG::pfnSymbolAdd */
static DECLCALLBACK(int) rtDbgModContainer_SymbolAdd(PRTDBGMODINT pMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTGCUINTPTR off, uint32_t cbSymbol)
{
/*
* Address validation. The other arguments have already been validated.
*/
&& iSeg <= RTDBGSEGIDX_SPECIAL_LAST)
/*
* Create a new entry.
*/
if (!pSymbol)
return VERR_NO_MEMORY;
#if 0 /* continue on the workstation */
: off;
{
{
{
}
}
}
#endif
int rc = VERR_NOT_IMPLEMENTED;
return rc;
}
/** Destroy a symbol node. */
static DECLCALLBACK(int) rtDbgModContainer_DestroyTreeNode(PAVLRUINTPTRNODECORE pNode, void *pvUser)
{
return 0;
}
/** @copydoc RTDBGMODVTDBG::pfnClose */
{
/*
* Destroy the symbols and instance data.
*/
return VINF_SUCCESS;
}
/** @copydoc RTDBGMODVTDBG::pfnTryOpen */
{
return VERR_INTERNAL_ERROR_5;
}
/** Virtual function table for the debug info container. */
static RTDBGMODVTDBG const g_rtDbgModVtDbgContainer =
{
/*.u32Magic = */ RTDBGMODVTDBG_MAGIC,
/*.pszName = */ "container",
/*.pfnTryOpen = */ rtDbgModContainer_TryOpen,
/*.pfnClose = */ rtDbgModContainer_Close,
/*.pfnSymbolAdd = */ rtDbgModContainer_SymbolAdd,
/*.pfnSymbolByName = */ rtDbgModContainer_SymbolByName,
/*.pfnSymbolByAddr = */ rtDbgModContainer_SymbolByAddr,
/*.pfnLineByAddr = */ rtDbgModContainer_LineByAddr,
/*.u32EndMagic = */ RTDBGMODVTDBG_MAGIC
};
/**
* Creates a generic debug info container and associates it with the module.
*
* @returns IPRT status code.
* @param pMod The module instance.
* @param cb The module size.
*/
{
if (!pThis)
return VERR_NO_MEMORY;
return VINF_SUCCESS;
}