Added the concept of a Read-Eval-Print-Loop to LLDB.
A REPL takes over the command line and typically treats input as source code.
REPLs can also do code completion. The REPL class allows its subclasses to
implement the language-specific functionality without having to know about the
IOHandler-specific internals.
Also added a PluginManager-based way of getting to a REPL given a language and
a target.
Also brought in some utility code and expression options that are useful for
REPLs, such as line offsets for expressions, ANSI terminal coloring of errors,
and a few IOHandler convenience functions.
llvm-svn: 250753
diff --git a/lldb/source/Expression/UserExpression.cpp b/lldb/source/Expression/UserExpression.cpp
index eea0667..7bcb753 100644
--- a/lldb/source/Expression/UserExpression.cpp
+++ b/lldb/source/Expression/UserExpression.cpp
@@ -465,7 +465,9 @@
const char *expr_cstr,
const char *expr_prefix,
lldb::ValueObjectSP &result_valobj_sp,
- Error &error)
+ Error &error,
+ uint32_t line_offset,
+ lldb::ModuleSP *jit_module_sp_ptr)
{
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
@@ -567,6 +569,10 @@
}
else
{
+ // If a pointer to a lldb::ModuleSP was passed in, return the JIT'ed module if one was created
+ if (jit_module_sp_ptr && user_expression_sp->m_execution_unit_sp)
+ *jit_module_sp_ptr = user_expression_sp->m_execution_unit_sp->GetJITModule();
+
lldb::ExpressionVariableSP expr_result;
if (execution_policy == eExecutionPolicyNever &&