diff options
Diffstat (limited to 'include/lldb/Interpreter')
-rw-r--r-- | include/lldb/Interpreter/Args.h | 5 | ||||
-rw-r--r-- | include/lldb/Interpreter/CommandObject.h | 2 | ||||
-rw-r--r-- | include/lldb/Interpreter/OptionGroupValueObjectDisplay.h | 4 | ||||
-rw-r--r-- | include/lldb/Interpreter/OptionValueBoolean.h | 2 | ||||
-rw-r--r-- | include/lldb/Interpreter/OptionValueEnumeration.h | 2 | ||||
-rw-r--r-- | include/lldb/Interpreter/Options.h | 15 | ||||
-rw-r--r-- | include/lldb/Interpreter/PythonDataObjects.h | 2 | ||||
-rw-r--r-- | include/lldb/Interpreter/ScriptInterpreter.h | 124 | ||||
-rw-r--r-- | include/lldb/Interpreter/ScriptInterpreterPython.h | 40 |
9 files changed, 137 insertions, 59 deletions
diff --git a/include/lldb/Interpreter/Args.h b/include/lldb/Interpreter/Args.h index d06c3e56aecd..27feca63e4ad 100644 --- a/include/lldb/Interpreter/Args.h +++ b/include/lldb/Interpreter/Args.h @@ -11,8 +11,6 @@ #define liblldb_Command_h_ // C Includes -#include <getopt.h> - // C++ Includes #include <list> #include <string> @@ -24,6 +22,7 @@ #include "lldb/lldb-private-types.h" #include "lldb/lldb-types.h" #include "lldb/Core/Error.h" +#include "lldb/Host/OptionParser.h" namespace lldb_private { @@ -319,7 +318,7 @@ public: ParseOptions (Options &options); size_t - FindArgumentIndexForOption (struct option *long_options, int long_options_index); + FindArgumentIndexForOption (Option *long_options, int long_options_index); bool IsPositionalArgument (const char *arg); diff --git a/include/lldb/Interpreter/CommandObject.h b/include/lldb/Interpreter/CommandObject.h index 2bfab0a8ecc4..8544fd9f9c3f 100644 --- a/include/lldb/Interpreter/CommandObject.h +++ b/include/lldb/Interpreter/CommandObject.h @@ -42,7 +42,7 @@ public: return (*help_callback)(); } - operator bool() const + explicit operator bool() const { return (help_callback != NULL); } diff --git a/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h b/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h index da05e127d5d1..c09528f9f514 100644 --- a/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h +++ b/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h @@ -62,8 +62,8 @@ public: ignore_cap == true; } - ValueObject::DumpValueObjectOptions - GetAsDumpOptions (bool objc_is_compact = false, + DumpValueObjectOptions + GetAsDumpOptions (LanguageRuntimeDescriptionDisplayVerbosity lang_descr_verbosity = eLanguageRuntimeDescriptionDisplayVerbosityFull, lldb::Format format = lldb::eFormatDefault, lldb::TypeSummaryImplSP summary_sp = lldb::TypeSummaryImplSP()); diff --git a/include/lldb/Interpreter/OptionValueBoolean.h b/include/lldb/Interpreter/OptionValueBoolean.h index 2b935e9e03e6..e024f3a0f3db 100644 --- a/include/lldb/Interpreter/OptionValueBoolean.h +++ b/include/lldb/Interpreter/OptionValueBoolean.h @@ -92,7 +92,7 @@ public: /// /b True this object contains a valid namespace decl, \b /// false otherwise. //------------------------------------------------------------------ - operator bool() const + explicit operator bool() const { return m_current_value; } diff --git a/include/lldb/Interpreter/OptionValueEnumeration.h b/include/lldb/Interpreter/OptionValueEnumeration.h index 012eeb68ac0e..68beddfce0d0 100644 --- a/include/lldb/Interpreter/OptionValueEnumeration.h +++ b/include/lldb/Interpreter/OptionValueEnumeration.h @@ -34,7 +34,7 @@ public: const char *description; }; typedef UniqueCStringMap<EnumeratorInfo> EnumerationMap; - typedef typename EnumerationMap::Entry EnumerationMapEntry; + typedef EnumerationMap::Entry EnumerationMapEntry; OptionValueEnumeration (const OptionEnumValueElement *enumerators, enum_type value); diff --git a/include/lldb/Interpreter/Options.h b/include/lldb/Interpreter/Options.h index ac4daa8f579a..2b4ac1190557 100644 --- a/include/lldb/Interpreter/Options.h +++ b/include/lldb/Interpreter/Options.h @@ -11,7 +11,6 @@ #define liblldb_Options_h_ // C Includes -#include <getopt.h> // C++ Includes #include <set> @@ -141,7 +140,7 @@ public: /// @see Args::ParseOptions (Options&) /// @see man getopt_long_only //------------------------------------------------------------------ - struct option * + Option * GetLongOptions (); // This gets passed the short option as an integer... @@ -309,7 +308,7 @@ protected: typedef std::vector<OptionSet> OptionSetVector; CommandInterpreter &m_interpreter; - std::vector<struct option> m_getopt_table; + std::vector<Option> m_getopt_table; OptionSet m_seen_options; OptionSetVector m_required_options; OptionSetVector m_optional_options; @@ -448,6 +447,12 @@ protected: void Finalize (); + bool + DidFinalize () + { + return m_did_finalize; + } + virtual Error SetOptionValue (uint32_t option_idx, const char *option_arg); @@ -464,6 +469,10 @@ protected: assert (m_did_finalize); return &m_option_defs[0]; } + + const OptionGroup* + GetGroupWithOption (char short_opt); + struct OptionInfo { OptionInfo (OptionGroup* g, uint32_t i) : diff --git a/include/lldb/Interpreter/PythonDataObjects.h b/include/lldb/Interpreter/PythonDataObjects.h index b2c9240db09f..a54318159d14 100644 --- a/include/lldb/Interpreter/PythonDataObjects.h +++ b/include/lldb/Interpreter/PythonDataObjects.h @@ -105,7 +105,7 @@ namespace lldb_private { PythonString Str (); - operator bool () const + explicit operator bool () const { return m_py_obj != NULL; } diff --git a/include/lldb/Interpreter/ScriptInterpreter.h b/include/lldb/Interpreter/ScriptInterpreter.h index 9a66c775d47a..9f529b822910 100644 --- a/include/lldb/Interpreter/ScriptInterpreter.h +++ b/include/lldb/Interpreter/ScriptInterpreter.h @@ -41,7 +41,7 @@ public: return m_object; } - operator bool () + explicit operator bool () { return m_object != NULL; } @@ -108,44 +108,47 @@ public: const char *session_dictionary_name, const lldb::ProcessSP& process_sp); - typedef uint32_t (*SWIGPythonCalculateNumChildren) (void *implementor); - typedef void* (*SWIGPythonGetChildAtIndex) (void *implementor, uint32_t idx); - typedef int (*SWIGPythonGetIndexOfChildWithName) (void *implementor, const char* child_name); - typedef void* (*SWIGPythonCastPyObjectToSBValue) (void* data); - typedef bool (*SWIGPythonUpdateSynthProviderInstance) (void* data); - typedef bool (*SWIGPythonMightHaveChildrenSynthProviderInstance) (void* data); - - - typedef bool (*SWIGPythonCallCommand) (const char *python_function_name, - const char *session_dictionary_name, - lldb::DebuggerSP& debugger, - const char* args, - lldb_private::CommandReturnObject& cmd_retobj); - - 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 uint32_t (*SWIGPythonCalculateNumChildren) (void *implementor); + 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 bool (*SWIGPythonCallCommand) (const char *python_function_name, + const char *session_dictionary_name, + lldb::DebuggerSP& debugger, + const char* args, + lldb_private::CommandReturnObject& cmd_retobj); + + 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 void* (*SWIGPython_GetDynamicSetting) (void* module, + const char* setting, + const lldb::TargetSP& target_sp); typedef enum { @@ -162,7 +165,8 @@ public: eScriptReturnTypeFloat, eScriptReturnTypeDouble, eScriptReturnTypeChar, - eScriptReturnTypeCharStrOrNone + eScriptReturnTypeCharStrOrNone, + eScriptReturnTypeOpaqueObject } ScriptReturnType; ScriptInterpreter (CommandInterpreter &interpreter, lldb::ScriptLanguage script_lang); @@ -336,6 +340,22 @@ public: { return lldb::ScriptInterpreterObjectSP(); } + + virtual lldb::ScriptInterpreterObjectSP + LoadPluginModule (const FileSpec& file_spec, + lldb_private::Error& error) + { + return lldb::ScriptInterpreterObjectSP(); + } + + virtual lldb::ScriptInterpreterObjectSP + GetDynamicSettings (lldb::ScriptInterpreterObjectSP plugin_module_sp, + Target* target, + const char* setting_name, + lldb_private::Error& error) + { + return lldb::ScriptInterpreterObjectSP(); + } virtual bool GenerateFunction(const char *signature, const StringList &input) @@ -473,7 +493,8 @@ public: LoadScriptingModule (const char* filename, bool can_reload, bool init_session, - lldb_private::Error& error) + lldb_private::Error& error, + lldb::ScriptInterpreterObjectSP* module_sp = nullptr) { error.SetErrorString("loading unimplemented"); return false; @@ -501,7 +522,26 @@ public: LanguageToString (lldb::ScriptLanguage language); static void - InitializeInterpreter (SWIGInitCallback python_swig_init_callback); + InitializeInterpreter (SWIGInitCallback python_swig_init_callback, + SWIGBreakpointCallbackFunction swig_breakpoint_callback, + SWIGWatchpointCallbackFunction swig_watchpoint_callback, + SWIGPythonTypeScriptCallbackFunction swig_typescript_callback, + SWIGPythonCreateSyntheticProvider swig_synthetic_script, + SWIGPythonCalculateNumChildren swig_calc_children, + SWIGPythonGetChildAtIndex swig_get_child_index, + SWIGPythonGetIndexOfChildWithName swig_get_index_child, + SWIGPythonCastPyObjectToSBValue swig_cast_to_sbvalue , + SWIGPythonGetValueObjectSPFromSBValue swig_get_valobj_sp_from_sbvalue, + SWIGPythonUpdateSynthProviderInstance swig_update_provider, + SWIGPythonMightHaveChildrenSynthProviderInstance swig_mighthavechildren_provider, + SWIGPythonCallCommand swig_call_command, + SWIGPythonCallModuleInit swig_call_module_init, + SWIGPythonCreateOSPlugin swig_create_os_plugin, + SWIGPythonScriptKeyword_Process swig_run_script_keyword_process, + SWIGPythonScriptKeyword_Thread swig_run_script_keyword_thread, + SWIGPythonScriptKeyword_Target swig_run_script_keyword_target, + SWIGPythonScriptKeyword_Frame swig_run_script_keyword_frame, + SWIGPython_GetDynamicSetting swig_plugin_get); static void TerminateInterpreter (); diff --git a/include/lldb/Interpreter/ScriptInterpreterPython.h b/include/lldb/Interpreter/ScriptInterpreterPython.h index 2616f575d20e..4b3dc61f3ee8 100644 --- a/include/lldb/Interpreter/ScriptInterpreterPython.h +++ b/include/lldb/Interpreter/ScriptInterpreterPython.h @@ -98,6 +98,16 @@ public: lldb::tid_t tid, lldb::addr_t context); + virtual lldb::ScriptInterpreterObjectSP + LoadPluginModule (const FileSpec& file_spec, + lldb_private::Error& error); + + virtual lldb::ScriptInterpreterObjectSP + GetDynamicSettings (lldb::ScriptInterpreterObjectSP plugin_module_sp, + Target* target, + const char* setting_name, + lldb_private::Error& error); + virtual size_t CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor); @@ -200,7 +210,8 @@ public: LoadScriptingModule (const char* filename, bool can_reload, bool init_session, - lldb_private::Error& error); + lldb_private::Error& error, + lldb::ScriptInterpreterObjectSP* module_sp = nullptr); virtual lldb::ScriptInterpreterObjectSP MakeScriptObject (void* object); @@ -239,7 +250,26 @@ public: InitializePrivate (); static void - InitializeInterpreter (SWIGInitCallback python_swig_init_callback); + InitializeInterpreter (SWIGInitCallback python_swig_init_callback, + SWIGBreakpointCallbackFunction swig_breakpoint_callback, + SWIGWatchpointCallbackFunction swig_watchpoint_callback, + SWIGPythonTypeScriptCallbackFunction swig_typescript_callback, + SWIGPythonCreateSyntheticProvider swig_synthetic_script, + SWIGPythonCalculateNumChildren swig_calc_children, + SWIGPythonGetChildAtIndex swig_get_child_index, + SWIGPythonGetIndexOfChildWithName swig_get_index_child, + SWIGPythonCastPyObjectToSBValue swig_cast_to_sbvalue , + SWIGPythonGetValueObjectSPFromSBValue swig_get_valobj_sp_from_sbvalue, + SWIGPythonUpdateSynthProviderInstance swig_update_provider, + SWIGPythonMightHaveChildrenSynthProviderInstance swig_mighthavechildren_provider, + SWIGPythonCallCommand swig_call_command, + SWIGPythonCallModuleInit swig_call_module_init, + SWIGPythonCreateOSPlugin swig_create_os_plugin, + SWIGPythonScriptKeyword_Process swig_run_script_keyword_process, + SWIGPythonScriptKeyword_Thread swig_run_script_keyword_thread, + SWIGPythonScriptKeyword_Target swig_run_script_keyword_target, + SWIGPythonScriptKeyword_Frame swig_run_script_keyword_frame, + SWIGPython_GetDynamicSetting swig_plugin_get); protected: @@ -254,7 +284,7 @@ protected: void RestoreTerminalState (); - + private: class SynchronicityHandler @@ -282,7 +312,7 @@ private: Py_XINCREF(m_object); } - operator bool () + explicit operator bool () { return m_object && m_object != Py_None; } @@ -351,7 +381,7 @@ private: public: PythonInputReaderManager (ScriptInterpreterPython *interpreter); - operator bool() + explicit operator bool() { return m_error; } |