Changeset 3528 for trunk/kDbg/kDbgSymbol.cpp
- Timestamp:
- Aug 20, 2007, 4:43:13 AM (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/kDbg/kDbgSymbol.cpp
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Id
r3526 r3528 1 /* $Id :$ */1 /* $Id$ */ 2 2 /** @file 3 * 4 * kProfile Mark 2 - Debug Info Symbol.5 * 6 * Copyright (c) 2006 knut st. osmundsen <bird-src-spam@anduin.net.de> 7 * 3 * kDbg - The Debug Info Reader, Symbols. 4 */ 5 6 /* 7 * Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net> 8 8 * 9 9 * This file is part of kLIBC. … … 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include <iprt/err.h> 32 #include <iprt/assert.h> 33 #include <iprt/alloc.h> 34 35 #include "kDbgBase.h" 36 #include "dbg.h" 31 #include "kDbg.h" 32 #include "kDbgInternal.h" 37 33 38 34 … … 45 41 * 46 42 * @returns Pointer to the duplicate. 47 * This must be freed using RTDbgSymbolFree().43 * This must be freed using kDbgSymbolFree(). 48 44 * @param pSymbol The symbol to be duplicated. 49 45 */ 50 RTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymbol)46 KDBG_DECL(PKDBGSYMBOL) kDbgSymbolDup(PCKDBGSYMBOL pSymbol) 51 47 { 52 AssertMsgReturn(VALID_PTR(pSymbol), ("%p\n", pSymbol), NULL);53 size_t cb = KDBG_OFFSETOF( RTDBGSYMBOL, szName[pSymbol->cchName + 1]);54 return (P RTDBGSYMBOL)RTMemDup(pSymbol, cb);48 kDbgAssertPtrReturn(pSymbol, NULL); 49 size_t cb = KDBG_OFFSETOF(KDBGSYMBOL, szName[pSymbol->cchName + 1]); 50 return (PKDBGSYMBOL)kDbgHlpAllocDup(pSymbol, cb); 55 51 } 56 52 … … 59 55 * Frees a symbol obtained from the RTDbg API. 60 56 * 61 * @returns VINF_SUCCESSon success.62 * @returns VERR_INVALID_POINTER if a NULL pointer or an !VALID_PTR() is passed in.57 * @returns 0 on success. 58 * @returns KDBG_ERR_INVALID_POINTER if a NULL pointer or an !KDBG_VALID_PTR() is passed in. 63 59 * 64 60 * @param pSymbol The symbol to be freed. 65 61 */ 66 RTDECL(int) RTDbgSymbolFree(PRTDBGSYMBOL pSymbol)62 KDBG_DECL(int) kDbgSymbolFree(PKDBGSYMBOL pSymbol) 67 63 { 68 64 if (!pSymbol) 69 return VERR_INVALID_POINTER;70 AssertMsgReturn(VALID_PTR(pSymbol), ("%p\n", pSymbol), VERR_INVALID_POINTER);65 return KDBG_ERR_INVALID_POINTER; 66 kDbgAssertPtrReturn(pSymbol, KDBG_ERR_INVALID_POINTER); 71 67 72 RTMemFree(pSymbol);73 return VINF_SUCCESS;68 kDbgHlpFree(pSymbol); 69 return 0; 74 70 } 75 71 -
Property svn:eol-style
set to
Note:
See TracChangeset
for help on using the changeset viewer.