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/kDbgLine.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 Line Number.
    5  *
    6  * Copyright (c) 2006 knut st. osmundsen <bird-src-spam@anduin.net.de>
    7  *
     3 * kDbg - The Debug Info Read, Line Numbers.
     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>
     31#include "kDbg.h"
     32#include "kDbgInternal.h"
    3433
    35 #include "dbg.h"
    36 #include "kDbgBase.h"
    3734
    3835
     
    4542 *
    4643 * @returns Pointer to the duplicate.
    47  *          This must be freed using RTDbgSymbolFree().
     44 *          This must be freed using kDbgSymbolFree().
    4845 * @param   pLine       The line number to be duplicated.
    4946 */
    50 RTDECL(PRTDBGLINE) RTDbgLineDup(PCRTDBGLINE pLine)
     47KDBG_DECL(PKDBGLINE) kDbgLineDup(PCKDBGLINE pLine)
    5148{
    52     AssertMsgReturn(VALID_PTR(pLine), ("%p\n", pLine), NULL);
    53     size_t cb = KDBG_OFFSETOF(RTDBGLINE, szFile[pLine->cchFile + 1]);
    54     return (PRTDBGLINE)RTMemDup(pLine, cb);
     49    kDbgAssertMsgReturn(KDBG_VALID_PTR(pLine), ("%p\n", pLine), NULL);
     50    size_t cb = KDBG_OFFSETOF(KDBGLINE, szFile[pLine->cchFile + 1]);
     51    return (PKDBGLINE)kDbgHlpAllocDup(pLine, cb);
    5552}
    5653
     
    5956 * Frees a line number obtained from the RTDbg API.
    6057 *
    61  * @returns VINF_SUCCESS on success.
    62  * @returns VERR_INVALID_POINTER if a NULL pointer or an !VALID_PTR() is passed in.
     58 * @returns 0 on success.
     59 * @returns KDBG_ERR_INVALID_POINTER if a NULL pointer or an !KDBG_VALID_PTR() is passed in.
    6360 *
    6461 * @param   pLine       The line number to be freed.
    6562 */
    66 RTDECL(int) RTDbgLineFree(PRTDBGLINE pLine)
     63KDBG_DECL(int) kDbgLineFree(PKDBGLINE pLine)
    6764{
    6865    if (!pLine)
    69         return VERR_INVALID_POINTER;
    70     AssertMsgReturn(VALID_PTR(pLine), ("%p\n", pLine), VERR_INVALID_POINTER);
     66        return KDBG_ERR_INVALID_POINTER;
     67    kDbgAssertMsgReturn(KDBG_VALID_PTR(pLine), ("%p\n", pLine), KDBG_ERR_INVALID_POINTER);
    7168
    72     RTMemFree(pLine);
    73     return VINF_SUCCESS;
     69    kDbgHlpFree(pLine);
     70    return 0;
    7471}
    7572
Note: See TracChangeset for help on using the changeset viewer.