[Lldb-commits] [lldb] r143467 - in /lldb/trunk/source/Expression: ClangExpressionParser.cpp IRForTarget.cpp

Sean Callanan scallanan at apple.com
Tue Nov 1 10:33:54 PDT 2011


Author: spyffe
Date: Tue Nov  1 12:33:54 2011
New Revision: 143467

URL: http://llvm.org/viewvc/llvm-project?rev=143467&view=rev
Log:
Minor logging changes: added logging right before
the expression makes it to the JIT, and made some
logging only appear in verbose mode.

Modified:
    lldb/trunk/source/Expression/ClangExpressionParser.cpp
    lldb/trunk/source/Expression/IRForTarget.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=143467&r1=143466&r2=143467&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Tue Nov  1 12:33:54 2011
@@ -539,7 +539,19 @@
     RecordingMemoryManager *jit_memory_manager = new RecordingMemoryManager();
     
     std::string error_string;
-            
+
+    if (log)
+    {
+        std::string s;
+        raw_string_ostream oss(s);
+        
+        module->print(oss, NULL);
+        
+        oss.flush();
+        
+        log->Printf ("Module being sent to JIT: \n%s", s.c_str());
+    }
+    
 #if defined (USE_STANDARD_JIT)
     m_execution_engine.reset(llvm::ExecutionEngine::createJIT (module, 
                                                                &error_string, 
@@ -578,10 +590,17 @@
     
     // Errors usually cause failures in the JIT, but if we're lucky we get here.
     
+    if (!function)
+    {
+        err.SetErrorToGenericError();
+        err.SetErrorStringWithFormat("Couldn't find '%s' in the JITted module", function_name.c_str());
+        return err;
+    }
+    
     if (!fun_ptr)
     {
         err.SetErrorToGenericError();
-        err.SetErrorString("Couldn't JIT the function");
+        err.SetErrorStringWithFormat("'%s' was in the JITted module but wasn't lowered", function_name.c_str());
         return err;
     }
     

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=143467&r1=143466&r2=143467&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Tue Nov  1 12:33:54 2011
@@ -2556,7 +2556,7 @@
         }
     }
     
-    if (log)
+    if (log && log->GetVerbose())
     {
         std::string s;
         raw_string_ostream oss(s);
@@ -2669,7 +2669,7 @@
         return false;
     }
     
-    if (log)
+    if (log && log->GetVerbose())
     {
         std::string s;
         raw_string_ostream oss(s);





More information about the lldb-commits mailing list