diff options
author | Greg Clayton <gclayton@apple.com> | 2014-01-27 23:43:24 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-01-27 23:43:24 +0000 |
commit | 44d937820b451296f80449ac3de296345e80f183 (patch) | |
tree | 00d14538eded9f7e8bd075128d6ad5fd5ac1caed /lldb/scripts/Python/python-wrapper.swig | |
parent | f1cb16e481a60dbac58affcf8c8e423dac3937cb (diff) | |
download | bcm5719-llvm-44d937820b451296f80449ac3de296345e80f183.tar.gz bcm5719-llvm-44d937820b451296f80449ac3de296345e80f183.zip |
Merging the iohandler branch back into main.
The many many benefits include:
1 - Input/Output/Error streams are now handled as real streams not a push style input
2 - auto completion in python embedded interpreter
3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use
4 - it is now possible to use curses to drive LLDB (please try the "gui" command)
We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases.
llvm-svn: 200263
Diffstat (limited to 'lldb/scripts/Python/python-wrapper.swig')
-rw-r--r-- | lldb/scripts/Python/python-wrapper.swig | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index addfa29dcd5..d28f0cda110 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -929,10 +929,6 @@ LLDBSwigPythonCallModuleInit %runtime %{ // Forward declaration to be inserted at the start of LLDBWrapPython.h -// I used runtime as a hack to make SWIG place it where it's needed. -// This is needed to use LLDBSwigPythonCallSBInputReaderCallback in the -// typemaps and in the extensions (SBInputReader.__del__()). -#include "lldb/API/SBInputReader.h" #include "lldb/API/SBDebugger.h" #include "lldb/API/SBValue.h" @@ -952,13 +948,6 @@ LLDBSWIGPython_GetValueObjectSPFromSBValue (void* data) extern "C" { #endif -size_t -LLDBSwigPythonCallSBInputReaderCallback(void *baton, - lldb::SBInputReader *reader, - lldb::InputReaderAction notification, - const char*bytes, - size_t bytes_len); - void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton); #ifdef __cplusplus @@ -967,47 +956,7 @@ void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton); %} %wrapper %{ -// For the InputReader Callback functions -SWIGEXPORT size_t -LLDBSwigPythonCallSBInputReaderCallback(void *baton, - lldb::SBInputReader *reader, - lldb::InputReaderAction notification, - const char*bytes, - size_t bytes_len) { - if (baton != Py_None) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - PyObject *py_InputReader = SBTypeToSWIGWrapper(reader); - PyObject *py_Notification = PyInt_FromLong(notification); - PyObject *py_Bytes = PyBytes_FromStringAndSize(bytes, bytes_len); - - PyObject *tuple = PyTuple_Pack(3, py_InputReader, py_Notification, py_Bytes); - PyObject *res = PyObject_Call(reinterpret_cast<PyObject*>(baton), tuple, NULL); - Py_XDECREF(tuple); - Py_XDECREF(py_InputReader); - Py_XDECREF(py_Notification); - Py_XDECREF(py_Bytes); - - if (res == NULL) { - PyObject *exc = PyErr_Occurred(); - if (exc) { - ::puts("\nErroring out at LLDBSwigPythonCallSBInputReaderCallback"); - PyErr_Print(); - } - return 0; - } - - size_t result = 0; - // If the callback misbehaves and returns Py_None, assume it returned 0 - if (res != Py_None) - result = static_cast<size_t>(PyInt_AsSsize_t(res)); - - Py_XDECREF(res); - SWIG_PYTHON_THREAD_END_BLOCK; - return result; - } - return 0; -} + // For the LogOutputCallback functions void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton) { |