Author: sivachandra
Date: Wed Oct 21 13:58:01 2015
New Revision: 250927

URL: http://llvm.org/viewvc/llvm-project?rev=250927&view=rev
Log:
Revert "Made the REPL choose a default language if only one REPL can be chosen."

Summary: This reverts commit babd6dd74e316b1fcd9d171d7d8c83845d51a487.

Reviewers: spyffe

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13952

Modified:
    lldb/trunk/include/lldb/Core/PluginManager.h
    lldb/trunk/include/lldb/Target/Language.h
    lldb/trunk/include/lldb/lldb-private-interfaces.h
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/PluginManager.cpp
    lldb/trunk/source/Target/Language.cpp
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Core/PluginManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250927&r1=250926&r2=250927&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/PluginManager.h (original)
+++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 13:58:01 2015
@@ -449,8 +449,7 @@ public:
     static bool
     RegisterPlugin (const ConstString &name,
                     const char *description,
-                    REPLCreateInstance create_callback,
-                    REPLEnumerateSupportedLanguages 
enumerate_languages_callback);
+                    REPLCreateInstance create_callback);
     
     static bool
     UnregisterPlugin (REPLCreateInstance create_callback);
@@ -461,12 +460,6 @@ public:
     static REPLCreateInstance
     GetREPLCreateCallbackForPluginName (const ConstString &name);
     
-    static REPLEnumerateSupportedLanguages
-    GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx);
-    
-    static REPLEnumerateSupportedLanguages
-    GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const 
ConstString &name);
-    
     //------------------------------------------------------------------
     // Some plug-ins might register a DebuggerInitializeCallback
     // callback when registering the plug-in. After a new Debugger

Modified: lldb/trunk/include/lldb/Target/Language.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250927&r1=250926&r2=250927&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 13:58:01 2015
@@ -149,9 +149,6 @@ public:
     static void
     GetLanguagesSupportingTypeSystems (std::set<lldb::LanguageType> &languages,
                                        std::set<lldb::LanguageType> 
&languages_for_expressions);
-
-    static void
-    GetLanguagesSupportingREPLs (std::set<lldb::LanguageType> &languages);
     
 protected:
     //------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250927&r1=250926&r2=250927&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-private-interfaces.h (original)
+++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 13:58:01 2015
@@ -51,7 +51,6 @@ namespace lldb_private
     typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType 
language, Module *module, Target *target);
     typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, 
lldb::LanguageType language, Debugger *debugger, Target *target, const char 
*repl_options);
     typedef void (*TypeSystemEnumerateSupportedLanguages) 
(std::set<lldb::LanguageType> &languages_for_types, 
std::set<lldb::LanguageType> &languages_for_expressions);
-    typedef void (*REPLEnumerateSupportedLanguages) 
(std::set<lldb::LanguageType> &languages);
     typedef int (*ComparisonFunction)(const void *, const void *);
     typedef void (*DebuggerInitializeCallback)(Debugger &debugger);
 

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250927&r1=250926&r2=250927&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 13:58:01 2015
@@ -1805,6 +1805,11 @@ Debugger::RunREPL (LanguageType language
 {
     Error err;
     FileSpec repl_executable;
+    if (language == eLanguageTypeUnknown)
+    {
+        err.SetErrorString ("must specify a language for a REPL"); // TODO 
make it possible to specify a default language
+        return err;
+    }
     
     Target *const target = nullptr; // passing in an empty target means the 
REPL must create one
     

Modified: lldb/trunk/source/Core/PluginManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=250927&r1=250926&r2=250927&view=diff
==============================================================================
--- lldb/trunk/source/Core/PluginManager.cpp (original)
+++ lldb/trunk/source/Core/PluginManager.cpp Wed Oct 21 13:58:01 2015
@@ -2662,7 +2662,6 @@ struct REPLInstance
     ConstString name;
     std::string description;
     REPLCreateInstance create_callback;
-    REPLEnumerateSupportedLanguages enumerate_languages_callback;
 };
 
 typedef std::vector<REPLInstance> REPLInstances;
@@ -2684,8 +2683,7 @@ GetREPLInstances ()
 bool
 PluginManager::RegisterPlugin (const ConstString &name,
                                const char *description,
-                               REPLCreateInstance create_callback,
-                               REPLEnumerateSupportedLanguages 
enumerate_languages_callback)
+                               REPLCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -2695,7 +2693,6 @@ PluginManager::RegisterPlugin (const Con
         if (description && description[0])
             instance.description = description;
         instance.create_callback = create_callback;
-        instance.enumerate_languages_callback = enumerate_languages_callback;
         Mutex::Locker locker (GetREPLMutex ());
         GetREPLInstances ().push_back (instance);
     }

Modified: lldb/trunk/source/Target/Language.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Language.cpp?rev=250927&r1=250926&r2=250927&view=diff
==============================================================================
--- lldb/trunk/source/Target/Language.cpp (original)
+++ lldb/trunk/source/Target/Language.cpp Wed Oct 21 13:58:01 2015
@@ -299,17 +299,6 @@ Language::GetLanguagesSupportingTypeSyst
     }
 }
 
-static void
-GetLanguagesSupportingREPLs (std::set<lldb::LanguageType> &languages)
-{
-    uint32_t idx = 0;
-    
-    while (REPLEnumerateSupportedLanguages enumerate = 
PluginManager::GetREPLEnumerateSupportedLanguagesCallbackAtIndex(idx++))
-    {
-        (*enumerate)(languages);
-    }
-}
-
 std::unique_ptr<Language::TypeScavenger>
 Language::GetTypeScavenger ()
 {

Modified: lldb/trunk/source/Target/Target.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250927&r1=250926&r2=250927&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Wed Oct 21 13:58:01 2015
@@ -218,19 +218,7 @@ Target::GetREPL (Error &err, lldb::Langu
 {
     if (language == eLanguageTypeUnknown)
     {
-        std::set<LanguageType> repl_languages;
-        
-        Language::GetLanguagesSupportingREPLs(repl_languages);
-        
-        if (repl_languages.size() == 1)
-        {
-            language = *repl_languages.begin();
-        }
-        else
-        {
-            err.SetErrorStringWithFormat("Multiple possible REPL languages.  
Please specify a language.");
-            return REPLSP(); // must provide a language
-        }
+        return REPLSP(); // must provide a language
     }
     
     REPLMap::iterator pos = m_repl_map.find(language);


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to