diff options
Diffstat (limited to 'include/lldb/Interpreter/ScriptInterpreterPython.h')
-rw-r--r-- | include/lldb/Interpreter/ScriptInterpreterPython.h | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/include/lldb/Interpreter/ScriptInterpreterPython.h b/include/lldb/Interpreter/ScriptInterpreterPython.h index ba53280..14a62d6 100644 --- a/include/lldb/Interpreter/ScriptInterpreterPython.h +++ b/include/lldb/Interpreter/ScriptInterpreterPython.h @@ -24,6 +24,8 @@ #include "lldb/Interpreter/PythonDataObjects.h" #include "lldb/Host/Terminal.h" +class IOHandlerPythonInterpreter; + namespace lldb_private { class ScriptInterpreterPython : @@ -56,7 +58,7 @@ public: ExecuteMultipleLines (const char *in_string, const ExecuteScriptOptions &options = ExecuteScriptOptions()); - bool + Error ExportFunctionDefinitionToInterpreter (StringList &function_def); bool @@ -130,10 +132,10 @@ public: lldb_private::CommandReturnObject& cmd_retobj, Error& error); - bool + Error GenerateFunction(const char *signature, const StringList &input); - bool + Error GenerateBreakpointCommandCallbackData (StringList &input, std::string& output); bool @@ -170,6 +172,9 @@ public: lldb::ScriptInterpreterObjectSP& callee_wrapper_sp, std::string& retval); + virtual void + Clear (); + virtual bool GetDocumentationForItem (const char* item, std::string& dest); @@ -220,17 +225,21 @@ public: AcquireInterpreterLock (); void - CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options, + CollectDataForBreakpointCommandCallback (std::vector<BreakpointOptions *> &bp_options_vec, CommandReturnObject &result); void CollectDataForWatchpointCommandCallback (WatchpointOptions *wp_options, CommandReturnObject &result); - /// Set a Python one-liner as the callback for the breakpoint. - void + /// Set the callback body text into the callback for the breakpoint. + Error SetBreakpointCommandCallback (BreakpointOptions *bp_options, - const char *oneliner); + const char *callback_body); + + void + SetBreakpointCommandCallbackFunction (BreakpointOptions *bp_options, + const char *function_name); /// Set a one-liner as the callback for the watchpoint. void @@ -275,6 +284,19 @@ public: } + PyThreadState * + GetThreadState() + { + return m_command_thread_state; + } + + void + SetThreadState (PyThreadState *s) + { + if (s) + m_command_thread_state = s; + } + //---------------------------------------------------------------------- // IOHandlerDelegate //---------------------------------------------------------------------- @@ -335,7 +357,8 @@ protected: virtual ~ScriptInterpreterPythonObject() { - Py_XDECREF(m_object); + if (Py_IsInitialized()) + Py_XDECREF(m_object); m_object = NULL; } private: @@ -392,7 +415,7 @@ public: // FILE* m_tmp_fh; PyGILState_STATE m_GILState; }; -private: +protected: enum ActiveIOHandler { eIOHandlerNone, |