Remove std::string input arguments and replace with "const char *".

llvm-svn: 172647
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
index 6c70caf..f555492 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
@@ -84,11 +84,11 @@
                                                           void** pyfunct_wrapper,
                                                           std::string& retval);
     
-    typedef void* (*SWIGPythonCreateSyntheticProvider) (const std::string python_class_name,
+    typedef void* (*SWIGPythonCreateSyntheticProvider) (const const char *python_class_name,
                                                         const char *session_dictionary_name,
                                                         const lldb::ValueObjectSP& valobj_sp);
 
-    typedef void* (*SWIGPythonCreateOSPlugin) (const std::string python_class_name,
+    typedef void* (*SWIGPythonCreateOSPlugin) (const const char *python_class_name,
                                                const char *session_dictionary_name,
                                                const lldb::ProcessSP& process_sp);
     
@@ -107,7 +107,7 @@
                                                                      std::string& err_msg,
                                                                      lldb_private::CommandReturnObject& cmd_retobj);
     
-    typedef bool           (*SWIGPythonCallModuleInit)              (const std::string python_module_name,
+    typedef bool           (*SWIGPythonCallModuleInit)              (const const char *python_module_name,
                                                                      const char *session_dictionary_name,
                                                                      lldb::DebuggerSP& debugger);
 
@@ -261,14 +261,14 @@
     }
     
     virtual lldb::ScriptInterpreterObjectSP
-    CreateSyntheticScriptedProvider (std::string class_name,
+    CreateSyntheticScriptedProvider (const char *class_name,
                                      lldb::ValueObjectSP valobj)
     {
         return lldb::ScriptInterpreterObjectSP();
     }
     
     virtual lldb::ScriptInterpreterObjectSP
-    CreateOSPlugin (std::string class_name,
+    CreateOSPlugin (const char *class_name,
                     lldb::ProcessSP process_sp)
     {
         return lldb::ScriptInterpreterObjectSP();
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
index fba3c6a..11e1a92 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
@@ -76,11 +76,11 @@
     GenerateScriptAliasFunction (StringList &input, std::string& output);
     
     lldb::ScriptInterpreterObjectSP
-    CreateSyntheticScriptedProvider (std::string class_name,
+    CreateSyntheticScriptedProvider (const char *class_name,
                                      lldb::ValueObjectSP valobj);
     
     virtual lldb::ScriptInterpreterObjectSP
-    CreateOSPlugin (std::string class_name,
+    CreateOSPlugin (const char *class_name,
                     lldb::ProcessSP process_sp);
     
     virtual lldb::ScriptInterpreterObjectSP
diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig
index 283d911..2189193 100644
--- a/lldb/scripts/Python/python-wrapper.swig
+++ b/lldb/scripts/Python/python-wrapper.swig
@@ -267,6 +267,8 @@
 {
     lldb::SBValue sb_value (valobj_sp);
 
+    retval.clear();
+
     PyObject *ValObj_PyObj = SWIG_NewPointerObj((void *) &sb_value, SWIGTYPE_p_lldb__SBValue, 0);
     
     if (ValObj_PyObj == NULL)
@@ -323,14 +325,14 @@
 SWIGEXPORT void*
 LLDBSwigPythonCreateSyntheticProvider 
 (
-    const std::string python_class_name,
+    const char *python_class_name,
     const char *session_dictionary_name,
     const lldb::ValueObjectSP& valobj_sp
 )
 {
     PyObject* retval = NULL;
 
-    if (python_class_name.empty() || !session_dictionary_name)
+    if (python_class_name == NULL || python_class_name[0] == '\0' || !session_dictionary_name)
         Py_RETURN_NONE;
 
     // I do not want the SBValue to be deallocated when going out of scope because python
@@ -343,7 +345,7 @@
     if (ValObj_PyObj == NULL)
         Py_RETURN_NONE;
 
-    const char* python_function_name = python_class_name.c_str();
+    const char* python_function_name = python_class_name;
 
     PyObject *session_dict, *pfunc;
     PyObject *pvalue;
@@ -778,14 +780,14 @@
 SWIGEXPORT void*
 LLDBSWIGPythonCreateOSPlugin
 (
-    const std::string python_class_name,
+    const char *python_class_name,
     const char *session_dictionary_name,
     const lldb::ProcessSP& process_sp
 )
 {
     PyObject* retval = NULL;
 
-    if (python_class_name.empty() || !session_dictionary_name)
+    if (python_class_name == NULL || python_class_name[0] == '\0' || !session_dictionary_name)
         Py_RETURN_NONE;
 
     // I do not want the SBValue to be deallocated when going out of scope because python
@@ -797,7 +799,7 @@
     if (SBProc_PyObj == NULL)
         Py_RETURN_NONE;
 
-    const char* python_function_name = python_class_name.c_str();
+    const char* python_function_name = python_class_name;
 
     PyObject *session_dict, *pfunc;
     PyObject *pvalue;
@@ -875,7 +877,7 @@
 SWIGEXPORT bool
 LLDBSwigPythonCallModuleInit 
 (
-    const std::string python_module_name,
+    const char *python_module_name,
     const char *session_dictionary_name,
     lldb::DebuggerSP& debugger
 )
@@ -890,7 +892,7 @@
     if (DebuggerObj_PyObj == NULL)
         return retval;
         
-    if (!(python_module_name.length()) || !session_dictionary_name)
+    if (python_module_name == NULL || python_module_name[0] == '\0' || !session_dictionary_name)
         return retval;
 
     PyObject *session_dict, *pfunc;
@@ -898,7 +900,8 @@
     
     session_dict = FindSessionDictionary (session_dictionary_name);
     
-    std::string python_function_name_string = python_module_name + (".__lldb_init_module");
+    std::string python_function_name_string = python_module_name;
+    python_function_name_string += ".__lldb_init_module";
     const char* python_function_name = python_function_name_string.c_str();
     
     if (session_dict != NULL)
diff --git a/lldb/source/Core/FormatClasses.cpp b/lldb/source/Core/FormatClasses.cpp
index de51513..84d450a 100644
--- a/lldb/source/Core/FormatClasses.cpp
+++ b/lldb/source/Core/FormatClasses.cpp
@@ -337,7 +337,7 @@
     m_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
     
     if (m_interpreter != NULL)
-        m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(m_python_class, backend.GetSP());
+        m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(m_python_class.c_str(), backend.GetSP());
 }
 
 TypeSyntheticImpl::FrontEnd::~FrontEnd()
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index 7a12a9e..d3b9cf9 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -64,72 +64,65 @@
 // on linkage-time resolution because the SWIG stuff and this file
 // get built at different times
 extern "C" bool
-LLDBSwigPythonBreakpointCallbackFunction 
-(
- const char *python_function_name,
- const char *session_dictionary_name,
- const lldb::StackFrameSP& sb_frame, 
- const lldb::BreakpointLocationSP& sb_bp_loc
- );
+LLDBSwigPythonBreakpointCallbackFunction (const char *python_function_name,
+                                          const char *session_dictionary_name,
+                                          const lldb::StackFrameSP& sb_frame,
+                                          const lldb::BreakpointLocationSP& sb_bp_loc);
 
 extern "C" bool
-LLDBSwigPythonWatchpointCallbackFunction 
-(
- const char *python_function_name,
- const char *session_dictionary_name,
- const lldb::StackFrameSP& sb_frame, 
- const lldb::WatchpointSP& sb_wp
- );
+LLDBSwigPythonWatchpointCallbackFunction (const char *python_function_name,
+                                          const char *session_dictionary_name,
+                                          const lldb::StackFrameSP& sb_frame,
+                                          const lldb::WatchpointSP& sb_wp);
 
 extern "C" bool
-LLDBSwigPythonCallTypeScript 
-(
- const char *python_function_name,
- void *session_dictionary,
- const lldb::ValueObjectSP& valobj_sp,
- void** pyfunct_wrapper,
- std::string& retval
- );
+LLDBSwigPythonCallTypeScript (const char *python_function_name,
+                              void *session_dictionary,
+                              const lldb::ValueObjectSP& valobj_sp,
+                              void** pyfunct_wrapper,
+                              std::string& retval);
 
 extern "C" void*
-LLDBSwigPythonCreateSyntheticProvider 
-(
- const std::string python_class_name,
- const char *session_dictionary_name,
- const lldb::ValueObjectSP& valobj_sp
- );
+LLDBSwigPythonCreateSyntheticProvider (const char *python_class_name,
+                                       const char *session_dictionary_name,
+                                       const lldb::ValueObjectSP& valobj_sp);
 
 
-extern "C" uint32_t       LLDBSwigPython_CalculateNumChildren                   (void *implementor);
-extern "C" void*          LLDBSwigPython_GetChildAtIndex                        (void *implementor, uint32_t idx);
-extern "C" int            LLDBSwigPython_GetIndexOfChildWithName                (void *implementor, const char* child_name);
-extern "C" void*          LLDBSWIGPython_CastPyObjectToSBValue                  (void* data);
-extern "C" bool           LLDBSwigPython_UpdateSynthProviderInstance            (void* implementor);
-extern "C" bool           LLDBSwigPython_MightHaveChildrenSynthProviderInstance (void* implementor);
+extern "C" uint32_t
+LLDBSwigPython_CalculateNumChildren (void *implementor);
 
-extern "C" bool           LLDBSwigPythonCallCommand 
-(
- const char *python_function_name,
- const char *session_dictionary_name,
- lldb::DebuggerSP& debugger,
- const char* args,
- std::string& err_msg,
- lldb_private::CommandReturnObject& cmd_retobj
- );
+extern "C" void *
+LLDBSwigPython_GetChildAtIndex (void *implementor, uint32_t idx);
 
-extern "C" bool           LLDBSwigPythonCallModuleInit 
-(
- const std::string python_module_name,
- const char *session_dictionary_name,
- lldb::DebuggerSP& debugger
- );
+extern "C" int
+LLDBSwigPython_GetIndexOfChildWithName (void *implementor, const char* child_name);
 
-extern "C" void*        LLDBSWIGPythonCreateOSPlugin
-(
- const std::string python_class_name,
- const char *session_dictionary_name,
- const lldb::ProcessSP& process_sp
-);
+extern "C" void *
+LLDBSWIGPython_CastPyObjectToSBValue (void* data);
+
+extern "C" bool
+LLDBSwigPython_UpdateSynthProviderInstance (void* implementor);
+
+extern "C" bool
+LLDBSwigPython_MightHaveChildrenSynthProviderInstance (void* implementor);
+
+extern "C" bool
+LLDBSwigPythonCallCommand (const char *python_function_name,
+                           const char *session_dictionary_name,
+                           lldb::DebuggerSP& debugger,
+                           const char* args,
+                           std::string& err_msg,
+                           lldb_private::CommandReturnObject& cmd_retobj);
+
+extern "C" bool
+LLDBSwigPythonCallModuleInit (const char *python_module_name,
+                              const char *session_dictionary_name,
+                              lldb::DebuggerSP& debugger);
+
+extern "C" void*
+LLDBSWIGPythonCreateOSPlugin (const char *python_class_name,
+                              const char *session_dictionary_name,
+                              const lldb::ProcessSP& process_sp);
 
 static int
 _check_and_flush (FILE *stream)
@@ -1726,10 +1719,9 @@
 }
 
 lldb::ScriptInterpreterObjectSP
-ScriptInterpreterPython::CreateOSPlugin (std::string class_name,
-                lldb::ProcessSP process_sp)
+ScriptInterpreterPython::CreateOSPlugin (const char *class_name, lldb::ProcessSP process_sp)
 {
-    if (class_name.empty())
+    if (class_name == NULL || class_name[0] == '\0')
         return lldb::ScriptInterpreterObjectSP();
     
     if (!process_sp)
@@ -1927,10 +1919,10 @@
 }
 
 lldb::ScriptInterpreterObjectSP
-ScriptInterpreterPython::CreateSyntheticScriptedProvider (std::string class_name,
+ScriptInterpreterPython::CreateSyntheticScriptedProvider (const char *class_name,
                                                           lldb::ValueObjectSP valobj)
 {
-    if (class_name.empty())
+    if (class_name == NULL || class_name[0] == '\0')
         return lldb::ScriptInterpreterObjectSP();
     
     if (!valobj.get())
@@ -2591,9 +2583,9 @@
         
         // if we are here, everything worked
         // call __lldb_init_module(debugger,dict)
-        if (!g_swig_call_module_init (basename,
-                                        m_dictionary_name.c_str(),
-                                        debugger_sp))
+        if (!g_swig_call_module_init (basename.c_str(),
+                                      m_dictionary_name.c_str(),
+                                      debugger_sp))
         {
             error.SetErrorString("calling __lldb_init_module failed");
             return false;