summaryrefslogtreecommitdiff
path: root/src/context
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-06-02 23:18:54 +0000
committerMorgan Deters <mdeters@gmail.com>2010-06-02 23:18:54 +0000
commit3e1ab30ae6f4504b2a94224d5f0dfcfdf32aed6e (patch)
tree9d0cc1c59c5bbe9b806e6fd79d7680f1431a382a /src/context
parent1163c334806c30ea54edadf0042690eeff8b278a (diff)
added a handful of debugTagIsOn("context") checks to resolve bug 143
Diffstat (limited to 'src/context')
-rw-r--r--src/context/context.cpp39
-rw-r--r--src/context/context.h4
-rw-r--r--src/context/context_mm.cpp8
3 files changed, 31 insertions, 20 deletions
diff --git a/src/context/context.cpp b/src/context/context.cpp
index 2de6e2051..b003571c1 100644
--- a/src/context/context.cpp
+++ b/src/context/context.cpp
@@ -129,15 +129,19 @@ void Context::addNotifyObjPost(ContextNotifyObj* pCNO) {
void ContextObj::update() throw(AssertionException) {
- Debug("context") << "before update(" << this << "):" << std::endl
- << *getContext() << std::endl;
+ if(debugTagIsOn("context")) {
+ Debug("context") << "before update(" << this << "):" << std::endl
+ << *getContext() << std::endl;
+ }
// Call save() to save the information in the current object
ContextObj* pContextObjSaved = save(d_pScope->getCMM());
- Debug("context") << "in update(" << this << ") with restore "
- << pContextObjSaved << ": waypoint 1" << std::endl
- << *getContext() << std::endl;
+ if(debugTagIsOn("context")) {
+ Debug("context") << "in update(" << this << ") with restore "
+ << pContextObjSaved << ": waypoint 1" << std::endl
+ << *getContext() << std::endl;
+ }
// Check that base class data was saved
Assert( ( pContextObjSaved->d_pContextObjNext == d_pContextObjNext &&
@@ -166,9 +170,11 @@ void ContextObj::update() throw(AssertionException) {
Debug("context") << "in update(" << this
<< "): *prev() is now " << *prev() << std::endl;
- Debug("context") << "in update(" << this << ") with restore "
- << pContextObjSaved << ": waypoint 3" << std::endl
- << *getContext() << std::endl;
+ if(debugTagIsOn("context")) {
+ Debug("context") << "in update(" << this << ") with restore "
+ << pContextObjSaved << ": waypoint 3" << std::endl
+ << *getContext() << std::endl;
+ }
// Update Scope pointer to current top Scope
d_pScope = d_pScope->getContext()->getTopScope();
@@ -180,9 +186,11 @@ void ContextObj::update() throw(AssertionException) {
// Scope is popped.
d_pScope->addToChain(this);
- Debug("context") << "after update(" << this << ") with restore "
- << pContextObjSaved << ":" << std::endl
- << *getContext() << std::endl;
+ if(debugTagIsOn("context")) {
+ Debug("context") << "after update(" << this << ") with restore "
+ << pContextObjSaved << ":" << std::endl
+ << *getContext() << std::endl;
+ }
}
@@ -227,10 +235,9 @@ ContextObj* ContextObj::restoreAndContinue() throw(AssertionException) {
void ContextObj::destroy() throw(AssertionException) {
- if( debugTagIsOn("context") ) {
+ if(debugTagIsOn("context")) {
/* Context can be big and complicated, so we only want to process this output
- * if we're really going to use it. (Same goes below.)
- */
+ * if we're really going to use it. (Same goes below.) */
Debug("context") << "before destroy " << this << " (level " << getLevel()
<< "):" << std::endl << *getContext() << std::endl;
}
@@ -246,7 +253,7 @@ void ContextObj::destroy() throw(AssertionException) {
if(d_pContextObjRestore == NULL) {
break;
}
- if( debugTagIsOn("context") ) {
+ if(debugTagIsOn("context")) {
Debug("context") << "in destroy " << this << ", restore object is "
<< d_pContextObjRestore << " at level "
<< d_pContextObjRestore->getLevel() << ":" << std::endl
@@ -254,7 +261,7 @@ void ContextObj::destroy() throw(AssertionException) {
}
restoreAndContinue();
}
- if( debugTagIsOn("context") ) {
+ if(debugTagIsOn("context")) {
Debug("context") << "after destroy " << this << ":" << std::endl
<< *getContext() << std::endl;
}
diff --git a/src/context/context.h b/src/context/context.h
index ff650ce5d..caa5fa57b 100644
--- a/src/context/context.h
+++ b/src/context/context.h
@@ -505,7 +505,9 @@ public:
* ContextMemoryManager as an argument.
*/
void deleteSelf() {
- Debug("context") << "deleteSelf(" << this << ")" << std::endl;
+ if(debugTagIsOn("context")) {
+ Debug("context") << "deleteSelf(" << this << ")" << std::endl;
+ }
this->~ContextObj();
::operator delete(this);
}
diff --git a/src/context/context_mm.cpp b/src/context/context_mm.cpp
index b0b015681..a202edf19 100644
--- a/src/context/context_mm.cpp
+++ b/src/context/context_mm.cpp
@@ -85,9 +85,11 @@ void* ContextMemoryManager::newData(size_t size) {
AlwaysAssert(d_nextFree <= d_endChunk,
"Request is bigger than memory chunk size");
}
- Debug("context") << "ContextMemoryManager::newData(" << size
- << ") returning " << res << " at level "
- << d_chunkList.size() << std::endl;
+ if(debugTagIsOn("context")) {
+ Debug("context") << "ContextMemoryManager::newData(" << size
+ << ") returning " << res << " at level "
+ << d_chunkList.size() << std::endl;
+ }
return res;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback