Skip to content

Commit 84cb1c6

Browse files
committed
Update the static bindings.
1 parent d4320a9 commit 84cb1c6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lldb/bindings/python/static-binding/LLDBWrapPython.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
49735005
PythonObject lldb_private::LLDBSwigPythonCreateScriptedBreakpointResolver(
49745006
const char *python_class_name, const char *session_dictionary_name,
49755007
const StructuredDataImpl &args_impl,

0 commit comments

Comments
 (0)