Changeset 19559 in vbox
- Timestamp:
- May 10, 2009 4:36:23 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 47114
- Location:
- trunk
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/avl.h
r19544 r19559 610 610 611 611 612 /** AVL tree of RTUINTPTR ranges. 613 * @{ 614 */ 615 616 /** 617 * AVL Core node. 618 */ 619 typedef struct _AVLRUIntPtrNodeCore 620 { 621 /** First key value in the range (inclusive). */ 622 RTUINTPTR Key; 623 /** Last key value in the range (inclusive). */ 624 RTUINTPTR KeyLast; 625 /** Offset to the left leaf node, relative to this field. */ 626 struct _AVLRUIntPtrNodeCore *pLeft; 627 /** Offset to the right leaf node, relative to this field. */ 628 struct _AVLRUIntPtrNodeCore *pRight; 629 /** Height of this tree: max(height(left), height(right)) + 1 */ 630 unsigned char uchHeight; 631 } AVLRUINTPTRNODECORE, *PAVLRUINTPTRNODECORE; 632 633 /** A offset base tree with RTUINTPTR keys. */ 634 typedef PAVLRUINTPTRNODECORE AVLRUINTPTRTREE; 635 /** Pointer to a offset base tree with RTUINTPTR keys. */ 636 typedef AVLRUINTPTRTREE *PAVLRUINTPTRTREE; 637 638 /** Pointer to an internal tree pointer. 639 * In this case it's a pointer to a relative offset. */ 640 typedef AVLRUINTPTRTREE *PPAVLRUINTPTRNODECORE; 641 642 /** Callback function for RTAvlrUIntPtrDoWithAll() and RTAvlrUIntPtrDestroy(). */ 643 typedef DECLCALLBACK(int) AVLRUINTPTRCALLBACK(PAVLRUINTPTRNODECORE pNode, void *pvUser); 644 /** Pointer to callback function for RTAvlrUIntPtrDoWithAll() and RTAvlrUIntPtrDestroy(). */ 645 typedef AVLRUINTPTRCALLBACK *PAVLRUINTPTRCALLBACK; 646 647 RTDECL(bool) RTAvlrUIntPtrInsert( PAVLRUINTPTRTREE pTree, PAVLRUINTPTRNODECORE pNode); 648 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrRemove( PAVLRUINTPTRTREE pTree, RTUINTPTR Key); 649 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrGet( PAVLRUINTPTRTREE pTree, RTUINTPTR Key); 650 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrGetBestFit( PAVLRUINTPTRTREE pTree, RTUINTPTR Key, bool fAbove); 651 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrRangeGet( PAVLRUINTPTRTREE pTree, RTUINTPTR Key); 652 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrRangeRemove(PAVLRUINTPTRTREE pTree, RTUINTPTR Key); 653 RTDECL(int) RTAvlrUIntPtrDoWithAll( PAVLRUINTPTRTREE pTree, int fFromLeft, PAVLRUINTPTRCALLBACK pfnCallBack, void *pvParam); 654 RTDECL(int) RTAvlrUIntPtrDestroy( PAVLRUINTPTRTREE pTree, PAVLRUINTPTRCALLBACK pfnCallBack, void *pvParam); 655 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrGetRoot( PAVLRUINTPTRTREE pTree); 656 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrGetLeft( PAVLRUINTPTRNODECORE pNode); 657 RTDECL(PAVLRUINTPTRNODECORE) RTAvlrUIntPtrGetRight( PAVLRUINTPTRNODECORE pNode); 658 659 /** @} */ 660 661 612 662 /** AVL tree of RTHCPHYSes - using relative offsets internally. 613 663 * @{ -
trunk/include/iprt/dbg.h
r19509 r19559 103 103 * @{ 104 104 */ 105 RTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, const char *pszName, RTUINTPTR FirstAddr, RTUINTPTR LastAddr); 106 RTDECL(int) RTDbgAsDestroy(PRTDBGAS phDbgAs); 107 108 RTDECL(int) RTDbgAsModuleLink(PRTDBGAS phDbgAs, RTDBGMOD hDbgMod, RTUINTPTR ImageAddr); 109 RTDECL(int) RTDbgAsModuleLinkSeg(PRTDBGAS phDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr); 110 RTDECL(int) RTDbgAsModuleUnlink(PRTDBGAS phDbgAs, RTDBGMOD hDbgMod); 111 RTDECL(int) RTDbgAsModuleUnlinkByAddr(PRTDBGAS phDbgAs, RTUINTPTR ImageAddr); 112 RTDECL(uint32_t) RTDbgAsModuleCount(PRTDBGAS phDbgAs); 113 RTDECL(RTDBGMOD) RTDbgAsModuleByIndex(PRTDBGAS phDbgAs, uint32_t iModule); 114 RTDECL(RTDBGMOD) RTDbgAsModuleByName(PRTDBGAS phDbgAs, RTUINTPTR Addr); 115 RTDECL(RTDBGMOD) RTDbgAsModuleByAddr(PRTDBGAS phDbgAs, const char *pszName); 116 117 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, uint32_t cb); 118 RTDECL(int) RTDbgAsSymbolByName(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol); 119 RTDECL(int) RTDbgAsSymbolByNameA(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol); 105 106 /** 107 * Creates an empty address space. 108 * 109 * @returns IPRT status code. 110 * 111 * @param phDbgAs Where to store the address space handle on success. 112 * @param FirstAddr The first address in the address space. 113 * @param LastAddr The last address in the address space. 114 * @param pszName The name of the address space. 115 */ 116 RTDECL(int) RTDbgAsCreate(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszName); 117 118 /** 119 * Variant of RTDbgAsCreate that takes a name format string. 120 * 121 * @returns IPRT status code. 122 * 123 * @param phDbgAs Where to store the address space handle on success. 124 * @param FirstAddr The first address in the address space. 125 * @param LastAddr The last address in the address space. 126 * @param pszNameFmt The name format of the address space. 127 * @param va Format arguments. 128 */ 129 RTDECL(int) RTDbgAsCreateV(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, va_list va); 130 131 /** 132 * Variant of RTDbgAsCreate that takes a name format string. 133 * 134 * @returns IPRT status code. 135 * 136 * @param phDbgAs Where to store the address space handle on success. 137 * @param FirstAddr The first address in the address space. 138 * @param LastAddr The last address in the address space. 139 * @param pszNameFmt The name format of the address space. 140 * @param ... Format arguments. 141 */ 142 RTDECL(int) RTDbgAsCreateF(PRTDBGAS phDbgAs, RTUINTPTR FirstAddr, RTUINTPTR LastAddr, const char *pszNameFmt, ...); 143 144 /** 145 * Destroys the address space. 146 * 147 * This means unlinking all the modules it currently contains, potentially 148 * causing some or all of them to be destroyed as they are managed by 149 * reference counting. 150 * 151 * @returns IPRT status code. 152 * 153 * @param hDbgAs The address space handle. A NIL handle will 154 * be quietly ignored. 155 */ 156 RTDECL(int) RTDbgAsDestroy(RTDBGAS hDbgAs); 157 158 /** 159 * Gets the name of an address space. 160 * 161 * @returns read only address space name. 162 * NULL if hDbgAs is invalid. 163 * 164 * @param hDbgAs The address space handle. 165 */ 166 RTDECL(const char *) RTDbgAsName(RTDBGAS hDbgAs); 167 168 /** 169 * Gets the first address in an address space. 170 * 171 * @returns The address. 172 * 0 if hDbgAs is invalid. 173 * 174 * @param hDbgAs The address space handle. 175 */ 176 RTDECL(RTUINTPTR) RTDbgAsFirstAddr(RTDBGAS hDbgAs); 177 178 /** 179 * Gets the last address in an address space. 180 * 181 * @returns The address. 182 * 0 if hDbgAs is invalid. 183 * 184 * @param hDbgAs The address space handle. 185 */ 186 RTDECL(RTUINTPTR) RTDbgAsLastAddr(RTDBGAS hDbgAs); 187 188 /** 189 * Gets the number of modules in the address space. 190 * 191 * This can be used together with RTDbgAsModuleByIndex 192 * to enumerate the modules. 193 * 194 * @returns The number of modules. 195 * 196 * @param hDbgAs The address space handle. 197 */ 198 RTDECL(uint32_t) RTDbgAsModuleCount(RTDBGAS hDbgAs); 199 200 /** 201 * Links a module into the address space at the give address. 202 * 203 * The size of the mapping is determined using RTDbgModImageSize(). 204 * 205 * @returns IPRT status code. 206 * @retval VERR_OUT_OF_RANGE if the specified address will put the module 207 * outside the address space. 208 * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings. 209 * 210 * @param hDbgAs The address space handle. 211 * @param hDbgMod The module handle of the module to be linked in. 212 * @param ImageAddr The address to link the module at. 213 */ 214 RTDECL(int) RTDbgAsModuleLink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTUINTPTR ImageAddr); 215 216 /** 217 * Links a segment into the address space at the give address. 218 * 219 * The size of the mapping is determined using RTDbgModSegmentSize(). 220 * 221 * @returns IPRT status code. 222 * @retval VERR_OUT_OF_RANGE if the specified address will put the module 223 * outside the address space. 224 * @retval VERR_ADDRESS_CONFLICT if the mapping clashes with existing mappings. 225 * 226 * @param hDbgAs The address space handle. 227 * @param hDbgMod The module handle. 228 * @param iSeg The segment number (0-based) of the segment to be 229 * linked in. 230 * @param SegAddr The address to link the segment at. 231 */ 232 RTDECL(int) RTDbgAsModuleLinkSeg(RTDBGAS hDbgAs, RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR SegAddr); 233 234 /** 235 * Unlinks all the mappings of a module from the address space. 236 * 237 * @returns IPRT status code. 238 * @retval VERR_NOT_FOUND if the module wasn't found. 239 * 240 * @param hDbgAs The address space handle. 241 * @param hDbgMod The module handle of the module to be unlinked. 242 */ 243 RTDECL(int) RTDbgAsModuleUnlink(RTDBGAS hDbgAs, RTDBGMOD hDbgMod); 244 245 /** 246 * Unlinks the mapping at the specified address. 247 * 248 * @returns IPRT status code. 249 * @retval VERR_NOT_FOUND if no module or segment is mapped at that address. 250 * 251 * @param hDbgAs The address space handle. 252 * @param Addr The address within the mapping to be unlinked. 253 */ 254 RTDECL(int) RTDbgAsModuleUnlinkByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr); 255 256 /** 257 * Get a the handle of a module in the address space by is index. 258 * 259 * @returns A retained handle to the specified module. The caller must release 260 * the returned reference. 261 * NIL_RTDBGMOD if invalid index or handle. 262 * 263 * @param hDbgAs The address space handle. 264 * @param iModule The index of the module to get. 265 * 266 * @remarks The module indexes may change after calls to RTDbgAsModuleLink, 267 * RTDbgAsModuleLinkSeg, RTDbgAsModuleUnlink and 268 * RTDbgAsModuleUnlinkByAddr. 269 */ 270 RTDECL(RTDBGMOD) RTDbgAsModuleByIndex(RTDBGAS hDbgAs, uint32_t iModule); 271 272 /** 273 * Queries mapping module information by handle. 274 * 275 * @returns IPRT status code. 276 * @retval VERR_NOT_FOUND if no mapping was found at the specified address. 277 * 278 * @param hDbgAs The address space handle. 279 * @param Addr Address within the mapping of the module or segment. 280 * @param phMod Where to the return the retained module handle. 281 * Optional. 282 * @param pAddr Where to return the base address of the mapping. 283 * Optional. 284 * @param piSeg Where to return the segment index. This is set to 285 * NIL if the entire module is mapped as a single 286 * mapping. Optional. 287 */ 288 RTDECL(int) RTDbgAsModuleByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTDBGMOD phMod, PRTUINTPTR pAddr, PRTDBGSEGIDX piSeg); 289 290 /** 291 * Queries mapping module information by name. 292 * 293 * @returns IPRT status code. 294 * @retval VERR_NOT_FOUND if no mapping was found at the specified address. 295 * @retval VERR_OUT_OF_RANGE if the name index was out of range. 296 * 297 * @param hDbgAs The address space handle. 298 * @param pszName The module name. 299 * @param iName There can be more than one module by the same name 300 * in an address space. This argument indicates which 301 * is ment. (0 based) 302 * @param phMod Where to the return the retained module handle. 303 */ 304 RTDECL(int) RTDbgAsModuleByName(RTDBGAS hDbgAs, const char *pszName, uint32_t iName, PRTDBGMOD phMod); 305 306 /** 307 * Adds a symbol to a module in the address space. 308 * 309 * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones. 310 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. 311 * @retval VERR_NOT_FOUND if no module was found at the specified address. 312 * 313 * @param hDbgAs The address space handle. 314 * @param pszSymbol The symbol name. 315 * @param Addr The address of the symbol. 316 * @param cb The size of the symbol. 317 */ 318 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, uint32_t cb); 319 320 /** 321 * Query a symbol by address. 322 * 323 * @returns IPRT status code. See RTDbgModSymbolAddr for more specific ones. 324 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. 325 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. 326 * 327 * @param hDbgAs The address space handle. 328 * @param Addr The address which closest symbol is requested. 329 * @param poffDisp Where to return the distance between the symbol 330 * and address. Optional. 331 * @param pSymbol Where to return the symbol info. 332 */ 333 RTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol); 334 335 /** 336 * Query a symbol by address. 337 * 338 * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones. 339 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. 340 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. 341 * 342 * @param hDbgAs The address space handle. 343 * @param Addr The address which closest symbol is requested. 344 * @param poffDisp Where to return the distance between the symbol 345 * and address. Optional. 346 * @param ppSymbol Where to return the pointer to the allocated 347 * symbol info. Always set. Free with RTDbgSymbolFree. 348 */ 349 RTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymbol); 350 351 /** 352 * Query a symbol by name. 353 * 354 * @returns IPRT status code. 355 * @retval VERR_SYMBOL_NOT_FOUND if not found. 356 * 357 * @param hDbgAs The address space handle. 358 * @param pszSymbol The symbol name. 359 * @param pSymbol Where to return the symbol info. 360 */ 361 RTDECL(int) RTDbgAsSymbolByName(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol); 362 363 /** 364 * Query a symbol by name. 365 * 366 * @returns IPRT status code. 367 * @retval VERR_SYMBOL_NOT_FOUND if not found. 368 * 369 * @param hDbgAs The address space handle. 370 * @param pszSymbol The symbol name. 371 * @param ppSymbol Where to return the pointer to the allocated 372 * symbol info. Always set. Free with RTDbgSymbolFree. 373 */ 374 RTDECL(int) RTDbgAsSymbolByNameA(RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol); 375 376 /** 377 * Query a line number by address. 378 * 379 * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones. 380 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. 381 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. 382 * 383 * @param hDbgAs The address space handle. 384 * @param Addr The address which closest symbol is requested. 385 * @param poffDisp Where to return the distance between the line 386 * number and address. 387 * @param pLine Where to return the line number information. 388 */ 389 RTDECL(int) RTDbgAs(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine); 390 391 /** 392 * Query a line number by address. 393 * 394 * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones. 395 * @retval VERR_INVALID_HANDLE if hDbgAs is invalid. 396 * @retval VERR_NOT_FOUND if the address couldn't be mapped to a module. 397 * 398 * @param hDbgAs The address space handle. 399 * @param Addr The address which closest symbol is requested. 400 * @param poffDisp Where to return the distance between the line 401 * number and address. 402 * @param ppLine Where to return the pointer to the allocated line 403 * number info. Always set. Free with RTDbgLineFree. 404 */ 405 RTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine); 406 407 /** @todo Missing some bits here. */ 408 120 409 /** @} */ 121 410 122 411 123 /** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interp erter412 /** @defgroup grp_rt_dbgmod RTDbgMod - Debug Module Interpreter 124 413 * @{ 125 414 */ 126 415 RTDECL(int) RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, const char *pszImgFile, const char *pszDbgFile); 127 416 RTDECL(int) RTDbgModDestroy(RTDBGMOD hDbgMod); 128 RTDECL(int) RTDbgModRetain(RTDBGMOD hDbgMod); 129 RTDECL(int) RTDbgModRelease(RTDBGMOD hDbgMod); 417 RTDECL(uint32_t) RTDbgModRetain(RTDBGMOD hDbgMod); 418 RTDECL(uint32_t) RTDbgModRelease(RTDBGMOD hDbgMod); 419 RTDECL(const char *) RTDbgModName(RTDBGMOD hDbgMod); 420 RTDECL(RTUINTPTR) RTDbgModImageSize(RTDBGMOD hDbgMod); 421 RTDECL(RTUINTPTR) RTDbgModSegmentSize(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg); 422 RTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod); 130 423 131 424 RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t cb); -
trunk/include/iprt/types.h
r19509 r19559 1195 1195 typedef RTDBGAS *PRTDBGAS; 1196 1196 /** NIL debug address space handle. */ 1197 #define NIL_RTDBGAS (( PRTDBGAS)0)1197 #define NIL_RTDBGAS ((RTDBGAS)0) 1198 1198 1199 1199 /** Debug module handle. */ … … 1202 1202 typedef RTDBGMOD *PRTDBGMOD; 1203 1203 /** NIL debug module handle. */ 1204 #define NIL_RTDBGMOD (( PRTDBGMOD)0)1204 #define NIL_RTDBGMOD ((RTDBGMOD)0) 1205 1205 1206 1206 -
trunk/src/VBox/Runtime/Makefile.kmk
r19558 r19559 197 197 common/checksum/md5.cpp \ 198 198 common/checksum/ipv4.cpp \ 199 common/dbg/dbgas.cpp \ 200 common/dbg/dbgmod.cpp \ 199 201 common/err/errmsg.cpp \ 200 202 common/err/RTErrConvertFromErrno.cpp \ … … 260 262 common/table/avlroioport.cpp \ 261 263 common/table/avlroogcptr.cpp \ 264 common/table/avlruintptr.cpp \ 262 265 common/table/avlu32.cpp \ 263 266 common/table/avlul.cpp \ -
trunk/src/VBox/Runtime/common/table/avlruintptr.cpp
r19557 r19559 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - AVL tree, RT GCPTR, range, unique keys.3 * IPRT - AVL tree, RTUINTPTR, range, unique keys. 4 4 */ 5 5 … … 39 39 * AVL configuration. 40 40 */ 41 #define KAVL_FN(a) RTAvlr GCPtr##a41 #define KAVL_FN(a) RTAvlrUIntPtr##a 42 42 #define KAVL_MAX_STACK 27 /* Up to 2^24 nodes. */ 43 43 #define KAVL_CHECK_FOR_EQUAL_INSERT 1 /* No duplicate keys! */ 44 #define KAVLNODECORE AVLR GCPTRNODECORE45 #define PKAVLNODECORE PAVLR GCPTRNODECORE46 #define PPKAVLNODECORE PPAVLR GCPTRNODECORE47 #define KAVLKEY RT GCPTR48 #define PKAVLKEY PRT GCPTR49 #define KAVLENUMDATA AVLR GCPTRENUMDATA50 #define PKAVLENUMDATA PAVLR GCPTRENUMDATA51 #define PKAVLCALLBACK PAVLR GCPTRCALLBACK44 #define KAVLNODECORE AVLRUINTPTRNODECORE 45 #define PKAVLNODECORE PAVLRUINTPTRNODECORE 46 #define PPKAVLNODECORE PPAVLRUINTPTRNODECORE 47 #define KAVLKEY RTUINTPTR 48 #define PKAVLKEY PRTUINTPTR 49 #define KAVLENUMDATA AVLRUINTPTRENUMDATA 50 #define PKAVLENUMDATA PAVLRUINTPTRENUMDATA 51 #define PKAVLCALLBACK PAVLRUINTPTRCALLBACK 52 52 #define KAVL_RANGE 1 53 53 -
trunk/src/VBox/Runtime/include/internal/dbgmod.h
r19509 r19559 211 211 * Debug module structure. 212 212 */ 213 typedef struct RTDBGMOD 213 typedef struct RTDBGMODINT 214 214 { 215 215 /** Magic value (RTDBGMOD_MAGIC). */
Note:
See TracChangeset
for help on using the changeset viewer.