Ignore:
Timestamp:
Aug 26, 2007, 3:13:35 AM (18 years ago)
Author:
bird
Message:

made kDbg compile again (not linking yet though).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kStuff/kDbg/kDbgSymbol.cpp

    r3541 r3550  
    77 * Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net>
    88 *
    9  * This file is part of kLIBC.
     9 * This file is part of kStuff.
    1010 *
    11  * kLIBC is free software; you can redistribute it and/or modify
    12  * it under the terms of the GNU General Public License as published by
    13  * the Free Software Foundation; either version 2 of the License, or
    14  * (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.
    1515 *
    16  * kLIBC is distributed in the hope that it will be useful,
     16 * kStuff is distributed in the hope that it will be useful,
    1717 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19  * GNU General Public License for more details.
     18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     19 * Lesser General Public License for more details.
    2020 *
    21  * You should have received a copy of the GNU General Public License
    22  * along with kLIBC; if not, write to the Free Software
    23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     21 * 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
    2424 *
    2525 */
    26 
    2726
    2827/*******************************************************************************
    2928*   Header Files                                                               *
    3029*******************************************************************************/
    31 #include "kDbg.h"
    3230#include "kDbgInternal.h"
     31#include <k/kHlpAlloc.h>
    3332
    3433
     
    4746{
    4847    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;
    5153}
    5254
    5355
    5456/**
    55  * Frees a symbol obtained from the RTDbg API.
     57 * Frees a symbol obtained from the kDbg API.
    5658 *
    5759 * @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.
    5961 *
    60  * @param   pSymbol     The symbol to be freed.
     62 * @param   pSymbol     The symbol to be freed. The null pointer is ignored.
    6163 */
    6264KDBG_DECL(int) kDbgSymbolFree(PKDBGSYMBOL pSymbol)
    6365{
    6466    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    }
    6972    return 0;
    7073}
Note: See TracChangeset for help on using the changeset viewer.