summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r--lldb/scripts/Python/interface/SBDebugger.i2
-rw-r--r--lldb/scripts/Python/python-typemaps.swig16
2 files changed, 17 insertions, 1 deletions
diff --git a/lldb/scripts/Python/interface/SBDebugger.i b/lldb/scripts/Python/interface/SBDebugger.i
index 2fabc452fb9..883ed1c5fb5 100644
--- a/lldb/scripts/Python/interface/SBDebugger.i
+++ b/lldb/scripts/Python/interface/SBDebugger.i
@@ -272,7 +272,7 @@ public:
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/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig
index 1c3fbbb7c79..31364cac84e 100644
--- a/lldb/scripts/Python/python-typemaps.swig
+++ b/lldb/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) {
OpenPOWER on IntegriCloud