<div dir="ltr">This is a good example of where a "null repl" would be great for testing.  You don't need a language to verify, for example, that when a repl creates a new target for itself, it is correcly set as the repl for that target.  And even if you had a language specific repl, that wouldn't really be the right place to test that, because it makes the person reading the test think that this is some property of a language instead of some property of all repls.  So having a null repl is a great place to test all these behaviors of the system that have nothing to do with what language you're dealing with.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 20, 2015 at 5:38 PM Sean Callanan via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: spyffe<br>
Date: Tue Oct 20 19:36:34 2015<br>
New Revision: 250870<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=250870&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=250870&view=rev</a><br>
Log:<br>
When a REPL creates a new target for itself, it is that target's REPL.<br>
To allow that, I've added a SetREPL call to the Target, which allows a REPL<br>
that just created a target to install itself as the go-to REPL for the<br>
corresponding language.<br>
<br>
Modified:<br>
    lldb/trunk/include/lldb/Target/Target.h<br>
    lldb/trunk/source/Target/Target.cpp<br>
<br>
Modified: lldb/trunk/include/lldb/Target/Target.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=250870&r1=250869&r2=250870&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=250870&r1=250869&r2=250870&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Target/Target.h (original)<br>
+++ lldb/trunk/include/lldb/Target/Target.h Tue Oct 20 19:36:34 2015<br>
@@ -1569,6 +1569,9 @@ public:<br>
<br>
     lldb::REPLSP<br>
     GetREPL (Error &err, lldb::LanguageType language, const char *repl_options, bool can_create);<br>
+<br>
+    void<br>
+    SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp);<br>
<br>
 protected:<br>
     //------------------------------------------------------------------<br>
<br>
Modified: lldb/trunk/source/Target/Target.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250870&r1=250869&r2=250870&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250870&r1=250869&r2=250870&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/Target.cpp (original)<br>
+++ lldb/trunk/source/Target/Target.cpp Tue Oct 20 19:36:34 2015<br>
@@ -56,6 +56,7 @@<br>
 #include "lldb/Target/SystemRuntime.h"<br>
 #include "lldb/Target/Thread.h"<br>
 #include "lldb/Target/ThreadSpec.h"<br>
+#include "lldb/Utility/LLDBAssert.h"<br>
<br>
 using namespace lldb;<br>
 using namespace lldb_private;<br>
@@ -251,6 +252,14 @@ Target::GetREPL (Error &err, lldb::Langu<br>
 }<br>
<br>
 void<br>
+Target::SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp)<br>
+{<br>
+    lldbassert(!m_repl_map.count(language));<br>
+<br>
+    m_repl_map[language] = repl_sp;<br>
+}<br>
+<br>
+void<br>
 Target::Destroy()<br>
 {<br>
     Mutex::Locker locker (m_mutex);<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>