diff --git a/lldb/bindings/python/python-wrapper.swig b/lldb/bindings/python/python-wrapper.swig --- a/lldb/bindings/python/python-wrapper.swig +++ b/lldb/bindings/python/python-wrapper.swig @@ -567,35 +567,6 @@ return result.release(); } -SWIGEXPORT int -LLDBSwigPython_GetIndexOfChildWithName -( - PyObject *implementor, - const char* child_name -) -{ - PyErr_Cleaner py_err_cleaner(true); - - PythonObject self(PyRefType::Borrowed, implementor); - auto pfunc = self.ResolveName("get_child_index"); - - if (!pfunc.IsAllocated()) - return UINT32_MAX; - - llvm::Expected result = pfunc.Call(PythonString(child_name)); - - long long retval = unwrapOrSetPythonException(As(std::move(result))); - - if (PyErr_Occurred()) { - PyErr_Clear(); // FIXME print this? do something else - return UINT32_MAX; - } - - if (retval >= 0) - return (uint32_t)retval; - - return UINT32_MAX; -} SWIGEXPORT bool LLDBSwigPython_UpdateSynthProviderInstance diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -139,9 +139,6 @@ 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 lldb::ValueObjectSP @@ -2447,28 +2444,6 @@ return ret_val; } -int ScriptInterpreterPythonImpl::GetIndexOfChildWithName( - const StructuredData::ObjectSP &implementor_sp, const char *child_name) { - if (!implementor_sp) - return UINT32_MAX; - - StructuredData::Generic *generic = implementor_sp->GetAsGeneric(); - if (!generic) - return UINT32_MAX; - void *implementor = generic->GetValue(); - if (!implementor) - return UINT32_MAX; - - int ret_val = UINT32_MAX; - - { - Locker py_lock(this, - Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN); - ret_val = LLDBSwigPython_GetIndexOfChildWithName(implementor, child_name); - } - - return ret_val; -} bool ScriptInterpreterPythonImpl::UpdateSynthProviderInstance( const StructuredData::ObjectSP &implementor_sp) { diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -146,8 +146,6 @@ GetChildAtIndex(const StructuredData::ObjectSP &implementor, uint32_t idx) override; - int GetIndexOfChildWithName(const StructuredData::ObjectSP &implementor, - const char *child_name) override; bool UpdateSynthProviderInstance( const StructuredData::ObjectSP &implementor) override; diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp --- a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp @@ -147,11 +147,6 @@ return nullptr; } -extern "C" int LLDBSwigPython_GetIndexOfChildWithName(void *implementor, - const char *child_name) { - return 0; -} - extern "C" void *LLDBSWIGPython_CastPyObjectToSBValue(void *data) { return nullptr; }