Ignore:
Timestamp:
Aug 20, 2007, 4:43:13 AM (18 years ago)
Author:
bird
Message:

Some refactoring and OS abstraction by instroducing kDbgHlp.

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$ */
    22/** @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>
    88 *
    99 * This file is part of kLIBC.
     
    2929*   Header Files                                                               *
    3030*******************************************************************************/
    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"
    3733
    3834
     
    4541 *
    4642 * @returns Pointer to the duplicate.
    47  *          This must be freed using RTDbgSymbolFree().
     43 *          This must be freed using kDbgSymbolFree().
    4844 * @param   pSymbol     The symbol to be duplicated.
    4945 */
    50 RTDECL(PRTDBGSYMBOL) RTDbgSymbolDup(PCRTDBGSYMBOL pSymbol)
     46KDBG_DECL(PKDBGSYMBOL) kDbgSymbolDup(PCKDBGSYMBOL pSymbol)
    5147{
    52     AssertMsgReturn(VALID_PTR(pSymbol), ("%p\n", pSymbol), NULL);
    53     size_t cb = KDBG_OFFSETOF(RTDBGSYMBOL, szName[pSymbol->cchName + 1]);
    54     return (PRTDBGSYMBOL)RTMemDup(pSymbol, cb);
     48    kDbgAssertPtrReturn(pSymbol, NULL);
     49    size_t cb = KDBG_OFFSETOF(KDBGSYMBOL, szName[pSymbol->cchName + 1]);
     50    return (PKDBGSYMBOL)kDbgHlpAllocDup(pSymbol, cb);
    5551}
    5652
     
    5955 * Frees a symbol obtained from the RTDbg API.
    6056 *
    61  * @returns VINF_SUCCESS on 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.
    6359 *
    6460 * @param   pSymbol     The symbol to be freed.
    6561 */
    66 RTDECL(int) RTDbgSymbolFree(PRTDBGSYMBOL pSymbol)
     62KDBG_DECL(int) kDbgSymbolFree(PKDBGSYMBOL pSymbol)
    6763{
    6864    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);
    7167
    72     RTMemFree(pSymbol);
    73     return VINF_SUCCESS;
     68    kDbgHlpFree(pSymbol);
     69    return 0;
    7470}
    7571
Note: See TracChangeset for help on using the changeset viewer.