diff options
author | Sean Callanan <scallanan@apple.com> | 2011-11-01 17:33:54 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-11-01 17:33:54 +0000 |
commit | ea685aeb3c7ff6a6529a1f5476c850e3898f7ae2 (patch) | |
tree | d6d0c76815b5b70fc1544b69af42be26b564aa0c /lldb/source/Expression/ClangExpressionParser.cpp | |
parent | 8d365a1749651cef8367073f8d58624e2e691744 (diff) | |
download | bcm5719-llvm-ea685aeb3c7ff6a6529a1f5476c850e3898f7ae2.tar.gz bcm5719-llvm-ea685aeb3c7ff6a6529a1f5476c850e3898f7ae2.zip |
Minor logging changes: added logging right before
the expression makes it to the JIT, and made some
logging only appear in verbose mode.
llvm-svn: 143467
Diffstat (limited to 'lldb/source/Expression/ClangExpressionParser.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionParser.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp index 50518e78e73..4a8f9412cf7 100644 --- a/lldb/source/Expression/ClangExpressionParser.cpp +++ b/lldb/source/Expression/ClangExpressionParser.cpp @@ -539,7 +539,19 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_allocation_addr, 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 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_allocation_addr, // 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; } |