Changeset 3550 for trunk/kStuff/kDbg/kDbgSymbol.cpp
- Timestamp:
- Aug 26, 2007, 3:13:35 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kStuff/kDbg/kDbgSymbol.cpp
r3541 r3550 7 7 * Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net> 8 8 * 9 * This file is part of k LIBC.9 * This file is part of kStuff. 10 10 * 11 * k LIBC is free software; you can redistribute it and/or modify12 * it under the terms of the GNU General Public License as published by13 * the Free Software Foundation; either version 2 of the License, or14 * (at your option) any later version.11 * kStuff is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2.1 of the License, or (at your option) any later version. 15 15 * 16 * k LIBCis distributed in the hope that it will be useful,16 * kStuff is distributed in the hope that it will be useful, 17 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNUGeneral Public License for more details.18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Lesser General Public License for more details. 20 20 * 21 * You should have received a copy of the GNU General Public License22 * along with kLIBC; if not, write to the Free Software23 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307USA21 * You should have received a copy of the GNU Lesser General Public 22 * License along with kStuff; if not, write to the Free Software 23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 24 * 25 25 */ 26 27 26 28 27 /******************************************************************************* 29 28 * Header Files * 30 29 *******************************************************************************/ 31 #include "kDbg.h"32 30 #include "kDbgInternal.h" 31 #include <k/kHlpAlloc.h> 33 32 34 33 … … 47 46 { 48 47 kDbgAssertPtrReturn(pSymbol, NULL); 49 size_t cb = KDBG_OFFSETOF(KDBGSYMBOL, szName[pSymbol->cchName + 1]); 50 return (PKDBGSYMBOL)kDbgHlpAllocDup(pSymbol, cb); 48 KSIZE cb = K_OFFSETOF(KDBGSYMBOL, szName[pSymbol->cchName + 1]); 49 PKDBGSYMBOL pNewSymbol = (PKDBGSYMBOL)kHlpDup(pSymbol, cb); 50 if (pNewSymbol) 51 pNewSymbol->cbSelf = cb; 52 return pNewSymbol; 51 53 } 52 54 53 55 54 56 /** 55 * Frees a symbol obtained from the RTDbg API.57 * Frees a symbol obtained from the kDbg API. 56 58 * 57 59 * @returns 0 on success. 58 * @returns KERR_INVALID_POINTER if a NULL pointer or an !KDBG_VALID_PTR() is passed in.60 * @returns KERR_INVALID_POINTER if pSymbol isn't a valid pointer. 59 61 * 60 * @param pSymbol The symbol to be freed. 62 * @param pSymbol The symbol to be freed. The null pointer is ignored. 61 63 */ 62 64 KDBG_DECL(int) kDbgSymbolFree(PKDBGSYMBOL pSymbol) 63 65 { 64 66 if (!pSymbol) 65 return KERR_INVALID_POINTER; 66 kDbgAssertPtrReturn(pSymbol, KERR_INVALID_POINTER); 67 68 kDbgHlpFree(pSymbol); 67 { 68 kDbgAssertPtrReturn(pSymbol, KERR_INVALID_POINTER); 69 pSymbol->cbSelf = 0; 70 kHlpFree(pSymbol); 71 } 69 72 return 0; 70 73 }
Note:
See TracChangeset
for help on using the changeset viewer.