[DynInst_API:] [PATCH 3/3] dyninstAPI: Limit cerr messages to debug mode


Date: Thu, 6 Feb 2014 18:33:29 -0800
From: Josh Stone <jistone@xxxxxxxxxx>
Subject: [DynInst_API:] [PATCH 3/3] dyninstAPI: Limit cerr messages to debug mode
A few places in AddressSpace were writing directly to cerr, when they
ought to save messages for debug-enabled cerr only.
---
 dyninstAPI/src/addressSpace.C | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dyninstAPI/src/addressSpace.C b/dyninstAPI/src/addressSpace.C
index 1dd009da9ff1..717f57b80713 100644
--- a/dyninstAPI/src/addressSpace.C
+++ b/dyninstAPI/src/addressSpace.C
@@ -1787,7 +1787,7 @@ bool AddressSpace::relocateInt(FuncSet::const_iterator begin, FuncSet::const_ite
   relocation_cerr << "  Patching in jumps to generated code" << endl;
 
   if (!patchCode(cm, spb)) {
-      cerr << "Error: patching in jumps failed, ret false!" << endl;
+      relocation_cerr << "Error: patching in jumps failed, ret false!" << endl;
     return false;
   }
 
@@ -1981,7 +1981,7 @@ bool AddressSpace::patchCode(CodeMover::Ptr cm,
   std::list<codeGen> patches;
 
   if (!spb->generate(patches, p)) {
-      cerr << "Failed springboard generation, ret false" << endl;
+      springboard_cerr << "Failed springboard generation, ret false" << endl;
     return false;
   }
 
@@ -2130,7 +2130,8 @@ void AddressSpace::addDefensivePad(block_instance *callBlock, func_instance *cal
   // as they are invariant. 
    instPoint *point = instPoint::preCall(callFunc, callBlock);
    if (!point) {
-      cerr << "Error: no preCall point for " << callBlock->long_format() << endl;
+      mal_printf("Error: no preCall point for %s\n",
+                 callBlock->long_format().c_str());
       return;
    }
 
-- 
1.8.5.3

[← Prev in Thread] Current Thread [Next in Thread→]