📄 debug.lst
字号:
ARM COMPILER V2.42, debug 27/03/06 10:45:48 PAGE 1
ARM COMPILER V2.42, COMPILATION OF MODULE debug
OBJECT MODULE PLACED IN .\obj\debug.obj
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe src\debug.c THUMB DEBUG PRINT(.\LST\DEBUG.LST) TABS(4) OBJECT(.\obj\debug.ob
-j)
stmt level source
1 /*****************************************************************************\
2 * efs - General purpose Embedded Filesystem library *
3 * --------------------- ----------------------------------- *
4 * *
5 * Filename : debug.c *
6 * Description : These functions are used for debugging output on different *
7 * environments *
8 * *
9 * This library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU Lesser General Public *
11 * License as published by the Free Software Foundation; either *
12 * version 2.1 of the License, or (at your option) any later version. *
13 * *
14 * This library is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
17 * Lesser General Public License for more details. *
18 * *
19 * (c)2005 Michael De Nil *
20 * (c)2005 Lennart Yseboodt *
21 \*****************************************************************************/
22
23 /* COMMENT REGARDING FUNCTION COMMENTS IN THIS FILE
24 * Only the linuxfile debug functions are commented since all functions
25 * perform the same logical task.
26 */
27
28 /*****************************************************************************/
29 #include "debug.h"
30 /*****************************************************************************/
31
32
33 /*****************************************************************************/
34 #ifdef DEBUG
35 #ifdef HW_ENDPOINT_LINUX_ALL
/*****************************************************************************/
/* ****************************************************************************
* void debug(const eint8 *format, ...)
* Description: This function prints debug output to the screen (target dependant)
* and if DO_FUNC_DEBUG is defined also to a localfile.
* Return value: void
*/
void debug(const eint8 *format, ...)
{
va_list ap;
#ifdef DO_FUNC_DEBUG
euint8 c;
extern FILE* debugfile;
extern volatile euint8 tw;
#endif
va_start(ap, format);
vprintf(format,ap);
#ifdef DO_FUNC_DEBUG
for(c=0;c<tw+1;c++)
{
ARM COMPILER V2.42, debug 27/03/06 10:45:48 PAGE 2
fprintf(debugfile," ");
}
vfprintf(debugfile,format,ap);
#endif
va_end(ap);
}
/*****************************************************************************/
/* ****************************************************************************
* void debug_funcin(const eint8 *format, ...)
* Description: This function marks the entrance of a function, which
* increments a tabfieldcounter. A tree like structure can the be found in the
* debugging file.
* Return value: void
*/
void debug_funcin(const eint8 *format, ...)
{
#ifdef DO_FUNC_DEBUG
eint8 c;
va_list ap;
extern FILE* debugfile;
extern volatile unsigned char tw;
if(debugfile==NULL)return;
for(c=0;c<tw;c++){
fprintf(debugfile," ");
}
va_start(ap, format);
vfprintf(debugfile,format,ap);
va_end(ap);
fprintf(debugfile,"\n");
tw++;
#endif
}
/*****************************************************************************/
/* ****************************************************************************
* void debug_funcout(const eint8 *format, ...)
* Description: Decrements the tabfieldcounter. This function is called everywhere
* a function is left.
* Return value: void
*/
void debug_funcout(const eint8 *format, ...)
{
#ifdef DO_FUNC_DEBUG
eint8 c;
va_list ap;
extern FILE* debugfile;
extern volatile euint8 tw;
if(debugfile==NULL)return;
if(tw>0)tw--;
for(c=0;c<tw;c++){
fprintf(debugfile," ");
}
va_start(ap, format);
vfprintf(debugfile,format,ap);
va_end(ap);
ARM COMPILER V2.42, debug 27/03/06 10:45:48 PAGE 3
fprintf(debugfile,"\n");
#endif
}
/*****************************************************************************/
/* ****************************************************************************
* void debug_init()
* Description: This function optionally opens the debugfile, or does any other
* initialisation to enable debugoutput.
* Return value: void
*/
void debug_init()
{
#ifdef DO_FUNC_DEBUG
extern FILE* debugfile;
extern volatile unsigned char tw;
debugfile=NULL;
tw=0;
debugfile=fopen("DBG.OUT","w");
#endif
}
/*****************************************************************************/
/* ****************************************************************************
* void debug_end()
* Description: This function closes the debugfile.
* Return value: void
*/
void debug_end()
{
#ifdef DO_FUNC_DEBUG
extern FILE* debugfile;
fflush(debugfile);
fclose(debugfile);
#endif
}
/*****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -