Changeset 20740 in vbox for trunk/include
- Timestamp:
- Jun 21, 2009 2:09:28 AM (16 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/avl.h
r20374 r20740 615 615 616 616 617 /** AVL tree of RTUINTPTR. 618 * @{ 619 */ 620 621 /** 622 * AVL RTUINTPTR node core. 623 */ 624 typedef struct _AVLUIntPtrNodeCore 625 { 626 /** Key value. */ 627 RTUINTPTR Key; 628 /** Offset to the left leaf node, relative to this field. */ 629 struct _AVLUIntPtrNodeCore *pLeft; 630 /** Offset to the right leaf node, relative to this field. */ 631 struct _AVLUIntPtrNodeCore *pRight; 632 /** Height of this tree: max(height(left), height(right)) + 1 */ 633 unsigned char uchHeight; 634 } AVLUINTPTRNODECORE; 635 /** Pointer to a RTUINTPTR AVL node core.*/ 636 typedef AVLUINTPTRNODECORE *PAVLUINTPTRNODECORE; 637 638 /** A pointer based tree with RTUINTPTR keys. */ 639 typedef PAVLUINTPTRNODECORE AVLUINTPTRTREE; 640 /** Pointer to a offset base tree with RTUINTPTR keys. */ 641 typedef AVLUINTPTRTREE *PAVLUINTPTRTREE; 642 643 /** Pointer to an internal tree pointer. 644 * In this case it's a pointer to a pointer. */ 645 typedef AVLUINTPTRTREE *PPAVLUINTPTRNODECORE; 646 647 /** Callback function for RTAvlUIntPtrDoWithAll() and RTAvlUIntPtrDestroy(). */ 648 typedef DECLCALLBACK(int) AVLUINTPTRCALLBACK(PAVLUINTPTRNODECORE pNode, void *pvUser); 649 /** Pointer to callback function for RTAvlUIntPtrDoWithAll() and RTAvlUIntPtrDestroy(). */ 650 typedef AVLUINTPTRCALLBACK *PAVLUINTPTRCALLBACK; 651 652 RTDECL(bool) RTAvlUIntPtrInsert( PAVLUINTPTRTREE pTree, PAVLUINTPTRNODECORE pNode); 653 RTDECL(PAVLUINTPTRNODECORE) RTAvlUIntPtrRemove( PAVLUINTPTRTREE pTree, RTUINTPTR Key); 654 RTDECL(PAVLUINTPTRNODECORE) RTAvlUIntPtrGet( PAVLUINTPTRTREE pTree, RTUINTPTR Key); 655 RTDECL(PAVLUINTPTRNODECORE) RTAvlUIntPtrGetBestFit(PAVLUINTPTRTREE pTree, RTUINTPTR Key, bool fAbove); 656 RTDECL(int) RTAvlUIntPtrDoWithAll( PAVLUINTPTRTREE pTree, int fFromLeft, PAVLUINTPTRCALLBACK pfnCallBack, void *pvParam); 657 RTDECL(int) RTAvlUIntPtrDestroy( PAVLUINTPTRTREE pTree, PAVLUINTPTRCALLBACK pfnCallBack, void *pvParam); 658 RTDECL(PAVLUINTPTRNODECORE) RTAvlUIntPtrGetRoot( PAVLUINTPTRTREE pTree); 659 RTDECL(PAVLUINTPTRNODECORE) RTAvlUIntPtrGetLeft( PAVLUINTPTRNODECORE pNode); 660 RTDECL(PAVLUINTPTRNODECORE) RTAvlUIntPtrGetRight( PAVLUINTPTRNODECORE pNode); 661 662 /** @} */ 663 664 617 665 /** AVL tree of RTUINTPTR ranges. 618 666 * @{ … … 620 668 621 669 /** 622 * AVL Core node.670 * AVL RTUINTPTR range node core. 623 671 */ 624 672 typedef struct _AVLRUIntPtrNodeCore 625 673 { 626 674 /** First key value in the range (inclusive). */ 627 RTUINTPTR Key;675 RTUINTPTR Key; 628 676 /** Last key value in the range (inclusive). */ 629 RTUINTPTR KeyLast; 630 /** Offset to the left leaf node, relative to this field. */ 631 struct _AVLRUIntPtrNodeCore *pLeft; 632 /** Offset to the right leaf node, relative to this field. */ 633 struct _AVLRUIntPtrNodeCore *pRight; 634 /** Height of this tree: max(height(left), height(right)) + 1 */ 635 unsigned char uchHeight; 636 } AVLRUINTPTRNODECORE, *PAVLRUINTPTRNODECORE; 637 638 /** A offset base tree with RTUINTPTR keys. */ 677 RTUINTPTR KeyLast; 678 /** Offset to the left leaf node, relative to this field. */ 679 struct _AVLRUIntPtrNodeCore *pLeft; 680 /** Offset to the right leaf node, relative to this field. */ 681 struct _AVLRUIntPtrNodeCore *pRight; 682 /** Height of this tree: max(height(left), height(right)) + 1 */ 683 unsigned char uchHeight; 684 } AVLRUINTPTRNODECORE; 685 /** Pointer to an AVL RTUINTPTR range node code. */ 686 typedef AVLRUINTPTRNODECORE *PAVLRUINTPTRNODECORE; 687 688 /** A pointer based tree with RTUINTPTR ranges. */ 639 689 typedef PAVLRUINTPTRNODECORE AVLRUINTPTRTREE; 640 /** Pointer to a offset base tree with RTUINTPTR keys. */690 /** Pointer to a pointer based tree with RTUINTPTR ranges. */ 641 691 typedef AVLRUINTPTRTREE *PAVLRUINTPTRTREE; 642 692 643 693 /** Pointer to an internal tree pointer. 644 * In this case it's a pointer to a relative offset. */694 * In this case it's a pointer to a pointer. */ 645 695 typedef AVLRUINTPTRTREE *PPAVLRUINTPTRNODECORE; 646 696 -
trunk/include/iprt/dbg.h
r20738 r20740 71 71 typedef struct RTDBGSYMBOL 72 72 { 73 /** Symbol value (address). */ 73 /** Symbol value (address). 74 * This depends a bit who you ask. It will be the same as offSeg when you 75 * as RTDbgMod, but the mapping address if you ask RTDbgAs. */ 74 76 RTUINTPTR Value; 75 /** Segment number when applicable or NIL_RTDBGSEGIDX. */ 77 /** Offset into the segment specified by iSeg. */ 78 RTUINTPTR offSeg; 79 /** Segment number. */ 76 80 RTDBGSEGIDX iSeg; 77 81 /** Symbol size. */ … … 87 91 typedef const RTDBGSYMBOL *PCRTDBGSYMBOL; 88 92 93 /** 94 * Allocate a new symbol structure. 95 * 96 * @returns Pointer to a new structure on success, NULL on failure. 97 */ 89 98 RTDECL(PRTDBGSYMBOL) RTDbgSymbolAlloc(void); 99 100 /** 101 * Duplicates a symbol structure. 102 * 103 * @returns Pointer to duplicate on success, NULL on failure. 104 * 105 * @param pSymbol The symbol to duplicate. 106 */ 90 107 RTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymbol); 91 RTDECL(void) RTDbgSymbolFree(PRTDBGSYMBOL pSymbol); 108 109 /** 110 * Free a symbol structure previously allocated by a RTDbg method. 111 * 112 * @param pSymbol The symbol to free. NULL is ignored. 113 */ 114 RTDECL(void) RTDbgSymbolFree(PRTDBGSYMBOL pSymbol); 115 116 117 /** Max length (including '\\0') of a debug info file name. */ 118 #define RTDBG_FILE_NAME_LENGTH (260) 92 119 93 120 … … 97 124 typedef struct RTDBGLINE 98 125 { 99 /** Address. */ 126 /** Address. 127 * This depends a bit who you ask. It will be the same as offSeg when you 128 * as RTDbgMod, but the mapping address if you ask RTDbgAs. */ 100 129 RTUINTPTR Address; 101 /** Segment number when applicable or NIL_RTDBGSEGIDX. */ 130 /** Offset into the segment specified by iSeg. */ 131 RTUINTPTR offSeg; 132 /** Segment number. */ 102 133 RTDBGSEGIDX iSeg; 103 134 /** Line number. */ 104 135 uint32_t uLineNo; 105 136 /** Filename. */ 106 char szFilename[ 260];137 char szFilename[RTDBG_FILE_NAME_LENGTH]; 107 138 } RTDBGLINE; 108 139 /** Pointer to debug line number. */ … … 360 391 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. 361 392 * @retval VERR_NOT_FOUND if no module was found at the specified address. 393 * @retval VERR_NOT_SUPPORTED if the module interpret doesn't support adding 394 * custom symbols. 362 395 * 363 396 * @param hDbgAs The address space handle. … … 365 398 * @param Addr The address of the symbol. 366 399 * @param cb The size of the symbol. 367 */ 368 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, uint32_t cb); 400 * @param fFlags Symbol flags. 401 */ 402 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags); 369 403 370 404 /** … … 472 506 RTDECL(RTUINTPTR) RTDbgModImageSize(RTDBGMOD hDbgMod); 473 507 RTDECL(RTUINTPTR) RTDbgModSegmentSize(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg); 508 RTDECL(RTUINTPTR) RTDbgModSegmentRva(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg); 474 509 RTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod); 475 510 476 RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t cb);511 RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags); 477 512 RTDECL(uint32_t) RTDbgModSymbolCount(RTDBGMOD hDbgMod); 478 513 RTDECL(int) RTDbgModSymbolByIndex(RTDBGMOD hDbgMod, uint32_t iSymbol, PRTDBGSYMBOL pSymbol); … … 482 517 RTDECL(int) RTDbgModSymbolByNameA(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol); 483 518 519 RTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off); 484 520 RTDECL(int) RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLine); 485 521 RTDECL(int) RTDbgModLineByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE *ppLine); -
trunk/include/iprt/err.h
r20739 r20740 946 946 /** Invalid segment offset. */ 947 947 #define VERR_DBG_INVALID_SEGMENT_OFFSET (-652) 948 /** Invalid image relative virtual address. */ 949 #define VERR_DBG_INVALID_RVA (-653) 948 950 /** The module contains no line number information. */ 949 #define VERR_DBG_NO_LINE_NUMBERS (-653) 951 #define VERR_DBG_NO_LINE_NUMBERS (-654) 952 /** Address conflict within a module/segment. 953 * Attempted to add a symbol or line number that fully or partially overlaps with an existing one. */ 954 #define VERR_DBG_ADDRESS_CONFLICT (-655) 955 /** Duplicate symbol within the module. 956 * Attempted to add a symbol which name already exists within the module. */ 957 #define VERR_DBG_DUPLICATE_SYMBOL (-656) 958 /** The length of the symbol name is out of range. 959 * This means it is an empty string or that it's greater or equal to 960 * RTDBG_SYMBOL_NAME_LENGTH. */ 961 #define VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE (-657) 962 /** The length of the file name is out of range. 963 * This means it is an empty string or that it's greater or equal to 964 * RTDBG_FILE_NAME_LENGTH. */ 965 #define VERR_DBG_FILE_NAME_OUT_OF_RANGE (-658) 950 966 /** @} */ 951 967 -
trunk/include/iprt/types.h
r20360 r20740 388 388 /** Pointer const to unsigned integer which can contain both GC and HC pointers. */ 389 389 typedef const RTUINTPTR *PCRTUINTPTR; 390 /** The maximum value the RTUINTPTR type can hold. */ 391 #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32) 392 # define RTUINTPTR_MAX UINT32_MAX 393 #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64) 394 # define RTUINTPTR_MAX UINT64_MAX 395 #else 396 # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values. 397 #endif 390 398 391 399 /** Signed integer. */
Note:
See TracChangeset
for help on using the changeset viewer.