dbg.h revision 9d020a0622f95aec3aabaff436a495e88dbbd71a
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/* $Id$ */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @file
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * IPRT - Debugging Routines.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/*
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * Copyright (C) 2008-2009 Sun Microsystems, Inc.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync *
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * available from http://www.virtualbox.org. This file is free software;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * you can redistribute it and/or modify it under the terms of the GNU
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * General Public License (GPL) as published by the Free Software
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync *
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * The contents of this file may alternatively be used under the terms
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * of the Common Development and Distribution License Version 1.0
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * VirtualBox OSE distribution, in which case the provisions of the
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * CDDL are applicable instead of those of the GPL.
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync *
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * You may elect to license modified versions of this file under the
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * terms and conditions of either the GPL or the CDDL or both.
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync *
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * additional information or have any questions.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#ifndef ___iprt_dbg_h
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#define ___iprt_dbg_h
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#include <iprt/types.h>
032a52c5b2984e26e84c2961f8f7f98a3954c8f2vboxsync#include <iprt/stdarg.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsyncRT_C_DECLS_BEGIN
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @defgroup grp_rt_dbg RTDbg - Debugging Routines
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * @ingroup grp_rt
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * @{
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Debug segment index. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef uint32_t RTDBGSEGIDX;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to a debug segment index. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef RTDBGSEGIDX *PRTDBGSEGIDX;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to a const debug segment index. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef RTDBGSEGIDX const *PCRTDBGSEGIDX;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** NIL debug segment index. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync#define NIL_RTDBGSEGIDX UINT32_C(0xffffffff)
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/** The last normal segment index. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync#define RTDBGSEGIDX_LAST UINT32_C(0xffffffef)
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Special segment index that indicates that the offset is a relative
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * virtual address (RVA). I.e. an offset from the start of the module. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync#define RTDBGSEGIDX_RVA UINT32_C(0xfffffff0)
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Special segment index that indicates that the offset is a absolute. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync#define RTDBGSEGIDX_ABS UINT32_C(0xfffffff1)
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync/** The last valid special segment index. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync#define RTDBGSEGIDX_SPECIAL_LAST RTDBGSEGIDX_ABS
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync/** The last valid special segment index. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync#define RTDBGSEGIDX_SPECIAL_FIRST (RTDBGSEGIDX_LAST + 1U)
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync/** Max length (including '\\0') of a segment name. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync#define RTDBG_SEGMENT_NAME_LENGTH (128 - 8 - 8 - 8 - 4 - 4)
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync/**
044af0d1e6474076366759db86f101778c5f20ccvboxsync * Debug module segment.
044af0d1e6474076366759db86f101778c5f20ccvboxsync */
044af0d1e6474076366759db86f101778c5f20ccvboxsynctypedef struct RTDBGSEGMENT
044af0d1e6474076366759db86f101778c5f20ccvboxsync{
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** The load address.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * RTUINTPTR_MAX if not applicable. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync RTUINTPTR Address;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** The image relative virtual address of the segment.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * RTUINTPTR_MAX if not applicable. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync RTUINTPTR uRva;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** The segment size. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync RTUINTPTR cb;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** The segment flags. (reserved) */
044af0d1e6474076366759db86f101778c5f20ccvboxsync uint32_t fFlags;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** The segment index. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync RTDBGSEGIDX iSeg;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Symbol name. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync char szName[RTDBG_SEGMENT_NAME_LENGTH];
044af0d1e6474076366759db86f101778c5f20ccvboxsync} RTDBGSEGMENT;
044af0d1e6474076366759db86f101778c5f20ccvboxsync/** Pointer to a debug module segment. */
044af0d1e6474076366759db86f101778c5f20ccvboxsynctypedef RTDBGSEGMENT *PRTDBGSEGMENT;
044af0d1e6474076366759db86f101778c5f20ccvboxsync/** Pointer to a const debug module segment. */
044af0d1e6474076366759db86f101778c5f20ccvboxsynctypedef RTDBGSEGMENT const *PCRTDBGSEGMENT;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Max length (including '\\0') of a symbol name. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync#define RTDBG_SYMBOL_NAME_LENGTH (384 - 8 - 8 - 8 - 4 - 4 - 8)
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/**
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * Debug symbol.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef struct RTDBGSYMBOL
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync{
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Symbol value (address).
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * This depends a bit who you ask. It will be the same as offSeg when you
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RTUINTPTR Value;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Symbol size. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync RTUINTPTR cb;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Offset into the segment specified by iSeg. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync RTUINTPTR offSeg;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Segment number. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RTDBGSEGIDX iSeg;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Symbol Flags. (reserved). */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync uint32_t fFlags;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Symbol ordinal.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * This is set to UINT32_MAX if the ordinals aren't supported. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync uint32_t iOrdinal;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Symbol name. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync char szName[RTDBG_SYMBOL_NAME_LENGTH];
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync} RTDBGSYMBOL;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to debug symbol. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef RTDBGSYMBOL *PRTDBGSYMBOL;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to const debug symbol. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef const RTDBGSYMBOL *PCRTDBGSYMBOL;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync/**
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * Allocate a new symbol structure.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync *
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * @returns Pointer to a new structure on success, NULL on failure.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsyncRTDECL(PRTDBGSYMBOL) RTDbgSymbolAlloc(void);
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync/**
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * Duplicates a symbol structure.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync *
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * @returns Pointer to duplicate on success, NULL on failure.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync *
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * @param pSymInfo The symbol info to duplicate.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymInfo);
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync/**
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * Free a symbol structure previously allocated by a RTDbg method.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync *
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * @param pSymInfo The symbol info to free. NULL is ignored.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(void) RTDbgSymbolFree(PRTDBGSYMBOL pSymInfo);
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync/** Max length (including '\\0') of a debug info file name. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync#define RTDBG_FILE_NAME_LENGTH (260)
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/**
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * Debug line number information.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef struct RTDBGLINE
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync{
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Address.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * This depends a bit who you ask. It will be the same as offSeg when you
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RTUINTPTR Address;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Offset into the segment specified by iSeg. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync RTUINTPTR offSeg;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Segment number. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RTDBGSEGIDX iSeg;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Line number. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync uint32_t uLineNo;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Symbol ordinal.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * This is set to UINT32_MAX if the ordinals aren't supported. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync uint32_t iOrdinal;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Filename. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync char szFilename[RTDBG_FILE_NAME_LENGTH];
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync} RTDBGLINE;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to debug line number. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef RTDBGLINE *PRTDBGLINE;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to const debug line number. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef const RTDBGLINE *PCRTDBGLINE;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync/**
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * Allocate a new line number structure.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync *
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * @returns Pointer to a new structure on success, NULL on failure.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsyncRTDECL(PRTDBGLINE) RTDbgLineAlloc(void);
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync/**
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * Duplicates a line number structure.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync *
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * @returns Pointer to duplicate on success, NULL on failure.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync *
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * @param pLine The line number to duplicate.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsyncRTDECL(PRTDBGLINE) RTDbgLineDup(PCRTDBGLINE pLine);
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync/**
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * Free a line number structure previously allocated by a RTDbg method.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync *
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * @param pLine The line number to free. NULL is ignored.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsyncRTDECL(void) RTDbgLineFree(PRTDBGLINE pLine);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @defgroup grp_rt_dbgas RTDbgAs - Debug Address Space
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * @{
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Creates an empty address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param phDbgAs Where to store the address space handle on success.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param FirstAddr The first address in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param LastAddr The last address in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pszName The name of the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszName);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Variant of RTDbgAsCreate that takes a name format string.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param phDbgAs Where to store the address space handle on success.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param FirstAddr The first address in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param LastAddr The last address in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pszNameFmt The name format of the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param va Format arguments.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsCreateV(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, va_list va);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Variant of RTDbgAsCreate that takes a name format string.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param phDbgAs Where to store the address space handle on success.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param FirstAddr The first address in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param LastAddr The last address in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pszNameFmt The name format of the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param ... Format arguments.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsCreateF(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, ...);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * Retains a reference to the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @param hDbgAs The address space handle.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @remarks Will not take any locks.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsyncRTDECL(uint32_t) RTDbgAsRetain(RTDBGAS hDbgAs);
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/**
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * Release a reference to the address space.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * When the reference count reaches zero, the address space is destroyed.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * That means unlinking all the modules it currently contains, potentially
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * causing some or all of them to be destroyed as they are managed by
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * reference counting.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @param hDbgAs The address space handle. The NIL handle is quietly
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * ignored and 0 is returned.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @remarks Will not take any locks.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsyncRTDECL(uint32_t) RTDbgAsRelease(RTDBGAS hDbgAs);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Gets the name of an address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns read only address space name.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * NULL if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @remarks Will not take any locks.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(const char *) RTDbgAsName(RTDBGAS hDbgAs);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Gets the first address in an address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns The address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * 0 if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @remarks Will not take any locks.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(RTUINTPTR) RTDbgAsFirstAddr(RTDBGAS hDbgAs);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Gets the last address in an address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns The address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * 0 if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @remarks Will not take any locks.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(RTUINTPTR) RTDbgAsLastAddr(RTDBGAS hDbgAs);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Gets the number of modules in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * This can be used together with RTDbgAsModuleByIndex
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * to enumerate the modules.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns The number of modules.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync *
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @remarks Will not take any locks.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(uint32_t) RTDbgAsModuleCount(RTDBGAS hDbgAs);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/** @name Flags for RTDbgAsModuleLink and RTDbgAsModuleLinkSeg
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @{ */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/** Replace all conflicting module.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * (The conflicting modules will be removed the address space and their
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * references released.) */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync#define RTDBGASLINK_FLAGS_REPLACE RT_BIT_32(0)
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/** Mask containing the valid flags. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync#define RTDBGASLINK_FLAGS_VALID_MASK UINT32_C(0x00000001)
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/** @} */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Links a module into the address space at the give address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * The size of the mapping is determined using RTDbgModImageSize().
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_OUT_OF_RANGE if the specified address will put the module
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * outside the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgMod The module handle of the module to be linked in.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param ImageAddr The address to link the module at.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @param fFlags See RTDBGASLINK_FLAGS_*.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsyncRTDECL(int) RTDbgAsModuleLink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTUINTPTR ImageAddr, uint32_t fFlags);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Links a segment into the address space at the give address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * The size of the mapping is determined using RTDbgModSegmentSize().
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_OUT_OF_RANGE if the specified address will put the module
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * outside the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgMod The module handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param iSeg The segment number (0-based) of the segment to be
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * linked in.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param SegAddr The address to link the segment at.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * @param fFlags See RTDBGASLINK_FLAGS_*.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsyncRTDECL(int) RTDbgAsModuleLinkSeg(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr, uint32_t fFlags);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Unlinks all the mappings of a module from the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if the module wasn't found.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgMod The module handle of the module to be unlinked.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsModuleUnlink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Unlinks the mapping at the specified address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if no module or segment is mapped at that address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param Addr The address within the mapping to be unlinked.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsModuleUnlinkByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Get a the handle of a module in the address space by is index.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns A retained handle to the specified module. The caller must release
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * the returned reference.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * NIL_RTDBGMOD if invalid index or handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param iModule The index of the module to get.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @remarks The module indexes may change after calls to RTDbgAsModuleLink,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * RTDbgAsModuleLinkSeg, RTDbgAsModuleUnlink and
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * RTDbgAsModuleUnlinkByAddr.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(RTDBGMOD) RTDbgAsModuleByIndex(RTDBGAS hDbgAs, uint32_t iModule);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Queries mapping module information by handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param Addr Address within the mapping of the module or segment.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param phMod Where to the return the retained module handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Optional.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pAddr Where to return the base address of the mapping.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Optional.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param piSeg Where to return the segment index. This is set to
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * NIL if the entire module is mapped as a single
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * mapping. Optional.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsModuleByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTDBGMOD phMod, PRTUINTPTR pAddr, PRTDBGSEGIDX piSeg);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Queries mapping module information by name.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_OUT_OF_RANGE if the name index was out of range.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pszName The module name.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param iName There can be more than one module by the same name
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * in an address space. This argument indicates which
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * is ment. (0 based)
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param phMod Where to the return the retained module handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsModuleByName(RTDBGAS hDbgAs, const char *pszName, uint32_t iName, PRTDBGMOD phMod);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Adds a symbol to a module in the address space.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if no module was found at the specified address.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * custom symbols.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pszSymbol The symbol name.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param Addr The address of the symbol.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param cb The size of the symbol.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * @param fFlags Symbol flags.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @param piOrdinal Where to return the symbol ordinal on success. If
044af0d1e6474076366759db86f101778c5f20ccvboxsync * the interpreter doesn't do ordinals, this will be set to
044af0d1e6474076366759db86f101778c5f20ccvboxsync * UINT32_MAX. Optional
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
044af0d1e6474076366759db86f101778c5f20ccvboxsyncRTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Query a symbol by address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code. See RTDbgModSymbolAddr for more specific ones.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param Addr The address which closest symbol is requested.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param poffDisp Where to return the distance between the symbol
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * and address. Optional.
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * @param pSymInfo Where to return the symbol info.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param phMod Where to return the module handle. Optional.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsyncRTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo, PRTDBGMOD phMod);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Query a symbol by address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param Addr The address which closest symbol is requested.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param poffDisp Where to return the distance between the symbol
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * and address. Optional.
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * @param ppSymInfo Where to return the pointer to the allocated symbol
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * info. Always set. Free with RTDbgSymbolFree.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param phMod Where to return the module handle. Optional.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsyncRTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo, PRTDBGMOD phMod);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Query a symbol by name.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_SYMBOL_NOT_FOUND if not found.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param pszSymbol The symbol name. It is possible to limit the scope
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * of the search by prefixing the symbol with a module
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * name pattern followed by a bang (!) character.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * RTStrSimplePatternNMatch is used for the matching.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param pSymbol Where to return the symbol info.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param phMod Where to return the module handle. Optional.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsyncRTDECL(int) RTDbgAsSymbolByName(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * Query a symbol by name, allocating the returned symbol structure.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_SYMBOL_NOT_FOUND if not found.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param pszSymbol The symbol name. See RTDbgAsSymbolByName for more.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param ppSymbol Where to return the pointer to the allocated
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * symbol info. Always set. Free with RTDbgSymbolFree.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @param phMod Where to return the module handle. Optional.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsyncRTDECL(int) RTDbgAsSymbolByNameA(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol, PRTDBGMOD phMod);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Query a line number by address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param Addr The address which closest symbol is requested.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param poffDisp Where to return the distance between the line
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * number and address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pLine Where to return the line number information.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAs(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync/**
044af0d1e6474076366759db86f101778c5f20ccvboxsync * Adds a line number to a module in the address space.
044af0d1e6474076366759db86f101778c5f20ccvboxsync *
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @retval VERR_NOT_FOUND if no module was found at the specified address.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
044af0d1e6474076366759db86f101778c5f20ccvboxsync * custom symbols.
044af0d1e6474076366759db86f101778c5f20ccvboxsync *
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @param hDbgAs The address space handle.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @param pszFile The file name.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @param uLineNo The line number.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @param Addr The address of the symbol.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * @param piOrdinal Where to return the line number ordinal on success.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * If the interpreter doesn't do ordinals, this will be
044af0d1e6474076366759db86f101778c5f20ccvboxsync * set to UINT32_MAX. Optional.
044af0d1e6474076366759db86f101778c5f20ccvboxsync */
044af0d1e6474076366759db86f101778c5f20ccvboxsyncRTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr, uint32_t *piOrdinal);
044af0d1e6474076366759db86f101778c5f20ccvboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Query a line number by address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param hDbgAs The address space handle.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param Addr The address which closest symbol is requested.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param poffDisp Where to return the distance between the line
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * number and address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param ppLine Where to return the pointer to the allocated line
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * number info. Always set. Free with RTDbgLineFree.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/** @todo Missing some bits here. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @} */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interpreter
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * @{
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Creates a module based on the default debug info container.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * This can be used to manually load a module and its symbol. The primary user
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * group is the debug info interpreters, which use this API to create an
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * efficient debug info container behind the scenes and forward all queries to
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * it once the info has been loaded.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns IPRT status code.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param phDbgMod Where to return the module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param pszName The name of the module (mandatory).
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param cbSeg The size of initial segment. If zero, segments will
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * have to be added manually using RTDbgModSegmentAdd.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param fFlags Flags reserved for future extensions, MBZ for now.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncRTDECL(int) RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, RTUINTPTR cbSeg, uint32_t fFlags);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
611e5e148a74d4b54cf76c97e4d36acaa816d8c0vboxsyncRTDECL(int) RTDbgModCreateDeferred(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR cb, uint32_t fFlags);
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsyncRTDECL(int) RTDbgModCreateFromImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t fFlags);
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsyncRTDECL(int) RTDbgModCreateFromMap(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR uSubtrahend, uint32_t fFlags);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Retains another reference to the module.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @remarks Will not take any locks.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(uint32_t) RTDbgModRetain(RTDBGMOD hDbgMod);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Release a reference to the module.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * When the reference count reaches zero, the module is destroyed.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns New reference count, UINT32_MAX on invalid handle (asserted).
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle. The NIL handle is quietly ignored
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * and 0 is returned.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @remarks Will not take any locks.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(uint32_t) RTDbgModRelease(RTDBGMOD hDbgMod);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Gets the module name.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns Pointer to a read only string containing the name.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(const char *) RTDbgModName(RTDBGMOD hDbgMod);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Converts an image relative address to a segment:offset address.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns Segment index on success.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * NIL_RTDBGSEGIDX is returned if the module handle or the RVA are
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * invalid.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param uRva The image relative address to convert.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param poffSeg Where to return the segment offset. Optional.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncRTDECL(RTDBGSEGIDX) RTDbgModRvaToSegOff(RTDBGMOD hDbgMod, RTUINTPTR uRva, PRTUINTPTR poffSeg);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Image size when mapped if segments are mapped adjecently.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * For ELF, PE, and Mach-O images this is (usually) a natural query, for LX and
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * NE and such it's a bit odder and the answer may not make much sense for them.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns Image mapped size.
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * RTUINTPTR_MAX is returned if the handle is invalid.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(RTUINTPTR) RTDbgModImageSize(RTDBGMOD hDbgMod);
044af0d1e6474076366759db86f101778c5f20ccvboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Adds a segment to the module. Optional feature.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * This method is intended used for manually constructing debug info for a
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * module. The main usage is from other debug info interpreters that want to
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * avoid writing a debug info database and instead uses the standard container
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * behind the scenes.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns IPRT status code.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_NOT_SUPPORTED if this feature isn't support by the debug info
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * interpreter. This is a common return code.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_DBG_ADDRESS_WRAP if uRva+cb wraps around.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_DBG_SEGMENT_NAME_OUT_OF_RANGE if pszName is too short or long.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_INVALID_PARAMETER if fFlags contains undefined flags.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_DBG_SPECIAL_SEGMENT if *piSeg is a special segment.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if *piSeg doesn't meet expectations.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param uRva The image relative address of the segment.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param cb The size of the segment.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param pszName The segment name. Does not normally need to be
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * unique, although this is somewhat up to the
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * debug interpreter to decide.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param fFlags Segment flags. Reserved for future used, MBZ.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param piSeg The segment index or NIL_RTDBGSEGIDX on input.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * The assigned segment index on successful return.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Optional.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncRTDECL(int) RTDbgModSegmentAdd(RTDBGMOD hDbgMod, RTUINTPTR uRva, RTUINTPTR cb, const char *pszName,
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync uint32_t fFlags, PRTDBGSEGIDX piSeg);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Gets the number of segments in the module.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * This is can be used to determin the range which can be passed to
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * RTDbgModSegmentByIndex and derivates.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns The segment relative address.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * NIL_RTDBGSEGIDX if the handle is invalid.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
044af0d1e6474076366759db86f101778c5f20ccvboxsyncRTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Query information about a segment.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * This can be used together with RTDbgModSegmentCount to enumerate segments.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * The index starts a 0 and stops one below RTDbgModSegmentCount.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns IPRT status code.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if iSeg is too high.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_DBG_SPECIAL_SEGMENT if iSeg indicates a special segment.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param iSeg The segment index. No special segments.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param pSegInfo Where to return the segment info. The
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * RTDBGSEGMENT::Address member will be set to
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * RTUINTPTR_MAX or the load address used at link time.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
044af0d1e6474076366759db86f101778c5f20ccvboxsyncRTDECL(int) RTDbgModSegmentByIndex(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, PRTDBGSEGMENT pSegInfo);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Gets the size of a segment.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * This is a just a wrapper around RTDbgModSegmentByIndex.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns The segment size.
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * RTUINTPTR_MAX is returned if either the handle and segment index are
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * invalid.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param iSeg The segment index. RTDBGSEGIDX_ABS is not allowed.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * If RTDBGSEGIDX_RVA is used, the functions returns
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * the same value as RTDbgModImageSize.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncRTDECL(RTUINTPTR) RTDbgModSegmentSize(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync/**
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * Gets the image relative address of a segment.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * This is a just a wrapper around RTDbgModSegmentByIndex.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @returns The segment relative address.
a1df400bbe9d64aad400442e56eb637019300a5evboxsync * RTUINTPTR_MAX is returned if either the handle and segment index are
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * invalid.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync *
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param hDbgMod The module handle.
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * @param iSeg The segment index. No special segment indexes
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync * allowed (asserted).
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsyncRTDECL(RTUINTPTR) RTDbgModSegmentRva(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Adds a line number to the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * custom symbols. This is a common place occurance.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE if the symbol name is too long or
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * short.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * it's not inside any of the segments defined by the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * end of the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_ADDRESS_WRAP if off+cb wraps around.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_PARAMETER if the symbol flags sets undefined bits.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pszSymbol The symbol name.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iSeg The segment index.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param off The segment offset.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param cb The size of the symbol. Can be zero, although this
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * may depend somewhat on the debug interpreter.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param fFlags Symbol flags. Reserved for the future, MBZ.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param piOrdinal Where to return the symbol ordinal on success. If
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * the interpreter doesn't do ordinals, this will be set to
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * UINT32_MAX. Optional.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsyncRTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off,
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Gets the symbol count.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * This can be used together wtih RTDbgModSymbolByOrdinal or
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgModSymbolByOrdinalA to enumerate all the symbols.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns The number of symbols in the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * UINT32_MAX is returned if the module handle is invalid or some other
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * error occurs.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsyncRTDECL(uint32_t) RTDbgModSymbolCount(RTDBGMOD hDbgMod);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries symbol information by ordinal number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if there is no symbol at the given number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NOT_SUPPORTED if lookup by ordinal is not supported.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iOrdinal The symbol ordinal number. 0-based. The highest
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * number is RTDbgModSymbolCount() - 1.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pSymInfo Where to store the symbol information.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(int) RTDbgModSymbolByOrdinal(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGSYMBOL pSymInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries symbol information by ordinal number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NOT_SUPPORTED if lookup by ordinal is not supported.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if there is no symbol at the given number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iOrdinal The symbol ordinal number. 0-based. The highest
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * number is RTDbgModSymbolCount() - 1.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param ppSymInfo Where to store the pointer to the returned
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * symbol information. Always set. Free with
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgSymbolFree.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(int) RTDbgModSymbolByOrdinalA(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGSYMBOL *ppSymInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries symbol information by address.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * The returned symbol is what the debug info interpreter consideres the symbol
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * most applicable to the specified address. This usually means a symbol with an
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * address equal or lower than the requested.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * it's not inside any of the segments defined by the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * end of the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iSeg The segment number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param off The offset into the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param poffDisp Where to store the distance between the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * specified address and the returned symbol.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Optional.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pSymInfo Where to store the symbol information.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries symbol information by address.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * The returned symbol is what the debug info interpreter consideres the symbol
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * most applicable to the specified address. This usually means a symbol with an
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * address equal or lower than the requested.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * it's not inside any of the segments defined by the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * end of the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iSeg The segment index.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param off The offset into the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param poffDisp Where to store the distance between the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * specified address and the returned symbol. Optional.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param ppSymInfo Where to store the pointer to the returned
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * symbol information. Always set. Free with
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgSymbolFree.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(int) RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries symbol information by symbol name.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE if the symbol name is too long or
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * short.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pszSymbol The symbol name.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pSymInfo Where to store the symbol information.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(int) RTDbgModSymbolByName(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL pSymInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries symbol information by symbol name.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE if the symbol name is too long or
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * short.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pszSymbol The symbol name.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param ppSymInfo Where to store the pointer to the returned
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * symbol information. Always set. Free with
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgSymbolFree.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(int) RTDbgModSymbolByNameA(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL *ppSymInfo);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Adds a line number to the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * custom symbols. This should be consider a normal response.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_FILE_NAME_OUT_OF_RANGE if the file name is too longer or
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * empty.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * it's not inside any of the segments defined by the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * end of the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_PARAMETER if the line number flags sets undefined bits.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pszFile The file name.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param uLineNo The line number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iSeg The segment index.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param off The segment offset.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param piOrdinal Where to return the line number ordinal on
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * success. If the interpreter doesn't do ordinals,
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * this will be set to UINT32_MAX. Optional.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsyncRTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo,
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t *piOrdinal);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Gets the line number count.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * This can be used together wtih RTDbgModLineByOrdinal or RTDbgModSymbolByLineA
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * to enumerate all the line number information.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns The number of line numbers in the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * UINT32_MAX is returned if the module handle is invalid or some other
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * error occurs.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
a1df400bbe9d64aad400442e56eb637019300a5evboxsyncRTDECL(uint32_t) RTDbgModLineCount(RTDBGMOD hDbgMod);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries line number information by ordinal number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * This can be used to enumerate the line numbers for the module. Use
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgModLineCount() to figure the end of the ordinals.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_LINE_NOT_FOUND if there is no line number with that
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * ordinal.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iOrdinal The line number ordinal number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pLineInfo Where to store the information about the line
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsyncRTDECL(int) RTDbgModLineByOrdinal(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGLINE pLineInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries line number information by ordinal number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * This can be used to enumerate the line numbers for the module. Use
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgModLineCount() to figure the end of the ordinals.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_LINE_NOT_FOUND if there is no line number with that
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * ordinal.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NO_MEMORY if RTDbgLineAlloc fails.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iOrdinal The line number ordinal number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param ppLineInfo Where to store the pointer to the returned line
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * number information. Always set. Free with
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgLineFree.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsyncRTDECL(int) RTDbgModLineByOrdinalA(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGLINE *ppLineInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries line number information by address.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * The returned line number is what the debug info interpreter consideres the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * one most applicable to the specified address. This usually means a line
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * number with an address equal or lower than the requested.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_LINE_NOT_FOUND if no suitable line number was found.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * it's not inside any of the segments defined by the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * end of the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iSeg The segment number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param off The offset into the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param poffDisp Where to store the distance between the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * specified address and the returned symbol.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Optional.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param pSymInfo Where to store the symbol information.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsyncRTDECL(int) RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLineInfo);
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync/**
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Queries line number information by address.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * The returned line number is what the debug info interpreter consideres the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * one most applicable to the specified address. This usually means a line
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * number with an address equal or lower than the requested.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @returns IPRT status code.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_LINE_NOT_FOUND if no suitable line number was found.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * it's not inside any of the segments defined by the module.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * end of the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @retval VERR_NO_MEMORY if RTDbgLineAlloc fails.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync *
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param hDbgMod The module handle.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param iSeg The segment number.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param off The offset into the segment.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param poffDisp Where to store the distance between the
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * specified address and the returned symbol.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * Optional.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * @param ppLineInfo Where to store the pointer to the returned line
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * number information. Always set. Free with
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync * RTDbgLineFree.
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsync */
df8e6a449f00e1884fbf4a1fc67143614d7d528dvboxsyncRTDECL(int) RTDbgModLineByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE *ppLineInfo);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @} */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @} */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsyncRT_C_DECLS_END
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#endif
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync