VirtualBox

Changeset 45984 in vbox for trunk/include


Ignore:
Timestamp:
May 11, 2013 12:46:30 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85642
Message:

RTDbgCfg: Debugging configuration, like symbol search paths and such.

Location:
trunk/include/iprt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/dbg.h

    r44528 r45984  
    6060/** The last valid special segment index. */
    6161#define RTDBGSEGIDX_SPECIAL_FIRST   (RTDBGSEGIDX_LAST + 1U)
     62
    6263
    6364
     
    213214
    214215
     216/** @defgroup grp_rt_dbgcfg     RTDbgCfg - Debugging Configuration
     217 *
     218 * The settings used when loading and processing debug info is kept in a
     219 * RTDBGCFG instance since it's generally shared for a whole debugging session
     220 * and anyhow would be a major pain to pass as individual parameters to each
     221 * call.  The debugging config API not only keeps the settings information but
     222 * also provide APIs for making use of it, and in some cases, like for instance
     223 * symbol severs, retriving and maintaining it.
     224 *
     225 * @todo Work in progress - APIs are still missing, adding when needed.
     226 *
     227 * @{
     228 */
     229
     230/** Debugging configuration handle.  */
     231typedef struct RTDBGCFGINT *RTDBGCFG;
     232/** Pointer to a debugging configuration handle. */
     233typedef RTDBGCFG           *PRTDBGCFG;
     234/** NIL debug configuration handle. */
     235#define NIL_RTDBGCFG        ((RTDBGCFG)0)
     236
     237/** @name RTDBGCFG_FLAGS_XXX - Debugging configuration flags.
     238 * @{ */
     239/** Use deferred loading. */
     240#define RTDBGCFG_FLAGS_DEFERRED                     RT_BIT_64(0)
     241/** Don't use the symbol server (http). */
     242#define RTDBGCFG_FLAGS_NO_SYM_SRV                   RT_BIT_64(1)
     243/** Don't use system search paths.
     244 * On windows this means not using _NT_ALT_SYMBOL_PATH, _NT_SYMBOL_PATH,
     245 * _NT_SOURCE_PATH, and _NT_EXECUTABLE_PATH.
     246 * On other systems the effect has yet to be determined. */
     247#define RTDBGCFG_FLAGS_NO_SYSTEM_PATHS              RT_BIT_64(2)
     248/** Don't search the debug and image paths recursively. */
     249#define RTDBGCFG_FLAGS_NO_RECURSIV_SEARCH           RT_BIT_64(3)
     250/** Don't search the source paths recursively. */
     251#define RTDBGCFG_FLAGS_NO_RECURSIV_SRC_SEARCH       RT_BIT_64(4)
     252/** @} */
     253
     254/**
     255 * Debugging configuration properties.
     256 *
     257 * The search paths are using the DOS convention of semicolon as separator
     258 * character.  The the special 'srv' + asterisk syntax known from the windows
     259 * debugger search paths are also supported to some extent, as is 'cache' +
     260 * asterisk.
     261 */
     262typedef enum RTDBGCFGPROP
     263{
     264    /** The customary invalid 0 value. */
     265    RTDBGCFGPROP_INVALID = 0,
     266    /** RTDBGCFG_FLAGS_XXX.
     267     * Env: _FLAGS
     268     * The environment variable can be specified as a unsigned value or one or more
     269     * mnemonics separated by spaces. */
     270    RTDBGCFGPROP_FLAGS,
     271    /** List of paths to search for symbol files and images.
     272     * Env: _PATH  */
     273    RTDBGCFGPROP_PATH,
     274    /** List of symbol file suffixes (semicolon separated).
     275     * Env: _SUFFIXES  */
     276    RTDBGCFGPROP_SUFFIXES,
     277    /** List of paths to search for source files.
     278     * Env: _SRC_PATH   */
     279    RTDBGCFGPROP_SRC_PATH,
     280    /** End of valid values. */
     281    RTDBGCFGPROP_END,
     282    /** The customary 32-bit type hack. */
     283    RTDBGCFGPROP_32BIT_HACK = 0x7fffffff
     284} RTDBGCFGPROP;
     285
     286/**
     287 * Configuration property change operation.
     288 */
     289typedef enum RTDBGCFGOP
     290{
     291    /** Customary invalid 0 value. */
     292    RTDBGCFGOP_INVALID = 0,
     293    /** Replace the current value with the given one. */
     294    RTDBGCFGOP_SET,
     295    /** Append the given value to the existing one.  For integer values this is
     296     *  considered a bitwise OR operation.  */
     297    RTDBGCFGOP_APPEND,
     298    /** Prepend the given value to the existing one.  For integer values this is
     299     *  considered a bitwise OR operation.  */
     300    RTDBGCFGOP_PREPEND,
     301    /** Removes the value from the existing one.  For interger values the value is
     302     * complemented and ANDed with the existing one, clearing all the specified
     303     * flags/bits. */
     304    RTDBGCFGOP_REMOVE,
     305    /** End of valid values. */
     306    RTDBGCFGOP_END,
     307    /** Customary 32-bit type hack. */
     308    RTDBGCFGOP_32BIT_HACK = 0x7fffffff
     309} RTDBGCFGOP;
     310
     311
     312
     313/**
     314 * Initializes a debugging configuration.
     315 *
     316 * @returns IPRT status code.
     317 * @param   phDbgCfg            Where to return the configuration handle.
     318 * @param   pszEnvVarPrefix     The environment variable prefix.  If NULL, the
     319 *                              environment is not consulted.
     320 *
     321 * @sa  RTDbgCfgChangeString, RTDbgCfgChangeUInt.
     322 */
     323RTDECL(int) RTDbgCfgCreate(PRTDBGCFG phDbgCfg, const char *pszEnvVarPrefix);
     324
     325/**
     326 * Retains a new reference to a debugging config.
     327 *
     328 * @returns New reference count.
     329 *          UINT32_MAX is returned if the handle is invalid (asserted).
     330 * @param   hDbgCfg             The config handle.
     331 */
     332RTDECL(uint32_t) RTDbgCfgRetain(RTDBGCFG hDbgCfg);
     333
     334/**
     335 * Releases a references to a debugging config.
     336 *
     337 * @returns New reference count, if 0 the config was freed.  UINT32_MAX is
     338 *          returned if the handle is invalid (asserted).
     339 * @param   hDbgCfg             The config handle.
     340 */
     341RTDECL(uint32_t) RTDbgCfgRelease(RTDBGCFG hDbgCfg);
     342
     343/**
     344 * Changes a property value by string.
     345 *
     346 * For string values the string is used more or less as given.  For integer
     347 * values and flags, it can contains both values (ORed together) or property
     348 * specific mnemonics (ORed / ~ANDed).
     349 *
     350 * @returns IPRT status code.
     351 * @retval  VERR_DBG_CFG_INVALID_VALUE
     352 * @param   hDbgCfg             The debugging configuration handle.
     353 * @param   enmProp             The property to change.
     354 * @param   enmOp               How to change the property.
     355 * @param   pszValue            The property value to apply.
     356 */
     357RTDECL(int) RTDbgCfgChangeString(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, RTDBGCFGOP enmOp, const char *pszValue);
     358
     359/**
     360 * Changes a property value by unsigned integer (64-bit).
     361 *
     362 * This can only be applied to integer and flag properties.
     363 *
     364 * @returns IPRT status code.
     365 * @retval  VERR_DBG_CFG_NOT_UINT_PROP
     366 * @param   hDbgCfg             The debugging configuration handle.
     367 * @param   enmProp             The property to change.
     368 * @param   enmOp               How to change the property.
     369 * @param   uValue              The property value to apply.
     370 */
     371RTDECL(int) RTDbgCfgChangeUInt(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, RTDBGCFGOP enmOp, uint64_t uValue);
     372
     373/**
     374 * Query a property value as string.
     375 *
     376 * Integer and flags properties are returned as a list of mnemonics if possible,
     377 * otherwise as simple hex values.
     378 *
     379 * @returns IPRT status code.
     380 * @retval  VERR_BUFFER_OVERFLOW if there isn't sufficient buffer space. Nothing
     381 *          is written.
     382 * @param   hDbgCfg             The debugging configuration handle.
     383 * @param   enmProp             The property to change.
     384 * @param   pszValue            The output buffer.
     385 * @param   cbValue             The size of the output buffer.
     386 */
     387RTDECL(int) RTDbgCfgQueryString(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, char *pszValue, size_t cbValue);
     388
     389/**
     390 * Query a property value as unsigned integer (64-bit).
     391 *
     392 * Only integer and flags properties can be queried this way.
     393 *
     394 * @returns IPRT status code.
     395 * @retval  VERR_DBG_CFG_NOT_UINT_PROP
     396 * @param   hDbgCfg             The debugging configuration handle.
     397 * @param   enmProp             The property to change.
     398 * @param   puValue             Where to return the value.
     399 */
     400RTDECL(int) RTDbgCfgQueryUInt(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, uint64_t *puValue);
     401
     402/** @} */
     403
     404
    215405/** @defgroup grp_rt_dbgas      RTDbgAs - Debug Address Space
    216406 * @{
     
    673863RTDECL(int)         RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, RTUINTPTR cbSeg, uint32_t fFlags);
    674864
    675 RTDECL(int)         RTDbgModCreateDeferred(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR cb, uint32_t fFlags);
    676 RTDECL(int)         RTDbgModCreateFromImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t fFlags);
    677 RTDECL(int)         RTDbgModCreateFromMap(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR uSubtrahend, uint32_t fFlags);
     865RTDECL(int)         RTDbgModCreateFromImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName,
     866                                            RTDBGCFG hDbgCfg);
     867RTDECL(int)         RTDbgModCreateFromMap(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR uSubtrahend,
     868                                          RTDBGCFG hDbgCfg);
     869RTDECL(int)         RTDbgModCreateFromExe(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
     870                                          uint32_t uTimeDateStamp, RTDBGCFG pDbgCfg);
     871RTDECL(int)         RTDbgModCreateFromDbg(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
     872                                          uint32_t uTimeDateStamp, RTDBGCFG pDbgCfg);
     873RTDECL(int)         RTDbgModCreateFromPdb(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
     874                                          PCRTUUID pUuid, uint32_t Age, RTDBGCFG pDbgCfg);
     875RTDECL(int)         RTDbgModCreateFromDwo(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
     876                                          uint32_t uCrc32, RTDBGCFG pDbgCfg);
    678877
    679878
  • trunk/include/iprt/err.h

    r45968 r45984  
    14901490/** Internal processing error in the DWARF code. */
    14911491#define VERR_DWARF_IPE                          (-683)
     1492/** Invalid configuration property value. */
     1493#define VERR_DBG_CFG_INVALID_VALUE              (-684)
     1494/** Not an integer property. */
     1495#define VERR_DBG_CFG_NOT_UINT_PROP              (-685)
    14921496/** @} */
    14931497
  • trunk/include/iprt/mangling.h

    r45948 r45984  
    373373# define RTDbgLineFree                                  RT_MANGLER(RTDbgLineFree)
    374374# define RTDbgModCreate                                 RT_MANGLER(RTDbgModCreate)
    375 # define RTDbgModCreateDeferred                         RT_MANGLER(RTDbgModCreateDeferred)
    376375# define RTDbgModCreateFromImage                        RT_MANGLER(RTDbgModCreateFromImage)
    377376# define RTDbgModCreateFromMap                          RT_MANGLER(RTDbgModCreateFromMap)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette