⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plx_aldbg.c

📁 mtk wap和mms代码。。适应mtk 25。26平台
💻 C
字号:
/***************************************************************************
 *
 *                      Pollex Mobile Platform
 *
 * Copyright (c) 2004 by Pollex Mobile Software Co., Ltd. 
 *                       All Rights Reserved 
 *
 * Module   : Pollex OS Adaptation Layer.
 *
 * Purpose  : Implements Pollex OS Adaptation Layer debug functions.
 *            
\**************************************************************************/

#include "plxclib.h"

extern  int PlxWriteToDebugFile(void *mem, const char *act, const char *file, int line);
void PlxTrace(const char* fmt, ...);


//#define   PLX_DEBUGTOFILE  
/***************************************************************************
**  Function : PlxMallocD
**  Purpose  :
**  Params   :
**  Return   :
**  Remarks  :
***************************************************************************/
void* PlxMallocD(size_t size, const char* pszFile, int nLine)
{
    void *p;
    p = plx_malloc((size_t)size);
#ifdef PLX_DEBUGTOFILE  
    PlxWriteToDebugFile(p, "malloc", pszFile, nLine);
#else
    PlxTrace( "malloc  addr:%d  file:%s  line:%d ",  p, pszFile, nLine);
#endif
    return p;
}

/*************************************************************************
**  Function : PlxFreeD
**  Purpose  :   
**  Params   :
**  Return   :
**  Remarks  :
****************************************************************************/
void PlxFreeD(void* pMem, const char* pszFile, int nLine)
{
#ifdef PLX_DEBUGTOFILE 
    PlxWriteToDebugFile(pMem, "  free", pszFile, nLine);
#else
    PlxTrace( "free    addr:%d  file:%s  line:%d ",  pMem, pszFile, nLine);
#endif
    plx_free(pMem);
    return;
}

/*********************************************************************
* Function	   
* Purpose      
* Params	   
* Return	 	   
* Remarks	   
**********************************************************************/
void PlxFreeDForExpat ( void* pMem )
{
#ifdef PLX_DEBUGTOFILE 
    PlxWriteToDebugFile(pMem, "  free", "**** Expat ****", 888888);
#else
    plx_free(pMem);
#endif
    return;
}


/*********************************************************************
* Function	: PlxTrace   
* Purpose      
* Params	   
* Return	 	   
* Remarks	   
**********************************************************************/
extern int plx_vsprintf(char * where, const char *fmt, va_list varg);

#if (defined MMI_ON_HARDWARE_P || defined __ARM__ )


#include "kal_non_specific_general_types.h"
#include "stack_config.h"
#include "kal_trace.h"

void PlxTrace(const char* fmt, ...)
{
    static char dbgbuf[1024*6];
    va_list arglist;
    
    va_start(arglist, fmt);
    plx_vsprintf(dbgbuf, fmt, arglist);
#ifdef PLX_DEBUG_TO_FILE
	PlxWriteToDebugFile (NULL, dbgbuf, NULL, 0);
#else
    kal_prompt_trace( MOD_MMI, "%s",  dbgbuf);
#endif
    va_end(arglist);
}

#else  // on win32 simulator


typedef char S8;
extern void Trace(S8 *fmt,...);     //defined in DebugInitDef.h

void PlxTrace(const char* fmt, ...)
{
    static char dbgbuf[10240];
    va_list arglist;

    va_start(arglist, fmt);
    plx_vsprintf(dbgbuf, fmt, arglist);

#ifdef PLX_DEBUG_TO_FILE
	PlxWriteToDebugFile (NULL, dbgbuf, NULL, 0);
#else
    Trace("%s", dbgbuf);
#endif
    va_end(arglist);
}

#endif

/*********************************************************************
* Function	   
* Purpose      
* Params	   
* Return	 	   
* Remarks	   
**********************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -