diff options
author | Filipe Cabecinhas <me@filcab.net> | 2012-08-20 16:21:04 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2012-08-20 16:21:04 +0000 |
commit | c30199917ad4e32229df70367cedabd2bc2b334b (patch) | |
tree | c909c38ab08c427d7f67ac1b7d2ee0e1b5ca622c /lldb/scripts/Python | |
parent | 4c1f3a1cc54b0bedc759f377cd6d36a8089bbb14 (diff) | |
download | bcm5719-llvm-c30199917ad4e32229df70367cedabd2bc2b334b.tar.gz bcm5719-llvm-c30199917ad4e32229df70367cedabd2bc2b334b.zip |
A baton isn't needed to dispatch input.
I also added a typemap to make DispatchInput usable in Python.
llvm-svn: 162204
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r-- | lldb/scripts/Python/interface/SBDebugger.i | 2 | ||||
-rw-r--r-- | lldb/scripts/Python/python-typemaps.swig | 16 |
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) { |