summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 4cdb8a3e4c7..92af4969540 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -31,6 +31,7 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Core/Timer.h"
#include "lldb/Core/ValueObject.h"
+#include "lldb/Expression/REPL.h"
#include "lldb/Expression/UserExpression.h"
#include "Plugins/ExpressionParser/Clang/ClangASTSource.h"
#include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
@@ -211,6 +212,37 @@ Target::GetProcessSP () const
return m_process_sp;
}
+lldb::REPLSP
+Target::GetREPL (lldb::LanguageType language, bool can_create)
+{
+ if (language == eLanguageTypeUnknown)
+ {
+ return REPLSP(); // must provide a language
+ }
+
+ REPLMap::iterator pos = m_repl_map.find(language);
+
+ if (pos != m_repl_map.end())
+ {
+ return pos->second;
+ }
+
+ if (!can_create)
+ {
+ return lldb::REPLSP();
+ }
+
+ lldb::REPLSP ret = REPL::Create(language, this);
+
+ if (ret)
+ {
+ m_repl_map[language] = ret;
+ return m_repl_map[language];
+ }
+
+ return nullptr;
+}
+
void
Target::Destroy()
{
OpenPOWER on IntegriCloud