File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
lldb/bindings/python/static-binding Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -4970,6 +4970,38 @@ bool lldb_private::LLDBSWIGPythonCallThreadPlan(
49704970 return false;
49714971}
49724972
4973+ bool lldb_private::LLDBSWIGPythonCallThreadPlan(
4974+ void *implementor, const char *method_name, lldb_private::Stream *stream,
4975+ bool &got_error) {
4976+ got_error = false;
4977+
4978+ PyErr_Cleaner py_err_cleaner(false);
4979+ PythonObject self(PyRefType::Borrowed, static_cast<PyObject *>(implementor));
4980+ auto pfunc = self.ResolveName<PythonCallable>(method_name);
4981+
4982+ if (!pfunc.IsAllocated())
4983+ return false;
4984+
4985+ auto *sb_stream = new lldb::SBStream();
4986+ PythonObject sb_stream_arg =
4987+ ToSWIGWrapper(std::unique_ptr<lldb::SBStream>(sb_stream));
4988+
4989+ PythonObject result;
4990+ result = pfunc(sb_stream_arg);
4991+
4992+ if (PyErr_Occurred()) {
4993+ printf("Error occured for call to %s.\n",
4994+ method_name);
4995+ PyErr_Print();
4996+ got_error = true;
4997+ return false;
4998+ }
4999+ if (stream)
5000+ stream->PutCString(sb_stream->GetData());
5001+ return true;
5002+
5003+ }
5004+
49735005PythonObject lldb_private::LLDBSwigPythonCreateScriptedBreakpointResolver(
49745006 const char *python_class_name, const char *session_dictionary_name,
49755007 const StructuredDataImpl &args_impl,
You can’t perform that action at this time.
0 commit comments