文件:
Android8/LA.UM.6.6/LINUX/android/bootable/bootloader/lk/include/debug.h
修改点:
#if defined(DEBUG)
#define DEBUGLEVEL 2
#else
#define DEBUGLEVEL 2
#endif
原理:
/* debug levels */
#define CRITICAL 0
#define ALWAYS 0
#define INFO 1
#define SPEW 2
然后,下面的判断条件恒成立
#define dputc(level, str) do { if ((level) <= DEBUGLEVEL) { _dputc(str); } } while (0)
#define dputs(level, str) do { if ((level) <= DEBUGLEVEL) { _dputs(str); } } while (0)
#define dprintf(level, x...) do { if ((level) <= DEBUGLEVEL) { _dprintf(x); } } while (0)
#define dvprintf(level, x...) do { if ((level) <= DEBUGLEVEL) { _dvprintf(x); } } while (0)