Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

debuget.h File Reference


Detailed Description

Defines several debugging functions and macros, including ASSERT (and variations).

Author:
ejt (Creator)
Author
ejt
Name
tekkotsu-2_4_1
Revision
1.6
State
Exp
Date
2005/08/07 04:11:04
Revision
1.6
State
Exp
Date
2005/08/07 04:11:04

Definition in file debuget.h.

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <fstream>
#include <ctype.h>

Include dependency graph for debuget.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ASSERT(b, str)   {if(!(b)) std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl;}
 if the bool b is false, std::cout the string
#define ASSERTRET(b, str)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return; }}
 if the bool b is false, std::cout the string and return
#define ASSERTRETVAL(b, str, v)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return v; }}
 if the bool b is false, std::cout the string and return the value
#define ASSERTFATAL(b, str, x)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; exit(x); }}
 if the bool b is false, std::cout the string and exit(x)

Functions

const char * _extractFilename (const char *path)
 for historical reasons - the previous compiler give the entire path for __FILE__, for display, just use the filename
char hexdigit (int c)
 returns the hex char that corresponds to c, which should be 0-16 (returns '.' otherwise)
void charhexout (char c)
 printf's the two hex digits coresponding to a byte
void hexout (const void *p, size_t n)
 charhexout's n bytes starting at p
void hexout2 (const void *p, size_t size)
 displays hex and ascii values of size bytes from p
void hexout3 (const char *buf, size_t size)
 displays hex and ascii values of size bytes from p


Define Documentation

#define ASSERT b,
str   )     {if(!(b)) std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl;}
 

if the bool b is false, std::cout the string

Definition at line 19 of file debuget.h.

Referenced by IPCEventTranslator::bufferRequest(), StewartPlatformBehavior::closeComm(), OldHeadPointerMC::convFromBodyRelative(), OldHeadPointerMC::convToBodyRelative(), InterleavedYUVGenerator::createImageCache(), MotionManager::doAddMotion(), EventLogger::EventLogger(), MotionManager::getOutputs(), SoundManager::initRegion(), SegCamBehavior::openPacket(), RegionCamBehavior::openPacket(), RawCamBehavior::openPacket(), RawCameraGenerator::processEvent(), GroundPlaneBehavior::processEvent(), FreeMemReportControl::processEvent(), FollowHeadBehavior::processEvent(), CDTGenerator::processEvent(), SoundManager::ProcessMsg(), RawCameraGenerator::setDimensions(), CDTGenerator::setDimensions(), BehaviorSwitchControl< B, Al >::stopother(), and StateNode::~StateNode().

#define ASSERTFATAL b,
str,
 )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; exit(x); }}
 

if the bool b is false, std::cout the string and exit(x)

Definition at line 25 of file debuget.h.

#define ASSERTRET b,
str   )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return; }}
 

if the bool b is false, std::cout the string and return

Definition at line 21 of file debuget.h.

Referenced by EventLogger::checkLogFile(), Controller::closeGUI(), IPCEventTranslator::post(), VisualTargetCloseTrans::processEvent(), SegCamBehavior::processEvent(), RegionCamBehavior::processEvent(), RawCamBehavior::processEvent(), MotionSequenceNode< SIZE >::processEvent(), HeadLevelBehavior::processEvent(), FreeMemReportControl::processEvent(), BatteryMonitorBehavior::processEvent(), RawCameraGenerator::reconstructImage(), EventBase::SaveXML(), StewartPlatformBehavior::sax_start_element(), RawCameraGenerator::upsampleImage(), and BufferedImageGenerator::upsampleImage().

#define ASSERTRETVAL b,
str,
 )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return v; }}
 

if the bool b is false, std::cout the string and return the value

Definition at line 23 of file debuget.h.

Referenced by Profiler::getNewID(), RawCameraGenerator::LoadBuffer(), BufferedImageGenerator::LoadBuffer(), SegCamBehavior::openPacket(), RegionCamBehavior::openPacket(), RawCamBehavior::openPacket(), RawCameraGenerator::SaveBuffer(), BufferedImageGenerator::SaveBuffer(), SegCamBehavior::sendCloseConnectionPacket(), RawCamBehavior::sendCloseConnectionPacket(), RawCamBehavior::writeColor(), RegionCamBehavior::writeRegions(), SegCamBehavior::writeRLE(), SegCamBehavior::writeSeg(), and RawCamBehavior::writeSingleChannel().


Function Documentation

const char* _extractFilename const char *  path  )  [inline]
 

for historical reasons - the previous compiler give the entire path for __FILE__, for display, just use the filename

Definition at line 11 of file debuget.h.

void charhexout char  c  )  [inline]
 

printf's the two hex digits coresponding to a byte

Definition at line 50 of file debuget.h.

Referenced by hexout().

char hexdigit int  c  )  [inline]
 

returns the hex char that corresponds to c, which should be 0-16 (returns '.' otherwise)

Definition at line 39 of file debuget.h.

Referenced by charhexout().

void hexout const void *  p,
size_t  n
[inline]
 

charhexout's n bytes starting at p

Definition at line 55 of file debuget.h.

void hexout2 const void *  p,
size_t  size
[inline]
 

displays hex and ascii values of size bytes from p

Definition at line 72 of file debuget.h.

void hexout3 const char *  buf,
size_t  size
[inline]
 

displays hex and ascii values of size bytes from p

Definition at line 107 of file debuget.h.


Tekkotsu v2.4.1
Generated Tue Aug 16 16:33:09 2005 by Doxygen 1.4.4