When a REPL creates a new target for itself, it is that target's REPL.

To allow that, I've added a SetREPL call to the Target, which allows a REPL
that just created a target to install itself as the go-to REPL for the
corresponding language.

llvm-svn: 250870
This commit is contained in:
Sean Callanan 2015-10-21 00:36:34 +00:00
parent 3b682de6b1
commit 9a6940cef4
2 changed files with 12 additions and 0 deletions

View File

@ -1570,6 +1570,9 @@ public:
lldb::REPLSP
GetREPL (Error &err, lldb::LanguageType language, const char *repl_options, bool can_create);
void
SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp);
protected:
//------------------------------------------------------------------
// Member variables.

View File

@ -56,6 +56,7 @@
#include "lldb/Target/SystemRuntime.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/LLDBAssert.h"
using namespace lldb;
using namespace lldb_private;
@ -250,6 +251,14 @@ Target::GetREPL (Error &err, lldb::LanguageType language, const char *repl_optio
return lldb::REPLSP();
}
void
Target::SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp)
{
lldbassert(!m_repl_map.count(language));
m_repl_map[language] = repl_sp;
}
void
Target::Destroy()
{