dbgmodcontainer.cpp revision de6e321f351aa489a6a62bed474390a0056e8093
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync/*******************************************************************************
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync* Header Files *
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync*******************************************************************************/
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/*******************************************************************************
de6e321f351aa489a6a62bed474390a0056e8093vboxsync* Structures and Typedefs *
de6e321f351aa489a6a62bed474390a0056e8093vboxsync*******************************************************************************/
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * Symbol entry.
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The address core. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The name space core. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The name. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The segent offset. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The segment index. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** Pointer to a symbol entry in the debug info container. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsynctypedef RTDBGMODCONTAINERSYMBOL *PRTDBGMODCONTAINERSYMBOL;
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * Segment entry.
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The segment offset. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The segment size. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The segment name. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync const char *pszName;
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** Pointer to a segment entry in the debug info container. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsynctypedef RTDBGMODCONTAINERSEGMENT *PRTDBGMODCONTAINERSEGMENT;
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * Instance data.
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The name space. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The address space tree. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** Segment table. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The number of segments in the segment table. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync /** The image size. 0 means unlimited. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** Pointer to instance data for the debug info container. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** @copydoc RTDBGMODVTDBG::pfnLineByAddr */
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncstatic DECLCALLBACK(int) rtDbgModContainer_LineByAddr(PRTDBGMODINT pMod, uint32_t iSeg, RTGCUINTPTR off, PRTGCINTPTR poffDisp, PRTDBGLINE pLine)
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** @copydoc RTDBGMODVTDBG::pfnSymbolByAddr */
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncstatic DECLCALLBACK(int) rtDbgModContainer_SymbolByAddr(PRTDBGMODINT pMod, uint32_t iSeg, RTGCUINTPTR off, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol)
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** @copydoc RTDBGMODVTDBG::pfnSymbolByName */
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncstatic DECLCALLBACK(int) rtDbgModContainer_SymbolByName(PRTDBGMODINT pMod, const char *pszSymbol, PRTDBGSYMBOL pSymbol)
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync/** @copydoc RTDBGMODVTDBG::pfnSymbolAdd */
172ae196da38208e5f1e3485715a89f2d53c6880vboxsyncstatic DECLCALLBACK(int) rtDbgModContainer_SymbolAdd(PRTDBGMODINT pMod, const char *pszSymbol, uint32_t iSeg, RTGCUINTPTR off, RTUINT cbSymbol)
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** Destroy a symbol node. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncstatic DECLCALLBACK(int) rtDbgModContainer_DestroyTreeNode(PAVLRUINTPTRNODECORE pNode, void *pvUser)
de6e321f351aa489a6a62bed474390a0056e8093vboxsync PRTDBGMODCONTAINERSYMBOL pSym = RT_FROM_MEMBER(pNode, RTDBGMODCONTAINERSYMBOL, AddrCore);
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** @copydoc RTDBGMODVTDBG::pfnClose */
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncstatic DECLCALLBACK(int) rtDbgModContainer_Close(PRTDBGMODINT pMod)
de6e321f351aa489a6a62bed474390a0056e8093vboxsync PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * Destroy the symbols and instance data.
de6e321f351aa489a6a62bed474390a0056e8093vboxsync RTAvlrUIntPtrDestroy(&pThis->AddrTree, rtDbgModContainer_DestroyTreeNode, NULL);
de6e321f351aa489a6a62bed474390a0056e8093vboxsync/** @copydoc RTDBGMODVTDBG::pfnTryOpen */
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncstatic DECLCALLBACK(int) rtDbgModContainer_TryOpen(PRTDBGMODINT pMod)
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync/** Virtual function table for the debug info container. */
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncstatic RTDBGMODVTDBG const g_rtDbgModVtDbgContainer =
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync /*.fSupports = */ 0, ///@todo iprt/types.h isn't up to date...
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync /*.pfnSymbolByName = */ rtDbgModContainer_SymbolByName,
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync /*.pfnSymbolByAddr = */ rtDbgModContainer_SymbolByAddr,
172ae196da38208e5f1e3485715a89f2d53c6880vboxsync /*.pfnLineByAddr = */ rtDbgModContainer_LineByAddr,
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * Creates a
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * @returns IPRT status code.
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * @param pMod The module instance.
de6e321f351aa489a6a62bed474390a0056e8093vboxsync * @param cb The module size.
de6e321f351aa489a6a62bed474390a0056e8093vboxsyncint rtDbgModContainerCreate(PRTDBGMODINT pMod, RTUINTPTR cb)