a debugging mechanism
Posted: Thu Nov 27, 2003 8:55 am
My debugging mechanism works like this:
I want a debugging mechanism that give me chance to debug my os modul by modul. For example, I want to write, in keyboard modul:
and in mouse modul:
The code below doesnt work, but I think it explains what I want.
Code: Select all
#ifdef _DEBUG_H
#define DEBUG(Y) Y
#else
#define DEBUG(Y)
#endif
...
...
DEBUG(printf("Error1");)
Code: Select all
DEBUG(1 ,printf("DEBUG:Keyboard Error"));
Code: Select all
DEBUG(2, printf("DEBUG:Mouse Error"));
Code: Select all
#ifdef _DEBUG_H && #if _DEBUG_H == ModulNo
#define DEBUG(ModulNo, Y) Y
#else
#define DEBUG(ModulNo, Y)
#endif