Use self.TraceOn() API to decide whether to print debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129935 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBInstruction.cpp b/source/API/SBInstruction.cpp
index 4e5b4e2..920ce3c 100644
--- a/source/API/SBInstruction.cpp
+++ b/source/API/SBInstruction.cpp
@@ -155,8 +155,5 @@
     if (!m_opaque_sp.get())
         m_opaque_sp.reset (new PseudoInstruction());
         
-    bool success = m_opaque_sp->TestEmulation (output_stream.get(), test_file);
-    if (output_stream.GetSize() > 0)
-        fprintf (stdout, "%s", output_stream.GetData());
-    return success;
-}
\ No newline at end of file
+    return m_opaque_sp->TestEmulation (output_stream.get(), test_file);
+}
diff --git a/source/Core/Disassembler.cpp b/source/Core/Disassembler.cpp
index 2db2d55..a8c807d 100644
--- a/source/Core/Disassembler.cpp
+++ b/source/Core/Disassembler.cpp
@@ -510,14 +510,14 @@
 
     if (!file_name)
     {
-        out_stream->Printf ("Instruction::TestEmulation:  Missing file_name.\n");
+        out_stream->Printf ("Instruction::TestEmulation:  Missing file_name.");
         return false;
     }
         
     FILE *test_file = fopen (file_name, "r");
     if (!test_file)
     {
-        out_stream->Printf ("Instruction::TestEmulation: Attempt to open test file failed.\n");
+        out_stream->Printf ("Instruction::TestEmulation: Attempt to open test file failed.");
         return false;
     }
 
@@ -525,7 +525,7 @@
     char buffer[256];
     if (!fgets (buffer,255, test_file)) // Read/skip first line of file, which should be a comment line (description).
     {
-        out_stream->Printf ("Instruction::TestEmulation: Read comment line failed.\n");
+        out_stream->Printf ("Instruction::TestEmulation: Read comment line failed.");
         fclose (test_file);
         return false;
     }
@@ -533,7 +533,7 @@
             
     if (fscanf (test_file, "%s", buffer) != 1) // Read the arch or arch-triple from the file
     {
-        out_stream->Printf ("Instruction::TestEmulation: Read arch failed.\n");
+        out_stream->Printf ("Instruction::TestEmulation: Read arch failed.");
         fclose (test_file);
         return false;
     }
@@ -549,9 +549,9 @@
     fclose (test_file);
     
     if (success)
-        out_stream->Printf ("Emulation test succeeded.\n");
+        out_stream->Printf ("Emulation test succeeded.");
     else
-        out_stream->Printf ("Emulation test failed.\n");
+        out_stream->Printf ("Emulation test failed.");
         
     return success;
 }