From ae3f68066c8f282145435880107c1d3dc26ec3b8 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Thu, 23 May 2024 01:46:29 -0700 Subject: Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392)" (#93153) Reverts llvm/llvm-project#93149 since it breaks https://lab.llvm.org/buildbot/#/builders/68/builds/74799 --- .../Python/Interfaces/ScriptedPythonInterface.cpp | 34 ++-------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp index 7d072212676e..6f22503b279c 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp @@ -26,15 +26,6 @@ ScriptedPythonInterface::ScriptedPythonInterface( ScriptInterpreterPythonImpl &interpreter) : ScriptedInterface(), m_interpreter(interpreter) {} -template <> -void ScriptedPythonInterface::ReverseTransform( - lldb_private::Stream *&original_arg, python::PythonObject transformed_arg, - Status &error) { - Stream *s = ExtractValueFromPythonObject(transformed_arg, error); - *original_arg = *s; - original_arg->PutCString(static_cast(s)->GetData()); -} - template <> StructuredData::ArraySP ScriptedPythonInterface::ExtractValueFromPythonObject( @@ -57,33 +48,12 @@ Status ScriptedPythonInterface::ExtractValueFromPythonObject( if (lldb::SBError *sb_error = reinterpret_cast( python::LLDBSWIGPython_CastPyObjectToSBError(p.get()))) return m_interpreter.GetStatusFromSBError(*sb_error); - error.SetErrorString("Couldn't cast lldb::SBError to lldb::Status."); + else + error.SetErrorString("Couldn't cast lldb::SBError to lldb::Status."); return {}; } -template <> -Event *ScriptedPythonInterface::ExtractValueFromPythonObject( - python::PythonObject &p, Status &error) { - if (lldb::SBEvent *sb_event = reinterpret_cast( - python::LLDBSWIGPython_CastPyObjectToSBEvent(p.get()))) - return m_interpreter.GetOpaqueTypeFromSBEvent(*sb_event); - error.SetErrorString("Couldn't cast lldb::SBEvent to lldb_private::Event."); - - return nullptr; -} - -template <> -Stream *ScriptedPythonInterface::ExtractValueFromPythonObject( - python::PythonObject &p, Status &error) { - if (lldb::SBStream *sb_stream = reinterpret_cast( - python::LLDBSWIGPython_CastPyObjectToSBStream(p.get()))) - return m_interpreter.GetOpaqueTypeFromSBStream(*sb_stream); - error.SetErrorString("Couldn't cast lldb::SBStream to lldb_private::Stream."); - - return nullptr; -} - template <> lldb::DataExtractorSP ScriptedPythonInterface::ExtractValueFromPythonObject( -- cgit v1.2.3