VirtualBox

source: vbox/trunk/include/iprt/dbg.h@ 55420

Last change on this file since 55420 was 50003, checked in by vboxsync, 11 years ago

iprt/dbg.h: Increased the fixed symbol length.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 63.9 KB
Line 
1/* $Id: dbg.h 50003 2013-12-25 17:59:47Z vboxsync $ */
2/** @file
3 * IPRT - Debugging Routines.
4 */
5
6/*
7 * Copyright (C) 2008-2013 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef ___iprt_dbg_h
28#define ___iprt_dbg_h
29
30#include <iprt/types.h>
31#include <iprt/stdarg.h>
32#include <iprt/ldr.h>
33
34RT_C_DECLS_BEGIN
35
36# ifdef IN_RING3
37
38/** @defgroup grp_rt_dbg RTDbg - Debugging Routines
39 * @ingroup grp_rt
40 * @{
41 */
42
43
44/** Debug segment index. */
45typedef uint32_t RTDBGSEGIDX;
46/** Pointer to a debug segment index. */
47typedef RTDBGSEGIDX *PRTDBGSEGIDX;
48/** Pointer to a const debug segment index. */
49typedef RTDBGSEGIDX const *PCRTDBGSEGIDX;
50/** NIL debug segment index. */
51#define NIL_RTDBGSEGIDX UINT32_C(0xffffffff)
52/** The last normal segment index. */
53#define RTDBGSEGIDX_LAST UINT32_C(0xffffffef)
54/** Special segment index that indicates that the offset is a relative
55 * virtual address (RVA). I.e. an offset from the start of the module. */
56#define RTDBGSEGIDX_RVA UINT32_C(0xfffffff0)
57/** Special segment index that indicates that the offset is a absolute. */
58#define RTDBGSEGIDX_ABS UINT32_C(0xfffffff1)
59/** The last valid special segment index. */
60#define RTDBGSEGIDX_SPECIAL_LAST RTDBGSEGIDX_ABS
61/** The last valid special segment index. */
62#define RTDBGSEGIDX_SPECIAL_FIRST (RTDBGSEGIDX_LAST + 1U)
63
64
65
66/** @name RTDBGSYMADDR_FLAGS_XXX
67 * Flags used when looking up a symbol by address.
68 * @{ */
69/** Less or equal address. (default) */
70#define RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL UINT32_C(0)
71/** Greater or equal address. */
72#define RTDBGSYMADDR_FLAGS_GREATER_OR_EQUAL UINT32_C(1)
73/** Mask of valid flags. */
74#define RTDBGSYMADDR_FLAGS_VALID_MASK UINT32_C(1)
75/** @} */
76
77
78/** Max length (including '\\0') of a segment name. */
79#define RTDBG_SEGMENT_NAME_LENGTH (128 - 8 - 8 - 8 - 4 - 4)
80
81/**
82 * Debug module segment.
83 */
84typedef struct RTDBGSEGMENT
85{
86 /** The load address.
87 * RTUINTPTR_MAX if not applicable. */
88 RTUINTPTR Address;
89 /** The image relative virtual address of the segment.
90 * RTUINTPTR_MAX if not applicable. */
91 RTUINTPTR uRva;
92 /** The segment size. */
93 RTUINTPTR cb;
94 /** The segment flags. (reserved) */
95 uint32_t fFlags;
96 /** The segment index. */
97 RTDBGSEGIDX iSeg;
98 /** Symbol name. */
99 char szName[RTDBG_SEGMENT_NAME_LENGTH];
100} RTDBGSEGMENT;
101/** Pointer to a debug module segment. */
102typedef RTDBGSEGMENT *PRTDBGSEGMENT;
103/** Pointer to a const debug module segment. */
104typedef RTDBGSEGMENT const *PCRTDBGSEGMENT;
105
106
107
108/** Max length (including '\\0') of a symbol name. */
109#define RTDBG_SYMBOL_NAME_LENGTH (512 - 8 - 8 - 8 - 4 - 4 - 8)
110
111/**
112 * Debug symbol.
113 */
114typedef struct RTDBGSYMBOL
115{
116 /** Symbol value (address).
117 * This depends a bit who you ask. It will be the same as offSeg when you
118 * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
119 RTUINTPTR Value;
120 /** Symbol size. */
121 RTUINTPTR cb;
122 /** Offset into the segment specified by iSeg. */
123 RTUINTPTR offSeg;
124 /** Segment number. */
125 RTDBGSEGIDX iSeg;
126 /** Symbol Flags. (reserved). */
127 uint32_t fFlags;
128 /** Symbol ordinal.
129 * This is set to UINT32_MAX if the ordinals aren't supported. */
130 uint32_t iOrdinal;
131 /** Symbol name. */
132 char szName[RTDBG_SYMBOL_NAME_LENGTH];
133} RTDBGSYMBOL;
134/** Pointer to debug symbol. */
135typedef RTDBGSYMBOL *PRTDBGSYMBOL;
136/** Pointer to const debug symbol. */
137typedef const RTDBGSYMBOL *PCRTDBGSYMBOL;
138
139/**
140 * Allocate a new symbol structure.
141 *
142 * @returns Pointer to a new structure on success, NULL on failure.
143 */
144RTDECL(PRTDBGSYMBOL) RTDbgSymbolAlloc(void);
145
146/**
147 * Duplicates a symbol structure.
148 *
149 * @returns Pointer to duplicate on success, NULL on failure.
150 *
151 * @param pSymInfo The symbol info to duplicate.
152 */
153RTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymInfo);
154
155/**
156 * Free a symbol structure previously allocated by a RTDbg method.
157 *
158 * @param pSymInfo The symbol info to free. NULL is ignored.
159 */
160RTDECL(void) RTDbgSymbolFree(PRTDBGSYMBOL pSymInfo);
161
162
163/** Max length (including '\\0') of a debug info file name. */
164#define RTDBG_FILE_NAME_LENGTH (260)
165
166
167/**
168 * Debug line number information.
169 */
170typedef struct RTDBGLINE
171{
172 /** Address.
173 * This depends a bit who you ask. It will be the same as offSeg when you
174 * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
175 RTUINTPTR Address;
176 /** Offset into the segment specified by iSeg. */
177 RTUINTPTR offSeg;
178 /** Segment number. */
179 RTDBGSEGIDX iSeg;
180 /** Line number. */
181 uint32_t uLineNo;
182 /** Symbol ordinal.
183 * This is set to UINT32_MAX if the ordinals aren't supported. */
184 uint32_t iOrdinal;
185 /** Filename. */
186 char szFilename[RTDBG_FILE_NAME_LENGTH];
187} RTDBGLINE;
188/** Pointer to debug line number. */
189typedef RTDBGLINE *PRTDBGLINE;
190/** Pointer to const debug line number. */
191typedef const RTDBGLINE *PCRTDBGLINE;
192
193/**
194 * Allocate a new line number structure.
195 *
196 * @returns Pointer to a new structure on success, NULL on failure.
197 */
198RTDECL(PRTDBGLINE) RTDbgLineAlloc(void);
199
200/**
201 * Duplicates a line number structure.
202 *
203 * @returns Pointer to duplicate on success, NULL on failure.
204 *
205 * @param pLine The line number to duplicate.
206 */
207RTDECL(PRTDBGLINE) RTDbgLineDup(PCRTDBGLINE pLine);
208
209/**
210 * Free a line number structure previously allocated by a RTDbg method.
211 *
212 * @param pLine The line number to free. NULL is ignored.
213 */
214RTDECL(void) RTDbgLineFree(PRTDBGLINE pLine);
215
216
217/** @defgroup grp_rt_dbgcfg RTDbgCfg - Debugging Configuration
218 *
219 * The settings used when loading and processing debug info is kept in a
220 * RTDBGCFG instance since it's generally shared for a whole debugging session
221 * and anyhow would be a major pain to pass as individual parameters to each
222 * call. The debugging config API not only keeps the settings information but
223 * also provide APIs for making use of it, and in some cases, like for instance
224 * symbol severs, retriving and maintaining it.
225 *
226 * @todo Work in progress - APIs are still missing, adding when needed.
227 *
228 * @{
229 */
230
231/** Debugging configuration handle. */
232typedef struct RTDBGCFGINT *RTDBGCFG;
233/** Pointer to a debugging configuration handle. */
234typedef RTDBGCFG *PRTDBGCFG;
235/** NIL debug configuration handle. */
236#define NIL_RTDBGCFG ((RTDBGCFG)0)
237
238/** @name RTDBGCFG_FLAGS_XXX - Debugging configuration flags.
239 * @{ */
240/** Use deferred loading. */
241#define RTDBGCFG_FLAGS_DEFERRED RT_BIT_64(0)
242/** Don't use the symbol server (http). */
243#define RTDBGCFG_FLAGS_NO_SYM_SRV RT_BIT_64(1)
244/** Don't use system search paths.
245 * On windows this means not using _NT_ALT_SYMBOL_PATH, _NT_SYMBOL_PATH,
246 * _NT_SOURCE_PATH, and _NT_EXECUTABLE_PATH.
247 * On other systems the effect has yet to be determined. */
248#define RTDBGCFG_FLAGS_NO_SYSTEM_PATHS RT_BIT_64(2)
249/** Don't search the debug and image paths recursively. */
250#define RTDBGCFG_FLAGS_NO_RECURSIV_SEARCH RT_BIT_64(3)
251/** Don't search the source paths recursively. */
252#define RTDBGCFG_FLAGS_NO_RECURSIV_SRC_SEARCH RT_BIT_64(4)
253/** @} */
254
255/**
256 * Debugging configuration properties.
257 *
258 * The search paths are using the DOS convention of semicolon as separator
259 * character. The the special 'srv' + asterisk syntax known from the windows
260 * debugger search paths are also supported to some extent, as is 'cache' +
261 * asterisk.
262 */
263typedef enum RTDBGCFGPROP
264{
265 /** The customary invalid 0 value. */
266 RTDBGCFGPROP_INVALID = 0,
267 /** RTDBGCFG_FLAGS_XXX.
268 * Env: _FLAGS
269 * The environment variable can be specified as a unsigned value or one or more
270 * mnemonics separated by spaces. */
271 RTDBGCFGPROP_FLAGS,
272 /** List of paths to search for symbol files and images.
273 * Env: _PATH */
274 RTDBGCFGPROP_PATH,
275 /** List of symbol file suffixes (semicolon separated).
276 * Env: _SUFFIXES */
277 RTDBGCFGPROP_SUFFIXES,
278 /** List of paths to search for source files.
279 * Env: _SRC_PATH */
280 RTDBGCFGPROP_SRC_PATH,
281 /** End of valid values. */
282 RTDBGCFGPROP_END,
283 /** The customary 32-bit type hack. */
284 RTDBGCFGPROP_32BIT_HACK = 0x7fffffff
285} RTDBGCFGPROP;
286
287/**
288 * Configuration property change operation.
289 */
290typedef enum RTDBGCFGOP
291{
292 /** Customary invalid 0 value. */
293 RTDBGCFGOP_INVALID = 0,
294 /** Replace the current value with the given one. */
295 RTDBGCFGOP_SET,
296 /** Append the given value to the existing one. For integer values this is
297 * considered a bitwise OR operation. */
298 RTDBGCFGOP_APPEND,
299 /** Prepend the given value to the existing one. For integer values this is
300 * considered a bitwise OR operation. */
301 RTDBGCFGOP_PREPEND,
302 /** Removes the value from the existing one. For interger values the value is
303 * complemented and ANDed with the existing one, clearing all the specified
304 * flags/bits. */
305 RTDBGCFGOP_REMOVE,
306 /** End of valid values. */
307 RTDBGCFGOP_END,
308 /** Customary 32-bit type hack. */
309 RTDBGCFGOP_32BIT_HACK = 0x7fffffff
310} RTDBGCFGOP;
311
312
313
314/**
315 * Initializes a debugging configuration.
316 *
317 * @returns IPRT status code.
318 * @param phDbgCfg Where to return the configuration handle.
319 * @param pszEnvVarPrefix The environment variable prefix. If NULL, the
320 * environment is not consulted.
321 * @param fNativePaths Whether to pick up native paths from the
322 * environment.
323 *
324 * @sa RTDbgCfgChangeString, RTDbgCfgChangeUInt.
325 */
326RTDECL(int) RTDbgCfgCreate(PRTDBGCFG phDbgCfg, const char *pszEnvVarPrefix, bool fNativePaths);
327
328/**
329 * Retains a new reference to a debugging config.
330 *
331 * @returns New reference count.
332 * UINT32_MAX is returned if the handle is invalid (asserted).
333 * @param hDbgCfg The config handle.
334 */
335RTDECL(uint32_t) RTDbgCfgRetain(RTDBGCFG hDbgCfg);
336
337/**
338 * Releases a references to a debugging config.
339 *
340 * @returns New reference count, if 0 the config was freed. UINT32_MAX is
341 * returned if the handle is invalid (asserted).
342 * @param hDbgCfg The config handle.
343 */
344RTDECL(uint32_t) RTDbgCfgRelease(RTDBGCFG hDbgCfg);
345
346/**
347 * Changes a property value by string.
348 *
349 * For string values the string is used more or less as given. For integer
350 * values and flags, it can contains both values (ORed together) or property
351 * specific mnemonics (ORed / ~ANDed).
352 *
353 * @returns IPRT status code.
354 * @retval VERR_DBG_CFG_INVALID_VALUE
355 * @param hDbgCfg The debugging configuration handle.
356 * @param enmProp The property to change.
357 * @param enmOp How to change the property.
358 * @param pszValue The property value to apply.
359 */
360RTDECL(int) RTDbgCfgChangeString(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, RTDBGCFGOP enmOp, const char *pszValue);
361
362/**
363 * Changes a property value by unsigned integer (64-bit).
364 *
365 * This can only be applied to integer and flag properties.
366 *
367 * @returns IPRT status code.
368 * @retval VERR_DBG_CFG_NOT_UINT_PROP
369 * @param hDbgCfg The debugging configuration handle.
370 * @param enmProp The property to change.
371 * @param enmOp How to change the property.
372 * @param uValue The property value to apply.
373 */
374RTDECL(int) RTDbgCfgChangeUInt(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, RTDBGCFGOP enmOp, uint64_t uValue);
375
376/**
377 * Query a property value as string.
378 *
379 * Integer and flags properties are returned as a list of mnemonics if possible,
380 * otherwise as simple hex values.
381 *
382 * @returns IPRT status code.
383 * @retval VERR_BUFFER_OVERFLOW if there isn't sufficient buffer space. Nothing
384 * is written.
385 * @param hDbgCfg The debugging configuration handle.
386 * @param enmProp The property to change.
387 * @param pszValue The output buffer.
388 * @param cbValue The size of the output buffer.
389 */
390RTDECL(int) RTDbgCfgQueryString(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, char *pszValue, size_t cbValue);
391
392/**
393 * Query a property value as unsigned integer (64-bit).
394 *
395 * Only integer and flags properties can be queried this way.
396 *
397 * @returns IPRT status code.
398 * @retval VERR_DBG_CFG_NOT_UINT_PROP
399 * @param hDbgCfg The debugging configuration handle.
400 * @param enmProp The property to change.
401 * @param puValue Where to return the value.
402 */
403RTDECL(int) RTDbgCfgQueryUInt(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, uint64_t *puValue);
404
405/**
406 * Log callback.
407 *
408 * @param hDbgCfg The debug config instance.
409 * @param iLevel The message level.
410 * @param pszMsg The message.
411 * @param pvUser User argument.
412 */
413typedef DECLCALLBACK(void) FNRTDBGCFGLOG(RTDBGCFG hDbgCfg, uint32_t iLevel, const char *pszMsg, void *pvUser);
414/** Pointer to a log callback. */
415typedef FNRTDBGCFGLOG *PFNRTDBGCFGLOG;
416
417/**
418 * Sets the log callback for the configuration.
419 *
420 * This will fail if there is already a log callback present, unless pfnCallback
421 * is NULL.
422 *
423 * @returns IPRT status code.
424 * @param hDbgCfg The debugging configuration handle.
425 * @param pfnCallback The callback function. NULL to unset.
426 * @param pvUser The user argument.
427 */
428RTDECL(int) RTDbgCfgSetLogCallback(RTDBGCFG hDbgCfg, PFNRTDBGCFGLOG pfnCallback, void *pvUser);
429
430/**
431 * Callback used by the RTDbgCfgOpen function to try out a file that was found.
432 *
433 * @returns On statuses other than VINF_CALLBACK_RETURN and
434 * VERR_CALLBACK_RETURN the search will continue till the end of the
435 * list. These status codes will not necessarily be propagated to the
436 * caller in any consistent manner.
437 * @retval VINF_CALLBACK_RETURN if successuflly opened the file and it's time
438 * to return
439 * @retval VERR_CALLBACK_RETURN if we shouldn't stop searching.
440 *
441 * @param hDbgCfg The debugging configuration handle.
442 * @param pszFilename The path to the file that should be tried out.
443 * @param pvUser1 First user parameter.
444 * @param pvUser2 Second user parameter.
445 */
446typedef DECLCALLBACK(int) FNDBGCFGOPEN(RTDBGCFG hDbgCfg, const char *pszFilename, void *pvUser1, void *pvUser2);
447/** Pointer to a open-file callback used to the RTDbgCfgOpen functions. */
448typedef FNDBGCFGOPEN *PFNDBGCFGOPEN;
449
450
451RTDECL(int) RTDbgCfgOpenPeImage(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t cbImage, uint32_t uTimestamp,
452 PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
453RTDECL(int) RTDbgCfgOpenPdb70(RTDBGCFG hDbgCfg, const char *pszFilename, PCRTUUID pUuid, uint32_t uAge,
454 PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
455RTDECL(int) RTDbgCfgOpenPdb20(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t cbImage, uint32_t uTimestamp, uint32_t uAge,
456 PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
457RTDECL(int) RTDbgCfgOpenDbg(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t cbImage, uint32_t uTimestamp,
458 PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
459RTDECL(int) RTDbgCfgOpenDwo(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t uCrc32,
460 PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
461RTDECL(int) RTDbgCfgOpenDsymBundle(RTDBGCFG hDbgCfg, const char *pszFilename, PCRTUUID pUuid,
462 PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
463RTDECL(int) RTDbgCfgOpenMachOImage(RTDBGCFG hDbgCfg, const char *pszFilename, PCRTUUID pUuid,
464 PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
465
466
467/** @name Static symbol cache configuration
468 * @{ */
469/** The cache subdirectory containing the UUID mappings for .dSYM bundles.
470 * The UUID mappings implemented by IPRT are splitting the image/dsym UUID up
471 * into five 4 digit parts that maps to directories and one twelve digit part
472 * that maps to a symbolic link. The symlink points to the file in the
473 * Contents/Resources/DWARF/ directory of the .dSYM bundle for a .dSYM map, and
474 * to the image file (Contents/MacOS/bundlename for bundles) for image map.
475 *
476 * According to available documentation, both lldb and gdb are able to use these
477 * UUID maps to find debug info while debugging. See:
478 * http://lldb.llvm.org/symbols.html
479 */
480#define RTDBG_CACHE_UUID_MAP_DIR_DSYMS "dsym-uuids"
481/** The cache subdirectory containing the UUID mappings for image files. */
482#define RTDBG_CACHE_UUID_MAP_DIR_IMAGES "image-uuids"
483/** Suffix used for the cached .dSYM debug files.
484 * In .dSYM bundles only the .dSYM/Contents/Resources/DWARF/debug-file is
485 * copied into the cache, and in order to not clash with the stripped/rich image
486 * file, the cache tool slaps this suffix onto the name. */
487#define RTDBG_CACHE_DSYM_FILE_SUFFIX ".dwarf"
488/** @} */
489
490
491/** @} */
492
493
494/** @defgroup grp_rt_dbgas RTDbgAs - Debug Address Space
495 * @{
496 */
497
498/**
499 * Creates an empty address space.
500 *
501 * @returns IPRT status code.
502 *
503 * @param phDbgAs Where to store the address space handle on success.
504 * @param FirstAddr The first address in the address space.
505 * @param LastAddr The last address in the address space.
506 * @param pszName The name of the address space.
507 */
508RTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszName);
509
510/**
511 * Variant of RTDbgAsCreate that takes a name format string.
512 *
513 * @returns IPRT status code.
514 *
515 * @param phDbgAs Where to store the address space handle on success.
516 * @param FirstAddr The first address in the address space.
517 * @param LastAddr The last address in the address space.
518 * @param pszNameFmt The name format of the address space.
519 * @param va Format arguments.
520 */
521RTDECL(int) RTDbgAsCreateV(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, va_list va);
522
523/**
524 * Variant of RTDbgAsCreate that takes a name format string.
525 *
526 * @returns IPRT status code.
527 *
528 * @param phDbgAs Where to store the address space handle on success.
529 * @param FirstAddr The first address in the address space.
530 * @param LastAddr The last address in the address space.
531 * @param pszNameFmt The name format of the address space.
532 * @param ... Format arguments.
533 */
534RTDECL(int) RTDbgAsCreateF(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, ...);
535
536/**
537 * Retains a reference to the address space.
538 *
539 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
540 *
541 * @param hDbgAs The address space handle.
542 *
543 * @remarks Will not take any locks.
544 */
545RTDECL(uint32_t) RTDbgAsRetain(RTDBGAS hDbgAs);
546
547/**
548 * Release a reference to the address space.
549 *
550 * When the reference count reaches zero, the address space is destroyed.
551 * That means unlinking all the modules it currently contains, potentially
552 * causing some or all of them to be destroyed as they are managed by
553 * reference counting.
554 *
555 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
556 *
557 * @param hDbgAs The address space handle. The NIL handle is quietly
558 * ignored and 0 is returned.
559 *
560 * @remarks Will not take any locks.
561 */
562RTDECL(uint32_t) RTDbgAsRelease(RTDBGAS hDbgAs);
563
564/**
565 * Locks the address space for exclusive access.
566 *
567 * @returns IRPT status code
568 * @param hDbgAs The address space handle.
569 */
570RTDECL(int) RTDbgAsLockExcl(RTDBGAS hDbgAs);
571
572/**
573 * Counters the actions of one RTDbgAsUnlockExcl call.
574 *
575 * @returns IRPT status code
576 * @param hDbgAs The address space handle.
577 */
578RTDECL(int) RTDbgAsUnlockExcl(RTDBGAS hDbgAs);
579
580/**
581 * Gets the name of an address space.
582 *
583 * @returns read only address space name.
584 * NULL if hDbgAs is invalid.
585 *
586 * @param hDbgAs The address space handle.
587 *
588 * @remarks Will not take any locks.
589 */
590RTDECL(const char *) RTDbgAsName(RTDBGAS hDbgAs);
591
592/**
593 * Gets the first address in an address space.
594 *
595 * @returns The address.
596 * 0 if hDbgAs is invalid.
597 *
598 * @param hDbgAs The address space handle.
599 *
600 * @remarks Will not take any locks.
601 */
602RTDECL(RTUINTPTR) RTDbgAsFirstAddr(RTDBGAS hDbgAs);
603
604/**
605 * Gets the last address in an address space.
606 *
607 * @returns The address.
608 * 0 if hDbgAs is invalid.
609 *
610 * @param hDbgAs The address space handle.
611 *
612 * @remarks Will not take any locks.
613 */
614RTDECL(RTUINTPTR) RTDbgAsLastAddr(RTDBGAS hDbgAs);
615
616/**
617 * Gets the number of modules in the address space.
618 *
619 * This can be used together with RTDbgAsModuleByIndex
620 * to enumerate the modules.
621 *
622 * @returns The number of modules.
623 *
624 * @param hDbgAs The address space handle.
625 *
626 * @remarks Will not take any locks.
627 */
628RTDECL(uint32_t) RTDbgAsModuleCount(RTDBGAS hDbgAs);
629
630/** @name Flags for RTDbgAsModuleLink and RTDbgAsModuleLinkSeg
631 * @{ */
632/** Replace all conflicting module.
633 * (The conflicting modules will be removed the address space and their
634 * references released.) */
635#define RTDBGASLINK_FLAGS_REPLACE RT_BIT_32(0)
636/** Mask containing the valid flags. */
637#define RTDBGASLINK_FLAGS_VALID_MASK UINT32_C(0x00000001)
638/** @} */
639
640/**
641 * Links a module into the address space at the give address.
642 *
643 * The size of the mapping is determined using RTDbgModImageSize().
644 *
645 * @returns IPRT status code.
646 * @retval VERR_OUT_OF_RANGE if the specified address will put the module
647 * outside the address space.
648 * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
649 *
650 * @param hDbgAs The address space handle.
651 * @param hDbgMod The module handle of the module to be linked in.
652 * @param ImageAddr The address to link the module at.
653 * @param fFlags See RTDBGASLINK_FLAGS_*.
654 */
655RTDECL(int) RTDbgAsModuleLink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTUINTPTR ImageAddr, uint32_t fFlags);
656
657/**
658 * Links a segment into the address space at the give address.
659 *
660 * The size of the mapping is determined using RTDbgModSegmentSize().
661 *
662 * @returns IPRT status code.
663 * @retval VERR_OUT_OF_RANGE if the specified address will put the module
664 * outside the address space.
665 * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings.
666 *
667 * @param hDbgAs The address space handle.
668 * @param hDbgMod The module handle.
669 * @param iSeg The segment number (0-based) of the segment to be
670 * linked in.
671 * @param SegAddr The address to link the segment at.
672 * @param fFlags See RTDBGASLINK_FLAGS_*.
673 */
674RTDECL(int) RTDbgAsModuleLinkSeg(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr, uint32_t fFlags);
675
676/**
677 * Unlinks all the mappings of a module from the address space.
678 *
679 * @returns IPRT status code.
680 * @retval VERR_NOT_FOUND if the module wasn't found.
681 *
682 * @param hDbgAs The address space handle.
683 * @param hDbgMod The module handle of the module to be unlinked.
684 */
685RTDECL(int) RTDbgAsModuleUnlink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod);
686
687/**
688 * Unlinks the mapping at the specified address.
689 *
690 * @returns IPRT status code.
691 * @retval VERR_NOT_FOUND if no module or segment is mapped at that address.
692 *
693 * @param hDbgAs The address space handle.
694 * @param Addr The address within the mapping to be unlinked.
695 */
696RTDECL(int) RTDbgAsModuleUnlinkByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr);
697
698/**
699 * Get a the handle of a module in the address space by is index.
700 *
701 * @returns A retained handle to the specified module. The caller must release
702 * the returned reference.
703 * NIL_RTDBGMOD if invalid index or handle.
704 *
705 * @param hDbgAs The address space handle.
706 * @param iModule The index of the module to get.
707 *
708 * @remarks The module indexes may change after calls to RTDbgAsModuleLink,
709 * RTDbgAsModuleLinkSeg, RTDbgAsModuleUnlink and
710 * RTDbgAsModuleUnlinkByAddr.
711 */
712RTDECL(RTDBGMOD) RTDbgAsModuleByIndex(RTDBGAS hDbgAs, uint32_t iModule);
713
714/**
715 * Queries mapping module information by handle.
716 *
717 * @returns IPRT status code.
718 * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
719 *
720 * @param hDbgAs The address space handle.
721 * @param Addr Address within the mapping of the module or segment.
722 * @param phMod Where to the return the retained module handle.
723 * Optional.
724 * @param pAddr Where to return the base address of the mapping.
725 * Optional.
726 * @param piSeg Where to return the segment index. This is set to
727 * NIL if the entire module is mapped as a single
728 * mapping. Optional.
729 */
730RTDECL(int) RTDbgAsModuleByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTDBGMOD phMod, PRTUINTPTR pAddr, PRTDBGSEGIDX piSeg);
731
732/**
733 * Queries mapping module information by name.
734 *
735 * @returns IPRT status code.
736 * @retval VERR_NOT_FOUND if no mapping was found at the specified address.
737 * @retval VERR_OUT_OF_RANGE if the name index was out of range.
738 *
739 * @param hDbgAs The address space handle.
740 * @param pszName The module name.
741 * @param iName There can be more than one module by the same name
742 * in an address space. This argument indicates which
743 * is meant. (0 based)
744 * @param phMod Where to the return the retained module handle.
745 */
746RTDECL(int) RTDbgAsModuleByName(RTDBGAS hDbgAs, const char *pszName, uint32_t iName, PRTDBGMOD phMod);
747
748/**
749 * Information about a mapping.
750 *
751 * This is used by RTDbgAsModuleGetMapByIndex.
752 */
753typedef struct RTDBGASMAPINFO
754{
755 /** The mapping address. */
756 RTUINTPTR Address;
757 /** The segment mapped there.
758 * This is NIL_RTDBGSEGIDX if the entire module image is mapped here. */
759 RTDBGSEGIDX iSeg;
760} RTDBGASMAPINFO;
761/** Pointer to info about an address space mapping. */
762typedef RTDBGASMAPINFO *PRTDBGASMAPINFO;
763/** Pointer to const info about an address space mapping. */
764typedef RTDBGASMAPINFO const *PCRTDBGASMAPINFO;
765
766/**
767 * Queries mapping information for a module given by index.
768 *
769 * @returns IRPT status code.
770 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
771 * @retval VERR_OUT_OF_RANGE if the name index was out of range.
772 * @retval VINF_BUFFER_OVERFLOW if the array is too small and the returned
773 * information is incomplete.
774 *
775 * @param hDbgAs The address space handle.
776 * @param iModule The index of the module to get.
777 * @param paMappings Where to return the mapping information. The buffer
778 * size is given by *pcMappings.
779 * @param pcMappings IN: Size of the paMappings array. OUT: The number of
780 * entries returned.
781 * @param fFlags Flags for reserved for future use. MBZ.
782 *
783 * @remarks See remarks for RTDbgAsModuleByIndex regarding the volatility of the
784 * iModule parameter.
785 */
786RTDECL(int) RTDbgAsModuleQueryMapByIndex(RTDBGAS hDbgAs, uint32_t iModule, PRTDBGASMAPINFO paMappings, uint32_t *pcMappings, uint32_t fFlags);
787
788/**
789 * Adds a symbol to a module in the address space.
790 *
791 * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones.
792 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
793 * @retval VERR_NOT_FOUND if no module was found at the specified address.
794 * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
795 * custom symbols.
796 *
797 * @param hDbgAs The address space handle.
798 * @param pszSymbol The symbol name.
799 * @param Addr The address of the symbol.
800 * @param cb The size of the symbol.
801 * @param fFlags Symbol flags.
802 * @param piOrdinal Where to return the symbol ordinal on success. If
803 * the interpreter doesn't do ordinals, this will be set to
804 * UINT32_MAX. Optional
805 */
806RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
807
808/**
809 * Query a symbol by address.
810 *
811 * @returns IPRT status code. See RTDbgModSymbolAddr for more specific ones.
812 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
813 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
814 * @retval VERR_INVALID_PARAMETER if incorrect flags.
815 *
816 * @param hDbgAs The address space handle.
817 * @param Addr The address which closest symbol is requested.
818 * @param fFlags Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
819 * @param poffDisp Where to return the distance between the symbol
820 * and address. Optional.
821 * @param pSymbol Where to return the symbol info.
822 * @param phMod Where to return the module handle. Optional.
823 */
824RTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, uint32_t fFlags,
825 PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
826
827/**
828 * Query a symbol by address.
829 *
830 * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
831 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
832 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
833 * @retval VERR_INVALID_PARAMETER if incorrect flags.
834 *
835 * @param hDbgAs The address space handle.
836 * @param Addr The address which closest symbol is requested.
837 * @param fFlags Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
838 * @param poffDisp Where to return the distance between the symbol
839 * and address. Optional.
840 * @param ppSymInfo Where to return the pointer to the allocated symbol
841 * info. Always set. Free with RTDbgSymbolFree.
842 * @param phMod Where to return the module handle. Optional.
843 */
844RTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, uint32_t fFlags,
845 PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo, PRTDBGMOD phMod);
846
847/**
848 * Query a symbol by name.
849 *
850 * @returns IPRT status code.
851 * @retval VERR_SYMBOL_NOT_FOUND if not found.
852 *
853 * @param hDbgAs The address space handle.
854 * @param pszSymbol The symbol name. It is possible to limit the scope
855 * of the search by prefixing the symbol with a module
856 * name pattern followed by a bang (!) character.
857 * RTStrSimplePatternNMatch is used for the matching.
858 * @param pSymbol Where to return the symbol info.
859 * @param phMod Where to return the module handle. Optional.
860 */
861RTDECL(int) RTDbgAsSymbolByName(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
862
863/**
864 * Query a symbol by name, allocating the returned symbol structure.
865 *
866 * @returns IPRT status code.
867 * @retval VERR_SYMBOL_NOT_FOUND if not found.
868 *
869 * @param hDbgAs The address space handle.
870 * @param pszSymbol The symbol name. See RTDbgAsSymbolByName for more.
871 * @param ppSymbol Where to return the pointer to the allocated
872 * symbol info. Always set. Free with RTDbgSymbolFree.
873 * @param phMod Where to return the module handle. Optional.
874 */
875RTDECL(int) RTDbgAsSymbolByNameA(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol, PRTDBGMOD phMod);
876
877/**
878 * Adds a line number to a module in the address space.
879 *
880 * @returns IPRT status code. See RTDbgModLineAdd for more specific ones.
881 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
882 * @retval VERR_NOT_FOUND if no module was found at the specified address.
883 * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
884 * custom symbols.
885 *
886 * @param hDbgAs The address space handle.
887 * @param pszFile The file name.
888 * @param uLineNo The line number.
889 * @param Addr The address of the symbol.
890 * @param piOrdinal Where to return the line number ordinal on success.
891 * If the interpreter doesn't do ordinals, this will be
892 * set to UINT32_MAX. Optional.
893 */
894RTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr, uint32_t *piOrdinal);
895
896/**
897 * Query a line number by address.
898 *
899 * @returns IPRT status code. See RTDbgModLineAddrA for more specific ones.
900 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
901 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
902 *
903 * @param hDbgAs The address space handle.
904 * @param Addr The address which closest symbol is requested.
905 * @param poffDisp Where to return the distance between the line
906 * number and address.
907 * @param pLine Where to return the line number information.
908 * @param phMod Where to return the module handle. Optional.
909 */
910RTDECL(int) RTDbgAsLineByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine, PRTDBGMOD phMod);
911
912/**
913 * Query a line number by address.
914 *
915 * @returns IPRT status code. See RTDbgModLineAddrA for more specific ones.
916 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid.
917 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module.
918 *
919 * @param hDbgAs The address space handle.
920 * @param Addr The address which closest symbol is requested.
921 * @param poffDisp Where to return the distance between the line
922 * number and address.
923 * @param ppLine Where to return the pointer to the allocated line
924 * number info. Always set. Free with RTDbgLineFree.
925 * @param phMod Where to return the module handle. Optional.
926 */
927RTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine, PRTDBGMOD phMod);
928
929/** @todo Missing some bits here. */
930
931/** @} */
932
933
934/** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interpreter
935 * @{
936 */
937
938/**
939 * Creates a module based on the default debug info container.
940 *
941 * This can be used to manually load a module and its symbol. The primary user
942 * group is the debug info interpreters, which use this API to create an
943 * efficient debug info container behind the scenes and forward all queries to
944 * it once the info has been loaded.
945 *
946 * @returns IPRT status code.
947 *
948 * @param phDbgMod Where to return the module handle.
949 * @param pszName The name of the module (mandatory).
950 * @param cbSeg The size of initial segment. If zero, segments will
951 * have to be added manually using RTDbgModSegmentAdd.
952 * @param fFlags Flags reserved for future extensions, MBZ for now.
953 */
954RTDECL(int) RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, RTUINTPTR cbSeg, uint32_t fFlags);
955
956RTDECL(int) RTDbgModCreateFromImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName,
957 RTLDRARCH enmArch, RTDBGCFG hDbgCfg);
958RTDECL(int) RTDbgModCreateFromMap(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTUINTPTR uSubtrahend,
959 RTDBGCFG hDbgCfg);
960RTDECL(int) RTDbgModCreateFromPeImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, RTLDRMOD hLdrMod,
961 uint32_t cbImage, uint32_t uTimeDateStamp, RTDBGCFG hDbgCfg);
962RTDECL(int) RTDbgModCreateFromDbg(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
963 uint32_t uTimeDateStamp, RTDBGCFG hDbgCfg);
964RTDECL(int) RTDbgModCreateFromPdb(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
965 PCRTUUID pUuid, uint32_t Age, RTDBGCFG hDbgCfg);
966RTDECL(int) RTDbgModCreateFromDwo(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
967 uint32_t uCrc32, RTDBGCFG hDbgCfg);
968RTDECL(int) RTDbgModCreateFromMachOImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName,
969 RTLDRARCH enmArch, uint32_t cbImage, uint32_t cSegs, PCRTDBGSEGMENT paSegs,
970 PCRTUUID pUuid, RTDBGCFG hDbgCfg, uint32_t fFlags);
971
972/** @name Flags for RTDbgModCreate and friends.
973 * @{ */
974/** Overrides the hDbgCfg settings and forces an image and/or symbol file
975 * search. RTDbgModCreate will quietly ignore this flag. */
976#define RTDBGMOD_F_NOT_DEFERRED RT_BIT_32(0)
977/** @} */
978
979
980/**
981 * Retains another reference to the module.
982 *
983 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
984 *
985 * @param hDbgMod The module handle.
986 *
987 * @remarks Will not take any locks.
988 */
989RTDECL(uint32_t) RTDbgModRetain(RTDBGMOD hDbgMod);
990
991/**
992 * Release a reference to the module.
993 *
994 * When the reference count reaches zero, the module is destroyed.
995 *
996 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
997 *
998 * @param hDbgMod The module handle. The NIL handle is quietly ignored
999 * and 0 is returned.
1000 *
1001 * @remarks Will not take any locks.
1002 */
1003RTDECL(uint32_t) RTDbgModRelease(RTDBGMOD hDbgMod);
1004
1005/**
1006 * Removes all content from the debug module (container), optionally only
1007 * leaving segments and image size intact.
1008 *
1009 * This is only possible on container modules, i.e. created by RTDbgModCreate().
1010 *
1011 * @returns IPRT status code.
1012 * @param hDbgMod The module handle.
1013 * @param fLeaveSegments Whether to leave segments (and image size) as is.
1014 */
1015RTDECL(int) RTDbgModRemoveAll(RTDBGMOD hDbgMod, bool fLeaveSegments);
1016
1017/**
1018 * Gets the module name.
1019 *
1020 * @returns Pointer to a read only string containing the name.
1021 *
1022 * @param hDbgMod The module handle.
1023 */
1024RTDECL(const char *) RTDbgModName(RTDBGMOD hDbgMod);
1025
1026/**
1027 * Gets the name of the debug info file we're using.
1028 *
1029 * @returns Pointer to a read only string containing the filename, NULL if we
1030 * don't use one.
1031 *
1032 * @param hDbgMod The module handle.
1033 */
1034RTDECL(const char *) RTDbgModDebugFile(RTDBGMOD hDbgMod);
1035
1036/**
1037 * Gets the image filename (as specified by the user).
1038 *
1039 * @returns Pointer to a read only string containing the filename.
1040 *
1041 * @param hDbgMod The module handle.
1042 */
1043RTDECL(const char *) RTDbgModImageFile(RTDBGMOD hDbgMod);
1044
1045/**
1046 * Gets the image filename actually used if it differs from RTDbgModImageFile.
1047 *
1048 * @returns Pointer to a read only string containing the filename, NULL if same
1049 * as RTDBgModImageFile.
1050 *
1051 * @param hDbgMod The module handle.
1052 */
1053RTDECL(const char *) RTDbgModImageFileUsed(RTDBGMOD hDbgMod);
1054
1055/**
1056 * Checks if the loading of the debug info has been postponed.
1057 *
1058 * @returns true if postponed, false if not or invalid handle.
1059 * @param hDbgMod The module handle.
1060 */
1061RTDECL(bool) RTDbgModIsDeferred(RTDBGMOD hDbgMod);
1062
1063/**
1064 * Checks if the debug info is exports only.
1065 *
1066 * @returns true if exports only, false if not or invalid handle.
1067 * @param hDbgMod The module handle.
1068 */
1069RTDECL(bool) RTDbgModIsExports(RTDBGMOD hDbgMod);
1070
1071/**
1072 * Converts an image relative address to a segment:offset address.
1073 *
1074 * @returns Segment index on success.
1075 * NIL_RTDBGSEGIDX is returned if the module handle or the RVA are
1076 * invalid.
1077 *
1078 * @param hDbgMod The module handle.
1079 * @param uRva The image relative address to convert.
1080 * @param poffSeg Where to return the segment offset. Optional.
1081 */
1082RTDECL(RTDBGSEGIDX) RTDbgModRvaToSegOff(RTDBGMOD hDbgMod, RTUINTPTR uRva, PRTUINTPTR poffSeg);
1083
1084/**
1085 * Image size when mapped if segments are mapped adjacently.
1086 *
1087 * For ELF, PE, and Mach-O images this is (usually) a natural query, for LX and
1088 * NE and such it's a bit odder and the answer may not make much sense for them.
1089 *
1090 * @returns Image mapped size.
1091 * RTUINTPTR_MAX is returned if the handle is invalid.
1092 *
1093 * @param hDbgMod The module handle.
1094 */
1095RTDECL(RTUINTPTR) RTDbgModImageSize(RTDBGMOD hDbgMod);
1096
1097/**
1098 * Gets the module tag value if any.
1099 *
1100 * @returns The tag. 0 if hDbgMod is invalid.
1101 *
1102 * @param hDbgMod The module handle.
1103 */
1104RTDECL(uint64_t) RTDbgModGetTag(RTDBGMOD hDbgMod);
1105
1106/**
1107 * Tags or untags the module.
1108 *
1109 * @returns IPRT status code.
1110 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1111 *
1112 * @param hDbgMod The module handle.
1113 * @param uTag The tag value. The convention is that 0 is no tag
1114 * and any other value means it's tagged. It's adviced
1115 * to use some kind of unique number like an address
1116 * (global or string cache for instance) to avoid
1117 * collisions with other users
1118 */
1119RTDECL(int) RTDbgModSetTag(RTDBGMOD hDbgMod, uint64_t uTag);
1120
1121
1122/**
1123 * Adds a segment to the module. Optional feature.
1124 *
1125 * This method is intended used for manually constructing debug info for a
1126 * module. The main usage is from other debug info interpreters that want to
1127 * avoid writing a debug info database and instead uses the standard container
1128 * behind the scenes.
1129 *
1130 * @returns IPRT status code.
1131 * @retval VERR_NOT_SUPPORTED if this feature isn't support by the debug info
1132 * interpreter. This is a common return code.
1133 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1134 * @retval VERR_DBG_ADDRESS_WRAP if uRva+cb wraps around.
1135 * @retval VERR_DBG_SEGMENT_NAME_OUT_OF_RANGE if pszName is too short or long.
1136 * @retval VERR_INVALID_PARAMETER if fFlags contains undefined flags.
1137 * @retval VERR_DBG_SPECIAL_SEGMENT if *piSeg is a special segment.
1138 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if *piSeg doesn't meet expectations.
1139 *
1140 * @param hDbgMod The module handle.
1141 * @param uRva The image relative address of the segment.
1142 * @param cb The size of the segment.
1143 * @param pszName The segment name. Does not normally need to be
1144 * unique, although this is somewhat up to the
1145 * debug interpreter to decide.
1146 * @param fFlags Segment flags. Reserved for future used, MBZ.
1147 * @param piSeg The segment index or NIL_RTDBGSEGIDX on input.
1148 * The assigned segment index on successful return.
1149 * Optional.
1150 */
1151RTDECL(int) RTDbgModSegmentAdd(RTDBGMOD hDbgMod, RTUINTPTR uRva, RTUINTPTR cb, const char *pszName,
1152 uint32_t fFlags, PRTDBGSEGIDX piSeg);
1153
1154/**
1155 * Gets the number of segments in the module.
1156 *
1157 * This is can be used to determine the range which can be passed to
1158 * RTDbgModSegmentByIndex and derivates.
1159 *
1160 * @returns The segment relative address.
1161 * NIL_RTDBGSEGIDX if the handle is invalid.
1162 *
1163 * @param hDbgMod The module handle.
1164 */
1165RTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod);
1166
1167/**
1168 * Query information about a segment.
1169 *
1170 * This can be used together with RTDbgModSegmentCount to enumerate segments.
1171 * The index starts a 0 and stops one below RTDbgModSegmentCount.
1172 *
1173 * @returns IPRT status code.
1174 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if iSeg is too high.
1175 * @retval VERR_DBG_SPECIAL_SEGMENT if iSeg indicates a special segment.
1176 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1177 *
1178 * @param hDbgMod The module handle.
1179 * @param iSeg The segment index. No special segments.
1180 * @param pSegInfo Where to return the segment info. The
1181 * RTDBGSEGMENT::Address member will be set to
1182 * RTUINTPTR_MAX or the load address used at link time.
1183 */
1184RTDECL(int) RTDbgModSegmentByIndex(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, PRTDBGSEGMENT pSegInfo);
1185
1186/**
1187 * Gets the size of a segment.
1188 *
1189 * This is a just a wrapper around RTDbgModSegmentByIndex.
1190 *
1191 * @returns The segment size.
1192 * RTUINTPTR_MAX is returned if either the handle and segment index are
1193 * invalid.
1194 *
1195 * @param hDbgMod The module handle.
1196 * @param iSeg The segment index. RTDBGSEGIDX_ABS is not allowed.
1197 * If RTDBGSEGIDX_RVA is used, the functions returns
1198 * the same value as RTDbgModImageSize.
1199 */
1200RTDECL(RTUINTPTR) RTDbgModSegmentSize(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
1201
1202/**
1203 * Gets the image relative address of a segment.
1204 *
1205 * This is a just a wrapper around RTDbgModSegmentByIndex.
1206 *
1207 * @returns The segment relative address.
1208 * RTUINTPTR_MAX is returned if either the handle and segment index are
1209 * invalid.
1210 *
1211 * @param hDbgMod The module handle.
1212 * @param iSeg The segment index. No special segment indexes
1213 * allowed (asserted).
1214 */
1215RTDECL(RTUINTPTR) RTDbgModSegmentRva(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
1216
1217
1218/**
1219 * Adds a line number to the module.
1220 *
1221 * @returns IPRT status code.
1222 * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
1223 * custom symbols. This is a common place occurrence.
1224 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1225 * @retval VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE if the symbol name is too long or
1226 * short.
1227 * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
1228 * it's not inside any of the segments defined by the module.
1229 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
1230 * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
1231 * end of the segment.
1232 * @retval VERR_DBG_ADDRESS_WRAP if off+cb wraps around.
1233 * @retval VERR_INVALID_PARAMETER if the symbol flags sets undefined bits.
1234 *
1235 * @param hDbgMod The module handle.
1236 * @param pszSymbol The symbol name.
1237 * @param iSeg The segment index.
1238 * @param off The segment offset.
1239 * @param cb The size of the symbol. Can be zero, although this
1240 * may depend somewhat on the debug interpreter.
1241 * @param fFlags Symbol flags. Reserved for the future, MBZ.
1242 * @param piOrdinal Where to return the symbol ordinal on success. If
1243 * the interpreter doesn't do ordinals, this will be set to
1244 * UINT32_MAX. Optional.
1245 */
1246RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off,
1247 RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
1248
1249/**
1250 * Gets the symbol count.
1251 *
1252 * This can be used together wtih RTDbgModSymbolByOrdinal or
1253 * RTDbgModSymbolByOrdinalA to enumerate all the symbols.
1254 *
1255 * @returns The number of symbols in the module.
1256 * UINT32_MAX is returned if the module handle is invalid or some other
1257 * error occurs.
1258 *
1259 * @param hDbgMod The module handle.
1260 */
1261RTDECL(uint32_t) RTDbgModSymbolCount(RTDBGMOD hDbgMod);
1262
1263/**
1264 * Queries symbol information by ordinal number.
1265 *
1266 * @returns IPRT status code.
1267 * @retval VERR_SYMBOL_NOT_FOUND if there is no symbol at the given number.
1268 * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
1269 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1270 * @retval VERR_NOT_SUPPORTED if lookup by ordinal is not supported.
1271 *
1272 * @param hDbgMod The module handle.
1273 * @param iOrdinal The symbol ordinal number. 0-based. The highest
1274 * number is RTDbgModSymbolCount() - 1.
1275 * @param pSymInfo Where to store the symbol information.
1276 */
1277RTDECL(int) RTDbgModSymbolByOrdinal(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGSYMBOL pSymInfo);
1278
1279/**
1280 * Queries symbol information by ordinal number.
1281 *
1282 * @returns IPRT status code.
1283 * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
1284 * @retval VERR_NOT_SUPPORTED if lookup by ordinal is not supported.
1285 * @retval VERR_SYMBOL_NOT_FOUND if there is no symbol at the given number.
1286 * @retval VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
1287 *
1288 * @param hDbgMod The module handle.
1289 * @param iOrdinal The symbol ordinal number. 0-based. The highest
1290 * number is RTDbgModSymbolCount() - 1.
1291 * @param ppSymInfo Where to store the pointer to the returned
1292 * symbol information. Always set. Free with
1293 * RTDbgSymbolFree.
1294 */
1295RTDECL(int) RTDbgModSymbolByOrdinalA(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGSYMBOL *ppSymInfo);
1296
1297/**
1298 * Queries symbol information by address.
1299 *
1300 * The returned symbol is what the debug info interpreter considers the symbol
1301 * most applicable to the specified address. This usually means a symbol with an
1302 * address equal or lower than the requested.
1303 *
1304 * @returns IPRT status code.
1305 * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
1306 * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
1307 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1308 * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
1309 * it's not inside any of the segments defined by the module.
1310 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
1311 * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
1312 * end of the segment.
1313 * @retval VERR_INVALID_PARAMETER if incorrect flags.
1314 *
1315 * @param hDbgMod The module handle.
1316 * @param iSeg The segment number.
1317 * @param off The offset into the segment.
1318 * @param fFlags Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
1319 * @param poffDisp Where to store the distance between the
1320 * specified address and the returned symbol.
1321 * Optional.
1322 * @param pSymInfo Where to store the symbol information.
1323 */
1324RTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
1325 PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo);
1326
1327/**
1328 * Queries symbol information by address.
1329 *
1330 * The returned symbol is what the debug info interpreter considers the symbol
1331 * most applicable to the specified address. This usually means a symbol with an
1332 * address equal or lower than the requested.
1333 *
1334 * @returns IPRT status code.
1335 * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
1336 * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
1337 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1338 * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
1339 * it's not inside any of the segments defined by the module.
1340 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
1341 * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
1342 * end of the segment.
1343 * @retval VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
1344 * @retval VERR_INVALID_PARAMETER if incorrect flags.
1345 *
1346 * @param hDbgMod The module handle.
1347 * @param iSeg The segment index.
1348 * @param off The offset into the segment.
1349 * @param fFlags Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
1350 * @param poffDisp Where to store the distance between the
1351 * specified address and the returned symbol. Optional.
1352 * @param ppSymInfo Where to store the pointer to the returned
1353 * symbol information. Always set. Free with
1354 * RTDbgSymbolFree.
1355 */
1356RTDECL(int) RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
1357 PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo);
1358
1359/**
1360 * Queries symbol information by symbol name.
1361 *
1362 * @returns IPRT status code.
1363 * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
1364 * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
1365 * @retval VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE if the symbol name is too long or
1366 * short.
1367 *
1368 * @param hDbgMod The module handle.
1369 * @param pszSymbol The symbol name.
1370 * @param pSymInfo Where to store the symbol information.
1371 */
1372RTDECL(int) RTDbgModSymbolByName(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL pSymInfo);
1373
1374/**
1375 * Queries symbol information by symbol name.
1376 *
1377 * @returns IPRT status code.
1378 * @retval VERR_DBG_NO_SYMBOLS if there aren't any symbols.
1379 * @retval VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
1380 * @retval VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE if the symbol name is too long or
1381 * short.
1382 * @retval VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
1383 *
1384 * @param hDbgMod The module handle.
1385 * @param pszSymbol The symbol name.
1386 * @param ppSymInfo Where to store the pointer to the returned
1387 * symbol information. Always set. Free with
1388 * RTDbgSymbolFree.
1389 */
1390RTDECL(int) RTDbgModSymbolByNameA(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL *ppSymInfo);
1391
1392/**
1393 * Adds a line number to the module.
1394 *
1395 * @returns IPRT status code.
1396 * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding
1397 * custom symbols. This should be consider a normal response.
1398 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1399 * @retval VERR_DBG_FILE_NAME_OUT_OF_RANGE if the file name is too longer or
1400 * empty.
1401 * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
1402 * it's not inside any of the segments defined by the module.
1403 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
1404 * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
1405 * end of the segment.
1406 * @retval VERR_INVALID_PARAMETER if the line number flags sets undefined bits.
1407 *
1408 * @param hDbgMod The module handle.
1409 * @param pszFile The file name.
1410 * @param uLineNo The line number.
1411 * @param iSeg The segment index.
1412 * @param off The segment offset.
1413 * @param piOrdinal Where to return the line number ordinal on
1414 * success. If the interpreter doesn't do ordinals,
1415 * this will be set to UINT32_MAX. Optional.
1416 */
1417RTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo,
1418 RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t *piOrdinal);
1419
1420/**
1421 * Gets the line number count.
1422 *
1423 * This can be used together wtih RTDbgModLineByOrdinal or RTDbgModSymbolByLineA
1424 * to enumerate all the line number information.
1425 *
1426 * @returns The number of line numbers in the module.
1427 * UINT32_MAX is returned if the module handle is invalid or some other
1428 * error occurs.
1429 *
1430 * @param hDbgMod The module handle.
1431 */
1432RTDECL(uint32_t) RTDbgModLineCount(RTDBGMOD hDbgMod);
1433
1434/**
1435 * Queries line number information by ordinal number.
1436 *
1437 * This can be used to enumerate the line numbers for the module. Use
1438 * RTDbgModLineCount() to figure the end of the ordinals.
1439 *
1440 * @returns IPRT status code.
1441 * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
1442 * @retval VERR_DBG_LINE_NOT_FOUND if there is no line number with that
1443 * ordinal.
1444 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1445
1446 * @param hDbgMod The module handle.
1447 * @param iOrdinal The line number ordinal number.
1448 * @param pLineInfo Where to store the information about the line
1449 * number.
1450 */
1451RTDECL(int) RTDbgModLineByOrdinal(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGLINE pLineInfo);
1452
1453/**
1454 * Queries line number information by ordinal number.
1455 *
1456 * This can be used to enumerate the line numbers for the module. Use
1457 * RTDbgModLineCount() to figure the end of the ordinals.
1458 *
1459 * @returns IPRT status code.
1460 * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
1461 * @retval VERR_DBG_LINE_NOT_FOUND if there is no line number with that
1462 * ordinal.
1463 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1464 * @retval VERR_NO_MEMORY if RTDbgLineAlloc fails.
1465 *
1466 * @param hDbgMod The module handle.
1467 * @param iOrdinal The line number ordinal number.
1468 * @param ppLineInfo Where to store the pointer to the returned line
1469 * number information. Always set. Free with
1470 * RTDbgLineFree.
1471 */
1472RTDECL(int) RTDbgModLineByOrdinalA(RTDBGMOD hDbgMod, uint32_t iOrdinal, PRTDBGLINE *ppLineInfo);
1473
1474/**
1475 * Queries line number information by address.
1476 *
1477 * The returned line number is what the debug info interpreter considers the
1478 * one most applicable to the specified address. This usually means a line
1479 * number with an address equal or lower than the requested.
1480 *
1481 * @returns IPRT status code.
1482 * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
1483 * @retval VERR_DBG_LINE_NOT_FOUND if no suitable line number was found.
1484 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1485 * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
1486 * it's not inside any of the segments defined by the module.
1487 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
1488 * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
1489 * end of the segment.
1490 *
1491 * @param hDbgMod The module handle.
1492 * @param iSeg The segment number.
1493 * @param off The offset into the segment.
1494 * @param poffDisp Where to store the distance between the
1495 * specified address and the returned symbol.
1496 * Optional.
1497 * @param pLineInfo Where to store the line number information.
1498 */
1499RTDECL(int) RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLineInfo);
1500
1501/**
1502 * Queries line number information by address.
1503 *
1504 * The returned line number is what the debug info interpreter considers the
1505 * one most applicable to the specified address. This usually means a line
1506 * number with an address equal or lower than the requested.
1507 *
1508 * @returns IPRT status code.
1509 * @retval VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
1510 * @retval VERR_DBG_LINE_NOT_FOUND if no suitable line number was found.
1511 * @retval VERR_INVALID_HANDLE if hDbgMod is invalid.
1512 * @retval VERR_DBG_INVALID_RVA if an image relative address is specified and
1513 * it's not inside any of the segments defined by the module.
1514 * @retval VERR_DBG_INVALID_SEGMENT_INDEX if the segment index isn't valid.
1515 * @retval VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
1516 * end of the segment.
1517 * @retval VERR_NO_MEMORY if RTDbgLineAlloc fails.
1518 *
1519 * @param hDbgMod The module handle.
1520 * @param iSeg The segment number.
1521 * @param off The offset into the segment.
1522 * @param poffDisp Where to store the distance between the
1523 * specified address and the returned symbol.
1524 * Optional.
1525 * @param ppLineInfo Where to store the pointer to the returned line
1526 * number information. Always set. Free with
1527 * RTDbgLineFree.
1528 */
1529RTDECL(int) RTDbgModLineByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE *ppLineInfo);
1530/** @} */
1531
1532# endif /* IN_RING3 */
1533
1534
1535/** @name Kernel Debug Info API
1536 *
1537 * This is a specialized API for obtaining symbols and structure information
1538 * about the running kernel. It is relatively OS specific. Its purpose and
1539 * operation is doesn't map all that well onto RTDbgMod, so a few dedicated
1540 * functions was created for it.
1541 *
1542 * @{ */
1543
1544/** Handle to the kernel debug info. */
1545typedef struct RTDBGKRNLINFOINT *RTDBGKRNLINFO;
1546/** Pointer to a kernel debug info handle. */
1547typedef RTDBGKRNLINFO *PRTDBGKRNLINFO;
1548/** Nil kernel debug info handle. */
1549#define NIL_RTDBGKRNLINFO ((RTDBGKRNLINFO)0)
1550
1551/**
1552 * Opens the kernel debug info.
1553 *
1554 * @returns IPRT status code. Can fail for any number of reasons.
1555 *
1556 * @param phKrnlInfo Where to return the kernel debug info handle on
1557 * success.
1558 * @param fFlags Flags reserved for future use. Must be zero.
1559 */
1560RTR0DECL(int) RTR0DbgKrnlInfoOpen(PRTDBGKRNLINFO phKrnlInfo, uint32_t fFlags);
1561
1562/**
1563 * Retains a reference to the kernel debug info handle.
1564 *
1565 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
1566 * @param hKrnlInfo The kernel info handle.
1567 */
1568RTR0DECL(uint32_t) RTR0DbgKrnlInfoRetain(RTDBGKRNLINFO hKrnlInfo);
1569
1570
1571/**
1572 * Releases a reference to the kernel debug info handle, destroying it when the
1573 * counter reaches zero.
1574 *
1575 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
1576 * @param hKrnlInfo The kernel info handle. NIL_RTDBGKRNLINFO is
1577 * quietly ignored.
1578 */
1579RTR0DECL(uint32_t) RTR0DbgKrnlInfoRelease(RTDBGKRNLINFO hKrnlInfo);
1580
1581/**
1582 * Queries the offset (in bytes) of a member of a kernel structure.
1583 *
1584 * @returns IPRT status code.
1585 * @retval VINF_SUCCESS and offset at @a poffMember.
1586 * @retval VERR_NOT_FOUND if the structure or the member was not found.
1587 * @retval VERR_INVALID_HANDLE if hKrnlInfo is bad.
1588 * @retval VERR_INVALID_POINTER if any of the pointers are bad.
1589 *
1590 * @param hKrnlInfo The kernel info handle.
1591 * @param pszStructure The structure name.
1592 * @param pszMember The member name.
1593 * @param poffMember Where to return the offset.
1594 */
1595RTR0DECL(int) RTR0DbgKrnlInfoQueryMember(RTDBGKRNLINFO hKrnlInfo, const char *pszStructure,
1596 const char *pszMember, size_t *poffMember);
1597
1598
1599/**
1600 * Queries the value (usually the address) of a kernel symbol.
1601 *
1602 * This may go looking for the symbol in other modules, in which case it will
1603 * always check the kernel symbol table first.
1604 *
1605 * @returns IPRT status code.
1606 * @retval VINF_SUCCESS and value at @a ppvSymbol.
1607 * @retval VERR_SYMBOL_NOT_FOUND
1608 * @retval VERR_INVALID_HANDLE if hKrnlInfo is bad.
1609 * @retval VERR_INVALID_POINTER if any of the pointers are bad.
1610 *
1611 * @param hKrnlInfo The kernel info handle.
1612 * @param pszModule Reserved for future extensions. Pass NULL.
1613 * @param pszSymbol The C name of the symbol.
1614 * @param ppvSymbol Where to return the symbol value, passing NULL is
1615 * OK. This may be modified even on failure, in
1616 * particular, it will be set to NULL when
1617 * VERR_SYMBOL_NOT_FOUND is returned.
1618 *
1619 * @sa RTLdrGetSymbol.
1620 */
1621RTR0DECL(int) RTR0DbgKrnlInfoQuerySymbol(RTDBGKRNLINFO hKrnlInfo, const char *pszModule,
1622 const char *pszSymbol, void **ppvSymbol);
1623/** @} */
1624
1625/** @} */
1626
1627RT_C_DECLS_END
1628
1629#endif
1630
Note: See TracBrowser for help on using the repository browser.

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