From b14bed80cb459643e0b788e9a3875cdf643e90a7 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 16 Jan 2013 19:53:55 +0000 Subject: Remove std::string input arguments and replace with "const char *". llvm-svn: 172647 --- lldb/scripts/Python/python-wrapper.swig | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lldb/scripts/Python/python-wrapper.swig') 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 @@ LLDBSwigPythonCallTypeScript { 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 @@ LLDBSwigPythonCallTypeScript 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 @@ LLDBSwigPythonCreateSyntheticProvider 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 @@ LLDBSwigPythonCallCommand 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 @@ LLDBSWIGPythonCreateOSPlugin 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 @@ LLDBSWIGPythonCreateOSPlugin 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 @@ LLDBSwigPythonCallModuleInit 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 @@ LLDBSwigPythonCallModuleInit 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) -- cgit v1.1