3 # This script generates the required file for supporting the debug
4 # channels used throught the code.
5 # The generated file is
7 # The script must be run in the root directory of the project.
9 # Dimitrie O. Paun <dimi@cs.toronto.edu>
10 # Patrik Stridvall <ps@leissner.se>
13 DEBUG_CHANNELS
=`tools/find_debug_channels`
15 exec > include
/debugdefs.h
18 /* Do not modify this file -- it is automatically generated! */
20 #include "debugtools.h"
22 #define DEBUG_CLASS_COUNT __DBCL_COUNT
24 static const char * const debug_cl_name[] = { "fixme", "err", "warn", "trace" };
29 for ch
in $DEBUG_CHANNELS
31 echo "char dbch_$ch[] = \"\\003$ch\";"
35 echo "#define DEBUG_CHANNEL_COUNT $chno"
39 echo 'static char * const debug_channels[DEBUG_CHANNEL_COUNT] = {'
40 for ch
in $DEBUG_CHANNELS
42 if [ "${count}" != "${chno}" ]; then
47 count
=`expr $count + 1`
51 for cls
in err fixme warn trace
55 int dbg_header_$cls( const char *dbg_channel, const char *func )
57 return dbg_printf( "$cls:%s:%s ", dbg_channel + 1, func );