diff options
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h | 258 |
1 files changed, 146 insertions, 112 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h index dc91fd1cb7e..c12cec09df0 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h @@ -40,118 +40,6 @@ public: } }; -#if PY_MAJOR_VERSION >= 3 - typedef PyObject *(*SWIGInitCallback)(void); -#else - typedef void (*SWIGInitCallback)(void); -#endif - - typedef bool (*SWIGBreakpointCallbackFunction)( - const char *python_function_name, const char *session_dictionary_name, - const lldb::StackFrameSP &frame_sp, - const lldb::BreakpointLocationSP &bp_loc_sp); - - typedef bool (*SWIGWatchpointCallbackFunction)( - const char *python_function_name, const char *session_dictionary_name, - const lldb::StackFrameSP &frame_sp, const lldb::WatchpointSP &wp_sp); - - typedef bool (*SWIGPythonTypeScriptCallbackFunction)( - const char *python_function_name, void *session_dictionary, - const lldb::ValueObjectSP &valobj_sp, void **pyfunct_wrapper, - const lldb::TypeSummaryOptionsSP &options, std::string &retval); - - typedef void *(*SWIGPythonCreateSyntheticProvider)( - const char *python_class_name, const char *session_dictionary_name, - const lldb::ValueObjectSP &valobj_sp); - - typedef void *(*SWIGPythonCreateCommandObject)( - const char *python_class_name, const char *session_dictionary_name, - const lldb::DebuggerSP debugger_sp); - - typedef void *(*SWIGPythonCreateScriptedThreadPlan)( - const char *python_class_name, const char *session_dictionary_name, - const lldb::ThreadPlanSP &thread_plan_sp); - - typedef bool (*SWIGPythonCallThreadPlan)(void *implementor, - const char *method_name, - Event *event_sp, bool &got_error); - - typedef void *(*SWIGPythonCreateScriptedBreakpointResolver)( - const char *python_class_name, const char *session_dictionary_name, - lldb_private::StructuredDataImpl *args_impl, - lldb::BreakpointSP &bkpt_sp); - - typedef unsigned int (*SWIGPythonCallBreakpointResolver)(void *implementor, - const char *method_name, - lldb_private::SymbolContext *sym_ctx); - - typedef void *(*SWIGPythonCreateOSPlugin)(const char *python_class_name, - const char *session_dictionary_name, - const lldb::ProcessSP &process_sp); - - typedef void *(*SWIGPythonCreateFrameRecognizer)( - const char *python_class_name, const char *session_dictionary_name); - - typedef void *(*SWIGPythonGetRecognizedArguments)( - void *implementor, const lldb::StackFrameSP &frame_sp); - - typedef size_t (*SWIGPythonCalculateNumChildren)(void *implementor, - uint32_t max); - - typedef void *(*SWIGPythonGetChildAtIndex)(void *implementor, uint32_t idx); - - typedef int (*SWIGPythonGetIndexOfChildWithName)(void *implementor, - const char *child_name); - - typedef void *(*SWIGPythonCastPyObjectToSBValue)(void *data); - - typedef lldb::ValueObjectSP (*SWIGPythonGetValueObjectSPFromSBValue)( - void *data); - - typedef bool (*SWIGPythonUpdateSynthProviderInstance)(void *data); - - typedef bool (*SWIGPythonMightHaveChildrenSynthProviderInstance)(void *data); - - typedef void *(*SWIGPythonGetValueSynthProviderInstance)(void *implementor); - - typedef bool (*SWIGPythonCallCommand)( - const char *python_function_name, const char *session_dictionary_name, - lldb::DebuggerSP &debugger, const char *args, - lldb_private::CommandReturnObject &cmd_retobj, - lldb::ExecutionContextRefSP exe_ctx_ref_sp); - - typedef bool (*SWIGPythonCallCommandObject)( - void *implementor, lldb::DebuggerSP &debugger, const char *args, - lldb_private::CommandReturnObject &cmd_retobj, - lldb::ExecutionContextRefSP exe_ctx_ref_sp); - - typedef bool (*SWIGPythonCallModuleInit)(const char *python_module_name, - const char *session_dictionary_name, - lldb::DebuggerSP &debugger); - - typedef bool (*SWIGPythonScriptKeyword_Process)( - const char *python_function_name, const char *session_dictionary_name, - lldb::ProcessSP &process, std::string &output); - - typedef bool (*SWIGPythonScriptKeyword_Thread)( - const char *python_function_name, const char *session_dictionary_name, - lldb::ThreadSP &thread, std::string &output); - - typedef bool (*SWIGPythonScriptKeyword_Target)( - const char *python_function_name, const char *session_dictionary_name, - lldb::TargetSP &target, std::string &output); - - typedef bool (*SWIGPythonScriptKeyword_Frame)( - const char *python_function_name, const char *session_dictionary_name, - lldb::StackFrameSP &frame, std::string &output); - - typedef bool (*SWIGPythonScriptKeyword_Value)( - const char *python_function_name, const char *session_dictionary_name, - lldb::ValueObjectSP &value, std::string &output); - - typedef void *(*SWIGPython_GetDynamicSetting)( - void *module, const char *setting, const lldb::TargetSP &target_sp); - friend class ::IOHandlerPythonInterpreter; ScriptInterpreterPython(CommandInterpreter &interpreter); @@ -477,7 +365,121 @@ public: PyGILState_STATE m_GILState; }; + // FIXME: This is currently used from the InitializePythonRAII. Make this + // private when we're able to break the dependency. +#if PY_MAJOR_VERSION >= 3 + typedef PyObject *(*SWIGInitCallback)(void); +#else + typedef void (*SWIGInitCallback)(void); +#endif + static SWIGInitCallback g_swig_init_callback; + protected: + typedef bool (*SWIGBreakpointCallbackFunction)( + const char *python_function_name, const char *session_dictionary_name, + const lldb::StackFrameSP &frame_sp, + const lldb::BreakpointLocationSP &bp_loc_sp); + + typedef bool (*SWIGWatchpointCallbackFunction)( + const char *python_function_name, const char *session_dictionary_name, + const lldb::StackFrameSP &frame_sp, const lldb::WatchpointSP &wp_sp); + + typedef bool (*SWIGPythonTypeScriptCallbackFunction)( + const char *python_function_name, void *session_dictionary, + const lldb::ValueObjectSP &valobj_sp, void **pyfunct_wrapper, + const lldb::TypeSummaryOptionsSP &options, std::string &retval); + + typedef void *(*SWIGPythonCreateSyntheticProvider)( + const char *python_class_name, const char *session_dictionary_name, + const lldb::ValueObjectSP &valobj_sp); + + typedef void *(*SWIGPythonCreateCommandObject)( + const char *python_class_name, const char *session_dictionary_name, + const lldb::DebuggerSP debugger_sp); + + typedef void *(*SWIGPythonCreateScriptedThreadPlan)( + const char *python_class_name, const char *session_dictionary_name, + const lldb::ThreadPlanSP &thread_plan_sp); + + typedef bool (*SWIGPythonCallThreadPlan)(void *implementor, + const char *method_name, + Event *event_sp, bool &got_error); + + typedef void *(*SWIGPythonCreateScriptedBreakpointResolver)( + const char *python_class_name, const char *session_dictionary_name, + lldb_private::StructuredDataImpl *args_impl, lldb::BreakpointSP &bkpt_sp); + + typedef unsigned int (*SWIGPythonCallBreakpointResolver)( + void *implementor, const char *method_name, + lldb_private::SymbolContext *sym_ctx); + + typedef void *(*SWIGPythonCreateOSPlugin)(const char *python_class_name, + const char *session_dictionary_name, + const lldb::ProcessSP &process_sp); + + typedef void *(*SWIGPythonCreateFrameRecognizer)( + const char *python_class_name, const char *session_dictionary_name); + + typedef void *(*SWIGPythonGetRecognizedArguments)( + void *implementor, const lldb::StackFrameSP &frame_sp); + + typedef size_t (*SWIGPythonCalculateNumChildren)(void *implementor, + uint32_t max); + + typedef void *(*SWIGPythonGetChildAtIndex)(void *implementor, uint32_t idx); + + typedef int (*SWIGPythonGetIndexOfChildWithName)(void *implementor, + const char *child_name); + + typedef void *(*SWIGPythonCastPyObjectToSBValue)(void *data); + + typedef lldb::ValueObjectSP (*SWIGPythonGetValueObjectSPFromSBValue)( + void *data); + + typedef bool (*SWIGPythonUpdateSynthProviderInstance)(void *data); + + typedef bool (*SWIGPythonMightHaveChildrenSynthProviderInstance)(void *data); + + typedef void *(*SWIGPythonGetValueSynthProviderInstance)(void *implementor); + + typedef bool (*SWIGPythonCallCommand)( + const char *python_function_name, const char *session_dictionary_name, + lldb::DebuggerSP &debugger, const char *args, + lldb_private::CommandReturnObject &cmd_retobj, + lldb::ExecutionContextRefSP exe_ctx_ref_sp); + + typedef bool (*SWIGPythonCallCommandObject)( + void *implementor, lldb::DebuggerSP &debugger, const char *args, + lldb_private::CommandReturnObject &cmd_retobj, + lldb::ExecutionContextRefSP exe_ctx_ref_sp); + + typedef bool (*SWIGPythonCallModuleInit)(const char *python_module_name, + const char *session_dictionary_name, + lldb::DebuggerSP &debugger); + + typedef bool (*SWIGPythonScriptKeyword_Process)( + const char *python_function_name, const char *session_dictionary_name, + lldb::ProcessSP &process, std::string &output); + + typedef bool (*SWIGPythonScriptKeyword_Thread)( + const char *python_function_name, const char *session_dictionary_name, + lldb::ThreadSP &thread, std::string &output); + + typedef bool (*SWIGPythonScriptKeyword_Target)( + const char *python_function_name, const char *session_dictionary_name, + lldb::TargetSP &target, std::string &output); + + typedef bool (*SWIGPythonScriptKeyword_Frame)( + const char *python_function_name, const char *session_dictionary_name, + lldb::StackFrameSP &frame, std::string &output); + + typedef bool (*SWIGPythonScriptKeyword_Value)( + const char *python_function_name, const char *session_dictionary_name, + lldb::ValueObjectSP &value, std::string &output); + + typedef void *(*SWIGPython_GetDynamicSetting)( + void *module, const char *setting, const lldb::TargetSP &target_sp); + static void InitializePrivate(); static void InitializeInterpreter( @@ -585,6 +587,38 @@ protected: bool m_valid_session; uint32_t m_lock_count; PyThreadState *m_command_thread_state; + + static SWIGBreakpointCallbackFunction g_swig_breakpoint_callback; + static SWIGWatchpointCallbackFunction g_swig_watchpoint_callback; + static SWIGPythonTypeScriptCallbackFunction g_swig_typescript_callback; + static SWIGPythonCreateSyntheticProvider g_swig_synthetic_script; + static SWIGPythonCreateCommandObject g_swig_create_cmd; + static SWIGPythonCalculateNumChildren g_swig_calc_children; + static SWIGPythonGetChildAtIndex g_swig_get_child_index; + static SWIGPythonGetIndexOfChildWithName g_swig_get_index_child; + static SWIGPythonCastPyObjectToSBValue g_swig_cast_to_sbvalue; + static SWIGPythonGetValueObjectSPFromSBValue + g_swig_get_valobj_sp_from_sbvalue; + static SWIGPythonUpdateSynthProviderInstance g_swig_update_provider; + static SWIGPythonMightHaveChildrenSynthProviderInstance + g_swig_mighthavechildren_provider; + static SWIGPythonGetValueSynthProviderInstance g_swig_getvalue_provider; + static SWIGPythonCallCommand g_swig_call_command; + static SWIGPythonCallCommandObject g_swig_call_command_object; + static SWIGPythonCallModuleInit g_swig_call_module_init; + static SWIGPythonCreateOSPlugin g_swig_create_os_plugin; + static SWIGPythonCreateFrameRecognizer g_swig_create_frame_recognizer; + static SWIGPythonGetRecognizedArguments g_swig_get_recognized_arguments; + static SWIGPythonScriptKeyword_Process g_swig_run_script_keyword_process; + static SWIGPythonScriptKeyword_Thread g_swig_run_script_keyword_thread; + static SWIGPythonScriptKeyword_Target g_swig_run_script_keyword_target; + static SWIGPythonScriptKeyword_Frame g_swig_run_script_keyword_frame; + static SWIGPythonScriptKeyword_Value g_swig_run_script_keyword_value; + static SWIGPython_GetDynamicSetting g_swig_plugin_get; + static SWIGPythonCreateScriptedThreadPlan g_swig_thread_plan_script; + static SWIGPythonCallThreadPlan g_swig_call_thread_plan; + static SWIGPythonCreateScriptedBreakpointResolver g_swig_bkpt_resolver_script; + static SWIGPythonCallBreakpointResolver g_swig_call_bkpt_resolver; }; } // namespace lldb_private |