tac0S
Template Affectional Command Operating System
|
Miscellaneous useful definitions, including debugging routines. More...
Go to the source code of this file.
Macros | |
#define | divRoundDown(n, s) ((n) / (s)) |
Divide and either round up or down. | |
#define | divRoundUp(n, s) (((n) / (s)) + ((((n) % (s)) > 0) ? 1 : 0)) |
#define | ASSERT(condition) |
ASSERT More... | |
Typedefs | |
typedef void(* | VoidFunctionPtr) (int arg) |
typedef void(* | VoidNoArgFunctionPtr) () |
Functions | |
void | DebugInit (const char *flags) |
Include interface that isolates us from the host machine system library. Requires definition of bool, and VoidFunctionPtr. More... | |
bool | DebugIsEnabled (char flag) |
Is this debug flag enabled? More... | |
void | DEBUG (char flag, const char *format,...) |
Print debug message. More... | |
Miscellaneous useful definitions, including debugging routines.
The debugging routines allow the user to turn on selected debugging messages, controllable from the command line arguments passed to Nachos (-d). You are encouraged to add your own debugging flags. The pre-defined debugging flags are: '+' -- turn on all debug messages 't' -- thread system 's' -- semaphores, locks, and conditions 'i' -- interrupt emulation 'm' -- machine emulation (USER_PROGRAM) 'd' -- disk emulation (FILESYS) 'f' -- file system (FILESYS) 'a' -- address spaces (USER_PROGRAM) 'n' -- network emulation (NETWORK)
Copyright (c) 1992-1993 The Regents of the University of California. All rights reserved. See copyright.h for copyright notice and limitation of liability and disclaimer of warranty provisions.
#define ASSERT | ( | condition | ) |
ASSERT
[in] | If | condition is false, print a message and dump core. Useful for documenting assumptions in the code. |
NOTE: needs to be a #define, to be able to print the location
void DEBUG | ( | char | flag, |
const char * | format, | ||
... | |||
) |
Print debug message.
Print debug message.
void DebugInit | ( | const char * | flagList | ) |
Include interface that isolates us from the host machine system library. Requires definition of bool, and VoidFunctionPtr.
enable printing debug messages
Include interface that isolates us from the host machine system library. Requires definition of bool, and VoidFunctionPtr.
If the flag is "+", we enable all DEBUG messages.
[in] |
bool DebugIsEnabled | ( | char | flag | ) |
Is this debug flag enabled?
Is this debug flag enabled?