dbg.h revision 7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/* $Id$ */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @file
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * IPRT - Debugging Routines.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/*
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Copyright (C) 2008-2009 Sun Microsystems, Inc.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * available from http://www.virtualbox.org. This file is free software;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * General Public License (GPL) as published by the Free Software
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * The contents of this file may alternatively be used under the terms
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * of the Common Development and Distribution License Version 1.0
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * VirtualBox OSE distribution, in which case the provisions of the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * CDDL are applicable instead of those of the GPL.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * You may elect to license modified versions of this file under the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * terms and conditions of either the GPL or the CDDL or both.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * additional information or have any questions.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#ifndef ___iprt_dbg_h
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define ___iprt_dbg_h
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#include <iprt/types.h>
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#include <iprt/stdarg.h>
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsync
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsyncRT_C_DECLS_BEGIN
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsync
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsync/** @defgroup grp_rt_dbg RTDbg - Debugging Routines
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsync * @ingroup grp_rt
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsync * @{
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Debug segment index. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef uint32_t RTDBGSEGIDX;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a debug segment index. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef RTDBGSEGIDX *PRTDBGSEGIDX;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a const debug segment index. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef RTDBGSEGIDX const *PCRTDBGSEGIDX;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** NIL debug segment index. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define NIL_RTDBGSEGIDX UINT32_C(0xffffffff)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** The last normal segment index. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBGSEGIDX_LAST UINT32_C(0xffffffef)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Special segment index that indicates that the offset is a relative
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * virtual address (RVA). I.e. an offset from the start of the module. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBGSEGIDX_RVA UINT32_C(0xfffffff0)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Special segment index that indicates that the offset is a absolute. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBGSEGIDX_ABS UINT32_C(0xfffffff1)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** The last valid special segment index. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBGSEGIDX_SPECIAL_LAST RTDBGSEGIDX_ABS
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** The last valid special segment index. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBGSEGIDX_SPECIAL_FIRST (RTDBGSEGIDX_LAST + 1U)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Max length (including '\\0') of a symbol name. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBG_SYMBOL_NAME_LENGTH (512 - 8 - 4 - 4 - 4)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Debug symbol.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct RTDBGSYMBOL
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync{
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Symbol value (address).
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This depends a bit who you ask. It will be the same as offSeg when you
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync RTUINTPTR Value;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Offset into the segment specified by iSeg. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync RTUINTPTR offSeg;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Segment number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync RTDBGSEGIDX iSeg;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Symbol size. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync uint32_t cb;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Symbol Flags. (reserved). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync uint32_t fFlags;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Symbol name. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync char szName[RTDBG_SYMBOL_NAME_LENGTH];
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync} RTDBGSYMBOL;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to debug symbol. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef RTDBGSYMBOL *PRTDBGSYMBOL;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to const debug symbol. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef const RTDBGSYMBOL *PCRTDBGSYMBOL;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Allocate a new symbol structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Pointer to a new structure on success, NULL on failure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(PRTDBGSYMBOL) RTDbgSymbolAlloc(void);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Duplicates a symbol structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Pointer to duplicate on success, NULL on failure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pSymbol The symbol to duplicate.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Free a symbol structure previously allocated by a RTDbg method.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pSymbol The symbol to free. NULL is ignored.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(void) RTDbgSymbolFree(PRTDBGSYMBOL pSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Max length (including '\\0') of a debug info file name. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBG_FILE_NAME_LENGTH (260)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Debug line number information.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct RTDBGLINE
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync{
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Address.
11b175175a0ed424b8e8354acda681ad0adde0f8vboxsync * This depends a bit who you ask. It will be the same as offSeg when you
11b175175a0ed424b8e8354acda681ad0adde0f8vboxsync * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync RTUINTPTR Address;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Offset into the segment specified by iSeg. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync RTUINTPTR offSeg;
11b175175a0ed424b8e8354acda681ad0adde0f8vboxsync /** Segment number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync RTDBGSEGIDX iSeg;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Line number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync uint32_t uLineNo;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Filename. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync char szFilename[RTDBG_FILE_NAME_LENGTH];
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync} RTDBGLINE;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to debug line number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef RTDBGLINE *PRTDBGLINE;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to const debug line number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef const RTDBGLINE *PCRTDBGLINE;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Allocate a new line number structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Pointer to a new structure on success, NULL on failure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(PRTDBGLINE) RTDbgLineAlloc(void);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Duplicates a line number structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Pointer to duplicate on success, NULL on failure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pLine The line number to duplicate.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(PRTDBGLINE) RTDbgLineDup(PCRTDBGLINE pLine);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Free a line number structure previously allocated by a RTDbg method.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pLine The line number to free. NULL is ignored.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(void) RTDbgLineFree(PRTDBGLINE pLine);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @defgroup grp_rt_dbgas RTDbgAs - Debug Address Space
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @{
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Creates an empty address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param phDbgAs Where to store the address space handle on success.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param FirstAddr The first address in the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param LastAddr The last address in the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszName The name of the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszName);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Variant of RTDbgAsCreate that takes a name format string.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param phDbgAs Where to store the address space handle on success.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param FirstAddr The first address in the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param LastAddr The last address in the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszNameFmt The name format of the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param va Format arguments.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsCreateV(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, va_list va);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Variant of RTDbgAsCreate that takes a name format string.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param phDbgAs Where to store the address space handle on success.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param FirstAddr The first address in the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param LastAddr The last address in the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszNameFmt The name format of the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param ... Format arguments.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsCreateF(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, ...);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Retains a reference to the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remarks Will not take any locks.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(uint32_t) RTDbgAsRetain(RTDBGAS hDbgAs);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Release a reference to the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * When the reference count reaches zero, the address space is destroyed.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * That means unlinking all the modules it currently contains, potentially
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * causing some or all of them to be destroyed as they are managed by
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * reference counting.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle. The NIL handle is quietly
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * ignored and 0 is returned.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remarks Will not take any locks.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(uint32_t) RTDbgAsRelease(RTDBGAS hDbgAs);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the name of an address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns read only address space name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * NULL if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remarks Will not take any locks.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(const char *) RTDbgAsName(RTDBGAS hDbgAs);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the first address in an address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns The address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * 0 if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remarks Will not take any locks.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(RTUINTPTR) RTDbgAsFirstAddr(RTDBGAS hDbgAs);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the last address in an address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns The address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * 0 if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remarks Will not take any locks.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(RTUINTPTR) RTDbgAsLastAddr(RTDBGAS hDbgAs);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the number of modules in the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This can be used together with RTDbgAsModuleByIndex
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * to enumerate the modules.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns The number of modules.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remarks Will not take any locks.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(uint32_t) RTDbgAsModuleCount(RTDBGAS hDbgAs);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @name Flags for RTDbgAsModuleLink and RTDbgAsModuleLinkSeg
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @{ */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Replace all conflicting module.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * (The conflicting modules will be removed the address space and their
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * references released.) */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBGASLINK_FLAGS_REPLACE RT_BIT_32(0)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Mask containing the valid flags. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define RTDBGASLINK_FLAGS_VALID_MASK UINT32_C(0x00000001)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @} */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Links a module into the address space at the give address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * The size of the mapping is determined using RTDbgModImageSize().
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_OUT_OF_RANGE if the specified address will put the module
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * outside the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgMod The module handle of the module to be linked in.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param ImageAddr The address to link the module at.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param fFlags See RTDBGASLINK_FLAGS_*.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsModuleLink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTUINTPTR ImageAddr, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Links a segment into the address space at the give address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * The size of the mapping is determined using RTDbgModSegmentSize().
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_OUT_OF_RANGE if the specified address will put the module
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * outside the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgMod The module handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iSeg The segment number (0-based) of the segment to be
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * linked in.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param SegAddr The address to link the segment at.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param fFlags See RTDBGASLINK_FLAGS_*.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsModuleLinkSeg(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Unlinks all the mappings of a module from the address space.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if the module wasn't found.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgMod The module handle of the module to be unlinked.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsModuleUnlink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Unlinks the mapping at the specified address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if no module or segment is mapped at that address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param Addr The address within the mapping to be unlinked.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsModuleUnlinkByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Get a the handle of a module in the address space by is index.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns A retained handle to the specified module. The caller must release
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * the returned reference.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * NIL_RTDBGMOD if invalid index or handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iModule The index of the module to get.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remarks The module indexes may change after calls to RTDbgAsModuleLink,
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * RTDbgAsModuleLinkSeg, RTDbgAsModuleUnlink and
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * RTDbgAsModuleUnlinkByAddr.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(RTDBGMOD) RTDbgAsModuleByIndex(RTDBGAS hDbgAs, uint32_t iModule);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Queries mapping module information by handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param Addr Address within the mapping of the module or segment.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param phMod Where to the return the retained module handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Optional.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pAddr Where to return the base address of the mapping.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Optional.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param piSeg Where to return the segment index. This is set to
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * NIL if the entire module is mapped as a single
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * mapping. Optional.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsModuleByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTDBGMOD phMod, PRTUINTPTR pAddr, PRTDBGSEGIDX piSeg);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Queries mapping module information by name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_OUT_OF_RANGE if the name index was out of range.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszName The module name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iName There can be more than one module by the same name
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * in an address space. This argument indicates which
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * is ment. (0 based)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param phMod Where to the return the retained module handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsModuleByName(RTDBGAS hDbgAs, const char *pszName, uint32_t iName, PRTDBGMOD phMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Adds a symbol to a module in the address space.
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsync *
c10a6f0c7041e4d1ee50ad38425aab9d43c55522vboxsync * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if no module was found at the specified address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * custom symbols.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszSymbol The symbol name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param Addr The address of the symbol.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param cb The size of the symbol.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param fFlags Symbol flags.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Query a symbol by address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code. See RTDbgModSymbolAddr for more specific ones.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param Addr The address which closest symbol is requested.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param poffDisp Where to return the distance between the symbol
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * and address. Optional.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pSymbol Where to return the symbol info.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Query a symbol by address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param Addr The address which closest symbol is requested.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param poffDisp Where to return the distance between the symbol
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * and address. Optional.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param ppSymbol Where to return the pointer to the allocated
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * symbol info. Always set. Free with RTDbgSymbolFree.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Query a symbol by name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if not found.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszSymbol The symbol name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pSymbol Where to return the symbol info.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsSymbolByName(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Query a symbol by name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if not found.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszSymbol The symbol name.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param ppSymbol Where to return the pointer to the allocated
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * symbol info. Always set. Free with RTDbgSymbolFree.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsSymbolByNameA(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Query a line number by address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param Addr The address which closest symbol is requested.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param poffDisp Where to return the distance between the line
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * number and address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pLine Where to return the line number information.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAs(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/**
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Query a line number by address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync *
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param hDbgAs The address space handle.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param Addr The address which closest symbol is requested.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param poffDisp Where to return the distance between the line
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * number and address.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param ppLine Where to return the pointer to the allocated line
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * number info. Always set. Free with RTDbgLineFree.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @todo Missing some bits here. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @} */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interpreter
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @{
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, RTUINTPTR cb, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModCreateDeferred(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR cb, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModCreateFromImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModCreateFromMap(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR uSubtrahend, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(uint32_t) RTDbgModRetain(RTDBGMOD hDbgMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(uint32_t) RTDbgModRelease(RTDBGMOD hDbgMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(const char *) RTDbgModName(RTDBGMOD hDbgMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(RTUINTPTR) RTDbgModImageSize(RTDBGMOD hDbgMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(RTUINTPTR) RTDbgModSegmentSize(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(RTUINTPTR) RTDbgModSegmentRva(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(uint32_t) RTDbgModSymbolCount(RTDBGMOD hDbgMod);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModSymbolByIndex(RTDBGMOD hDbgMod, uint32_t iSymbol, PRTDBGSYMBOL pSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModSymbolByName(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL pSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModSymbolByNameA(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLine);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRTDECL(int) RTDbgModLineByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE *ppLine);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @} */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @} */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsyncRT_C_DECLS_END
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#endif
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync