diff options
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h')
-rw-r--r-- | contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h b/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h index 163659234466..e1a3156d10af 100644 --- a/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h +++ b/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h @@ -115,7 +115,7 @@ public: PythonObject::ResolveNameWithDictionary<python::PythonCallable>( class_name, dict); if (!init.IsAllocated()) - return create_error(llvm::formatv("Could not find script class: %s", + return create_error(llvm::formatv("Could not find script class: {0}", class_name.data())); std::tuple<Args...> original_args = std::forward_as_tuple(args...); @@ -248,8 +248,11 @@ protected: (PyObject *)m_object_instance_sp->GetValue()); if (!implementor.IsAllocated()) - return ErrorWithMessage<T>(caller_signature, - "Python implementor not allocated.", error); + return llvm::is_contained(GetAbstractMethods(), method_name) + ? ErrorWithMessage<T>(caller_signature, + "Python implementor not allocated.", + error) + : T{}; std::tuple<Args...> original_args = std::forward_as_tuple(args...); auto transformed_args = TransformArgs(original_args); @@ -322,6 +325,10 @@ protected: return python::SWIGBridge::ToSWIGWrapper(arg); } + python::PythonObject Transform(lldb::ThreadPlanSP arg) { + return python::SWIGBridge::ToSWIGWrapper(arg); + } + python::PythonObject Transform(lldb::ProcessAttachInfoSP arg) { return python::SWIGBridge::ToSWIGWrapper(arg); } @@ -330,6 +337,14 @@ protected: return python::SWIGBridge::ToSWIGWrapper(arg); } + python::PythonObject Transform(Event *arg) { + return python::SWIGBridge::ToSWIGWrapper(arg); + } + + python::PythonObject Transform(lldb::StreamSP arg) { + return python::SWIGBridge::ToSWIGWrapper(arg.get()); + } + python::PythonObject Transform(lldb::DataExtractorSP arg) { return python::SWIGBridge::ToSWIGWrapper(arg); } @@ -428,6 +443,15 @@ Status ScriptedPythonInterface::ExtractValueFromPythonObject<Status>( python::PythonObject &p, Status &error); template <> +Event *ScriptedPythonInterface::ExtractValueFromPythonObject<Event *>( + python::PythonObject &p, Status &error); + +template <> +lldb::StreamSP +ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::StreamSP>( + python::PythonObject &p, Status &error); + +template <> lldb::BreakpointSP ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::BreakpointSP>( python::PythonObject &p, Status &error); |