简体   繁体   English

DEBUG语句有什么作用?

[英]What does the DEBUG statement do?

I am studying nachos for a university project and can't understand what the DEBUG(...) statement in the below code is doing. 我正在研究大学项目的玉米片,并且无法理解下面代码中的DEBUG(...)语句正在做什么。

void
ThreadTest1()
{
   DEBUG('t', "Entering ThreadTest1");
   Thread *t = new Thread("forked thread");
   t->Fork(SimpleThread, 1);
   SimpleThread(0);
}

Can someone please help ? 有人可以帮忙吗?

DEBUG is a conditional print statement that is activated when you run your code with "-d" option, as in $nachos -d ti. DEBUG是一个条件打印语句,当您使用“-d”选项运行代码时会激活该语句,如$ nachos -d ti中所示。 There are a few debug flags, for example "t" enables printing (debugging) of thread events, which you think you're after by your code snippet. 有一些调试标志,例如“t”允许打印(调试)线程事件,你认为你的代码片段是你的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM