summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/Python')
-rwxr-xr-xlldb/scripts/Python/build-swig-Python.sh2
-rw-r--r--lldb/scripts/Python/interface/SBCommandInterpreter.i7
-rw-r--r--lldb/scripts/Python/interface/SBDebugger.i15
-rw-r--r--lldb/scripts/Python/interface/SBInputReader.i53
-rw-r--r--lldb/scripts/Python/python-extensions.swig9
-rw-r--r--lldb/scripts/Python/python-swigsafecast.swig7
-rw-r--r--lldb/scripts/Python/python-typemaps.swig22
-rw-r--r--lldb/scripts/Python/python-wrapper.swig53
8 files changed, 13 insertions, 155 deletions
diff --git a/lldb/scripts/Python/build-swig-Python.sh b/lldb/scripts/Python/build-swig-Python.sh
index c424c06f0ae..34a1ff27ff3 100755
--- a/lldb/scripts/Python/build-swig-Python.sh
+++ b/lldb/scripts/Python/build-swig-Python.sh
@@ -99,7 +99,6 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
" ${SRC_ROOT}/include/lldb/API/SBFrame.h"\
" ${SRC_ROOT}/include/lldb/API/SBFunction.h"\
" ${SRC_ROOT}/include/lldb/API/SBHostOS.h"\
-" ${SRC_ROOT}/include/lldb/API/SBInputReader.h"\
" ${SRC_ROOT}/include/lldb/API/SBInstruction.h"\
" ${SRC_ROOT}/include/lldb/API/SBInstructionList.h"\
" ${SRC_ROOT}/include/lldb/API/SBLineEntry.h"\
@@ -147,7 +146,6 @@ INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBFrame.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBFunction.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBHostOS.i"\
-" ${SRC_ROOT}/scripts/Python/interface/SBInputReader.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBInstruction.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBInstructionList.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBLineEntry.i"\
diff --git a/lldb/scripts/Python/interface/SBCommandInterpreter.i b/lldb/scripts/Python/interface/SBCommandInterpreter.i
index 4cf3d22f5d0..9dc842e87c2 100644
--- a/lldb/scripts/Python/interface/SBCommandInterpreter.i
+++ b/lldb/scripts/Python/interface/SBCommandInterpreter.i
@@ -78,6 +78,9 @@ public:
bool
IsValid() const;
+ const char *
+ GetIOHandlerControlSequence(char ch);
+
bool
CommandExists (const char *cmd);
@@ -120,6 +123,10 @@ public:
int match_start_point,
int max_return_elements,
lldb::SBStringList &matches);
+
+ bool
+ IsActive ();
+
};
} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBDebugger.i b/lldb/scripts/Python/interface/SBDebugger.i
index 6d075ace791..ba1c18914e3 100644
--- a/lldb/scripts/Python/interface/SBDebugger.i
+++ b/lldb/scripts/Python/interface/SBDebugger.i
@@ -292,15 +292,6 @@ public:
void
DispatchInputEndOfFile ();
- void
- PushInputReader (lldb::SBInputReader &reader);
-
- void
- NotifyTopInputReader (lldb::InputReaderAction notification);
-
- bool
- InputReaderIsTopReader (const lldb::SBInputReader &reader);
-
const char *
GetInstanceName ();
@@ -372,7 +363,11 @@ public:
lldb::SBTypeSynthetic
GetSyntheticForType (lldb::SBTypeNameSpecifier);
-
+
+ void
+ RunCommandInterpreter (bool auto_handle_events,
+ bool spawn_thread);
+
}; // class SBDebugger
} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBInputReader.i b/lldb/scripts/Python/interface/SBInputReader.i
deleted file mode 100644
index 93986242357..00000000000
--- a/lldb/scripts/Python/interface/SBInputReader.i
+++ /dev/null
@@ -1,53 +0,0 @@
-//===-- SWIG Interface for SBInputREader ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-namespace lldb {
-
-class SBInputReader
-{
-public:
-
- typedef size_t (*Callback) (void *baton,
- SBInputReader *reader,
- InputReaderAction notification,
- const char *bytes,
- size_t bytes_len);
-
- SBInputReader ();
-
- SBInputReader (const lldb::SBInputReader &rhs);
-
- ~SBInputReader ();
-
- SBError
- Initialize (SBDebugger &debugger,
- Callback callback,
- void *callback_baton,
- lldb::InputReaderGranularity granularity,
- const char *end_token,
- const char *prompt,
- bool echo);
-
- bool
- IsValid () const;
-
- bool
- IsActive () const;
-
- bool
- IsDone () const;
-
- void
- SetIsDone (bool value);
-
- InputReaderGranularity
- GetGranularity ();
-};
-
-} // namespace lldb
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig
index c4bc8b9141b..3dbcb881b95 100644
--- a/lldb/scripts/Python/python-extensions.swig
+++ b/lldb/scripts/Python/python-extensions.swig
@@ -777,15 +777,6 @@
// Py_XDECREF($self->GetCallbackBaton());
// }
// }
-// %extend lldb::SBInputReader {
-// // FIXME: m_callback_function is private and we have no other
-// // way to access it.
-// PyObject *lldb::SBInputReader::__del__ (){
-// // Only call Py_XDECREF if we have a Python object (or NULL)
-// if (LLDBSwigPythonCallSBInputReaderCallback == $self->m_callback_function)
-// Py_XDECREF($self->m_callback_baton);
-// }
-// }
%pythoncode %{
diff --git a/lldb/scripts/Python/python-swigsafecast.swig b/lldb/scripts/Python/python-swigsafecast.swig
index da7444c9b96..0150854d2c6 100644
--- a/lldb/scripts/Python/python-swigsafecast.swig
+++ b/lldb/scripts/Python/python-swigsafecast.swig
@@ -112,10 +112,3 @@ SBTypeToSWIGWrapper (lldb::SBCommandReturnObject* cmd_ret_obj_sb)
{
return SWIG_NewPointerObj((void *) cmd_ret_obj_sb, SWIGTYPE_p_lldb__SBCommandReturnObject, 0);
}
-
-template <>
-PyObject*
-SBTypeToSWIGWrapper (lldb::SBInputReader* input_reader_sb)
-{
- return SWIG_NewPointerObj((void *) input_reader_sb, SWIGTYPE_p_lldb__SBInputReader, 0);
-}
diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig
index 24bb2b8ca46..7a6e0d3261c 100644
--- a/lldb/scripts/Python/python-typemaps.swig
+++ b/lldb/scripts/Python/python-typemaps.swig
@@ -355,28 +355,6 @@
free($1);
}
-// For lldb::SBInputReader::Callback
-%typemap(in) (lldb::SBInputReader::Callback callback, void *callback_baton) {
- if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) {
- PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
- return NULL;
- }
-
- // FIXME (filcab): We can't currently check if our callback is already
- // LLDBSwigPythonCallPythonLogOutputCallback (to DECREF the previous
- // baton) nor can we just remove all traces of a callback, if we want to
- // revert to a file logging mechanism.
-
- // Don't lose the callback reference
- Py_INCREF($input);
- $1 = LLDBSwigPythonCallSBInputReaderCallback;
- $2 = $input;
-}
-
-%typemap(typecheck) (lldb::SBInputReader::Callback callback, void *baton) {
- $1 = $input == Py_None;
- $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input));
-}
// For Log::LogOutputCallback
%typemap(in) (lldb::LogOutputCallback log_callback, void *baton) {
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) {
OpenPOWER on IntegriCloud