Author: spyffe Date: Tue Oct 20 19:36:34 2015 New Revision: 250870 URL: http://llvm.org/viewvc/llvm-project?rev=250870&view=rev Log: 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.
Modified: lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=250870&r1=250869&r2=250870&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Tue Oct 20 19:36:34 2015 @@ -1569,6 +1569,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: //------------------------------------------------------------------ Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250870&r1=250869&r2=250870&view=diff ============================================================================== --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Tue Oct 20 19:36:34 2015 @@ -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; @@ -251,6 +252,14 @@ Target::GetREPL (Error &err, lldb::Langu } 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() { Mutex::Locker locker (m_mutex); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits