A baton isn't needed to dispatch input.
I also added a typemap to make DispatchInput usable in Python.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162204 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/interface/SBDebugger.i b/scripts/Python/interface/SBDebugger.i
index 2fabc45..883ed1c 100644
--- a/scripts/Python/interface/SBDebugger.i
+++ b/scripts/Python/interface/SBDebugger.i
@@ -272,7 +272,7 @@
EnableLog (const char *channel, const char ** types);
void
- DispatchInput (void *baton, const void *data, size_t data_len);
+ DispatchInput (const void *data, size_t data_len);
void
DispatchInputInterrupt ();
diff --git a/scripts/Python/python-typemaps.swig b/scripts/Python/python-typemaps.swig
index 1c3fbbb..31364ca 100644
--- a/scripts/Python/python-typemaps.swig
+++ b/scripts/Python/python-typemaps.swig
@@ -113,6 +113,22 @@
}
}
+// For SBDebugger::DispatchInput
+%typemap(in) (const void *data, size_t data_len) {
+ if (PyString_Check($input)) {
+ $1 = static_cast<void *>(PyString_AsString($input));
+ $2 = PyString_Size($input);
+ }
+ else if(PyByteArray_Check($input)) {
+ $1 = static_cast<void *>(PyByteArray_AsString($input));
+ $2 = PyByteArray_Size($input);
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError, "Expecting a string or byte array");
+ return NULL;
+ }
+}
+
// typemap for an incoming buffer
// See also SBProcess::ReadMemory.
%typemap(in) (void *buf, size_t size) {