Skip to content

Commit 94dcfd3

Browse files
committed
Update the static bindings for the ParsedCommand interface.
1 parent a590c89 commit 94dcfd3

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4968,12 +4968,12 @@ PythonObject lldb_private::python::SWIGBridge::LLDBSwigPythonCreateScriptedThrea
49684968
}
49694969

49704970
bool lldb_private::python::SWIGBridge::LLDBSWIGPythonCallThreadPlan(
4971-
void *implementor, const char *method_name, lldb_private::Event *event,
4971+
void *implementer, const char *method_name, lldb_private::Event *event,
49724972
bool &got_error) {
49734973
got_error = false;
49744974

49754975
PyErr_Cleaner py_err_cleaner(false);
4976-
PythonObject self(PyRefType::Borrowed, static_cast<PyObject *>(implementor));
4976+
PythonObject self(PyRefType::Borrowed, static_cast<PyObject *>(implementer));
49774977
auto pfunc = self.ResolveName<PythonCallable>(method_name);
49784978

49794979
if (!pfunc.IsAllocated())
@@ -5006,12 +5006,12 @@ bool lldb_private::python::SWIGBridge::LLDBSWIGPythonCallThreadPlan(
50065006
}
50075007

50085008
bool lldb_private::python::SWIGBridge::LLDBSWIGPythonCallThreadPlan(
5009-
void *implementor, const char *method_name, lldb_private::Stream *stream,
5009+
void *implementer, const char *method_name, lldb_private::Stream *stream,
50105010
bool &got_error) {
50115011
got_error = false;
50125012

50135013
PyErr_Cleaner py_err_cleaner(false);
5014-
PythonObject self(PyRefType::Borrowed, static_cast<PyObject *>(implementor));
5014+
PythonObject self(PyRefType::Borrowed, static_cast<PyObject *>(implementer));
50155015
auto pfunc = self.ResolveName<PythonCallable>(method_name);
50165016

50175017
if (!pfunc.IsAllocated())
@@ -5512,6 +5512,29 @@ bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallCommandObject(
55125512
return true;
55135513
}
55145514

5515+
#include "lldb/Interpreter/CommandReturnObject.h"
5516+
5517+
bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallParsedCommandObject(
5518+
PyObject *implementor, lldb::DebuggerSP debugger, lldb_private::StructuredDataImpl &args_impl,
5519+
lldb_private::CommandReturnObject &cmd_retobj,
5520+
lldb::ExecutionContextRefSP exe_ctx_ref_sp) {
5521+
5522+
PyErr_Cleaner py_err_cleaner(true);
5523+
5524+
PythonObject self(PyRefType::Borrowed, implementor);
5525+
auto pfunc = self.ResolveName<PythonCallable>("__call__");
5526+
5527+
if (!pfunc.IsAllocated()) {
5528+
cmd_retobj.AppendError("Could not find '__call__' method in implementation class");
5529+
return false;
5530+
}
5531+
5532+
pfunc(SWIGBridge::ToSWIGWrapper(std::move(debugger)), SWIGBridge::ToSWIGWrapper(args_impl),
5533+
SWIGBridge::ToSWIGWrapper(exe_ctx_ref_sp), SWIGBridge::ToSWIGWrapper(cmd_retobj).obj());
5534+
5535+
return true;
5536+
}
5537+
55155538
PythonObject lldb_private::python::SWIGBridge::LLDBSWIGPythonCreateOSPlugin(
55165539
const char *python_class_name, const char *session_dictionary_name,
55175540
const lldb::ProcessSP &process_sp) {

0 commit comments

Comments
 (0)