debug.cc

来自「美国加州大学操作系统课程实验平台Nachos」· CC 代码 · 共 46 行

CC
46
字号
// debug.cc //	Debugging routines.  Allows users to control whether to //	print DEBUG statements, based on a command line argument.//// Copyright (c) 1992-1996 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.#include "copyright.h"#include "utility.h"#include "debug.h" #include "string.h"//----------------------------------------------------------------------// Debug::Debug//      Initialize so that only DEBUG messages with a flag in flagList //	will be printed.////	If the flag is "+", we enable all DEBUG messages.//// 	"flagList" is a string of characters for whose DEBUG messages are //		to be enabled.//----------------------------------------------------------------------Debug::Debug(char *flagList){    enableFlags = flagList;}//----------------------------------------------------------------------// Debug::IsEnabled//      Return TRUE if DEBUG messages with "flag" are to be printed.//----------------------------------------------------------------------boolDebug::IsEnabled(char flag){    if (enableFlags != NULL) {	return ((strchr(enableFlags, flag) != 0) 		|| (strchr(enableFlags, '+') != 0));    } else {    	return FALSE;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?