Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

debug.h File Reference

#include "copyright.h"
#include "utility.h"
#include "sysdep.h"

Go to the source code of this file.

Compounds

class  Debug
 Data structure for debugging routines. More...


Defines

#define DEBUG(flag, expr)
#define ASSERT(condition)
#define ASSERTNOTREACHED()

Variables

const char dbgAll =
 turn on all debug messages. More...

const char dbgThread =
 threads. More...

const char dbgSynch =
 locks, semaphores, condition vars. More...

const char dbgInt =
 interrupt emulation. More...

const char dbgMach =
 machine emulation (USER_PROGRAM). More...

const char dbgDisk =
 disk emulation (FILESYS). More...

const char dbgFile =
 file system (FILESYS). More...

const char dbgAddr =
 address spaces (USER_PROGRAM). More...

const char dbgNet =
 network emulation (NETWORK). More...

Debugdebug


Define Documentation

#define ASSERT( condition )
 

Value:

    if (condition) {} else {                                            \
        cerr << "Assertion failed: line " << __LINE__ << " file " << __FILE__ << "\n";      \
        Abort();                                                              \
    }
ASSERT 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 where the error occurred.

Definition at line 65 of file debug.h.

Referenced by List::Append(), Thread::Begin(), Bitmap::Bitmap(), NetworkInput::CallBack(), ConsoleInput::CallBack(), CheckEndian(), Thread::CheckOverflow(), Bitmap::Clear(), Close(), ElevatorBank::CloseDoors(), ElevatorInfo::CloseDoors(), ElevatorInspector::ControllerTest(), Copy(), FileHeader::Deallocate(), Disk::Disk(), ElevatorInfo::Enter(), ElevatorBank::EnterElevator(), ElevatorInfo::Exit(), ElevatorBank::ExitElevator(), FileSystem::FileSystem(), Scheduler::FindNextToRun(), Thread::Finish(), HashTable::HashValue(), SortedList::Insert(), HashTable::Insert(), ListIterator::Item(), HashIterator::Item(), AddrSpace::Load(), Lseek(), Mail::Mail(), Bitmap::Mark(), ElevatorBank::MarkDirection(), ElevatorBank::MoveTo(), ElevatorInfo::MoveTo(), NetKernel::NetKernel(), Machine::OneInstruction(), ElevatorBank::OpenDoors(), ElevatorInfo::OpenDoors(), OpenForReadWrite(), OpenForWrite(), PollFile(), PostOfficeInput::PostalDelivery(), List::Prepend(), ElevatorBank::PressButton(), ElevatorBank::PressFloor(), ConsoleOutput::PutChar(), Read(), Machine::ReadMem(), Machine::ReadRegister(), Disk::ReadRequest(), Scheduler::ReadyToRun(), PostOfficeInput::Receive(), Lock::Release(), List::Remove(), HashTable::Remove(), List::RemoveFront(), ElevatorInspector::RiderTest(), Scheduler::Run(), SortedList::SanityCheck(), List::SanityCheck(), HashTable::SanityCheck(), SynchList::SelfTest(), Semaphore::SelfTest(), SortedList::SelfTest(), List::SelfTest(), HashTable::SelfTest(), Bitmap::SelfTest(), PostOfficeOutput::Send(), NetworkOutput::Send(), Condition::Signal(), Thread::Sleep(), Bitmap::Test(), ThreadedKernel::ThreadedKernel(), Machine::Translate(), Condition::Wait(), ElevatorBank::WhereIsElevator(), WriteFile(), Machine::WriteMem(), Machine::WriteRegister(), Disk::WriteRequest(), Thread::Yield(), ElevatorBank::getDirection(), main(), HashTable::~HashTable(), List::~List(), and Thread::~Thread().

#define ASSERTNOTREACHED( )
 

Value:

    {                                           \
        cerr << "Assertion failed: line " << __LINE__ << " file " << __FILE__ << "\n";      \
        Abort();                                                              \
    }
ASSERTNOTREACHED Print a message and dump core (equivalent to ASSERT(FALSE) without making the compiler whine). Useful for documenting when code should not be reached.

NOTE: needs to be a define, to be able to print the location where the error occurred.

Definition at line 81 of file debug.h.

Referenced by ExceptionHandler(), AddrSpace::Execute(), List::SelfTest(), and HashTable::SelfTest().

#define DEBUG( flag, expr )
 

Value:

    if (!debug->IsEnabled(flag)) {} else {                              \
        cerr << expr << "\n";                                           \
    }
DEBUG If flag is enabled, print a message.

Definition at line 51 of file debug.h.

Referenced by Thread::Begin(), NetworkInput::CallBack(), Disk::ComputeLatency(), Copy(), FileSystem::Create(), Disk::Disk(), ExceptionHandler(), FileSystem::FileSystem(), Thread::Finish(), Thread::Fork(), MailBox::Get(), AddrSpace::InitRegisters(), AddrSpace::Load(), Machine::OneInstruction(), FileSystem::Open(), Machine::RaiseException(), OpenFile::ReadAt(), Machine::ReadMem(), Disk::ReadRequest(), Scheduler::ReadyToRun(), Thread::SelfTest(), NetworkOutput::Send(), Thread::Sleep(), Machine::Translate(), Disk::UpdateLast(), OpenFile::WriteAt(), Machine::WriteMem(), Disk::WriteRequest(), Thread::Yield(), main(), and Thread::~Thread().


Variable Documentation

const char dbgAddr =
 

address spaces (USER_PROGRAM).

Definition at line 29 of file debug.h.

const char dbgAll =
 

turn on all debug messages.

Definition at line 22 of file debug.h.

const char dbgDisk =
 

disk emulation (FILESYS).

Definition at line 27 of file debug.h.

const char dbgFile =
 

file system (FILESYS).

Definition at line 28 of file debug.h.

const char dbgInt =
 

interrupt emulation.

Definition at line 25 of file debug.h.

const char dbgMach =
 

machine emulation (USER_PROGRAM).

Definition at line 26 of file debug.h.

const char dbgNet =
 

network emulation (NETWORK).

Definition at line 30 of file debug.h.

const char dbgSynch =
 

locks, semaphores, condition vars.

Definition at line 24 of file debug.h.

const char dbgThread =
 

threads.

Definition at line 23 of file debug.h.

Debug * debug
 

Definition at line 25 of file main.cc.


Generated at Wed Jul 4 11:32:22 2001 for Nachos by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001