[Lldb-commits] [lldb] r250870 - When a REPL creates a new target for itself, it is that target's REPL.

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 20 17:36:34 PDT 2015


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);




More information about the lldb-commits mailing list