summaryrefslogtreecommitdiff
path: root/include/lldb/Interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Interpreter')
-rw-r--r--include/lldb/Interpreter/Args.h4
-rw-r--r--include/lldb/Interpreter/CommandInterpreter.h243
-rw-r--r--include/lldb/Interpreter/CommandObject.h7
-rw-r--r--include/lldb/Interpreter/CommandObjectRegexCommand.h15
-rw-r--r--include/lldb/Interpreter/OptionGroupValueObjectDisplay.h19
-rw-r--r--include/lldb/Interpreter/OptionValue.h47
-rw-r--r--include/lldb/Interpreter/OptionValueChar.h113
-rw-r--r--include/lldb/Interpreter/OptionValueProperties.h14
-rw-r--r--include/lldb/Interpreter/OptionValues.h1
-rw-r--r--include/lldb/Interpreter/Property.h5
-rw-r--r--include/lldb/Interpreter/ScriptInterpreter.h76
-rw-r--r--include/lldb/Interpreter/ScriptInterpreterPython.h35
12 files changed, 516 insertions, 63 deletions
diff --git a/include/lldb/Interpreter/Args.h b/include/lldb/Interpreter/Args.h
index 06617f1e59268..1071bd6fd0471 100644
--- a/include/lldb/Interpreter/Args.h
+++ b/include/lldb/Interpreter/Args.h
@@ -394,7 +394,9 @@ public:
static bool
StringToBoolean (const char *s, bool fail_value, bool *success_ptr);
-
+
+ static char StringToChar(const char *s, char fail_value, bool *success_ptr);
+
static int64_t
StringToOptionEnum (const char *s, OptionEnumValueElement *enum_values, int32_t fail_value, Error &error);
diff --git a/include/lldb/Interpreter/CommandInterpreter.h b/include/lldb/Interpreter/CommandInterpreter.h
index c33d71a6dbbb7..baaa271a42856 100644
--- a/include/lldb/Interpreter/CommandInterpreter.h
+++ b/include/lldb/Interpreter/CommandInterpreter.h
@@ -28,12 +28,179 @@
namespace lldb_private {
+class CommandInterpreterRunOptions
+{
+public:
+ //------------------------------------------------------------------
+ /// Construct a CommandInterpreterRunOptions object.
+ /// This class is used to control all the instances where we run multiple commands, e.g.
+ /// HandleCommands, HandleCommandsFromFile, RunCommandInterpreter.
+ /// The meanings of the options in this object are:
+ ///
+ /// @param[in] stop_on_continue
+ /// If \b true execution will end on the first command that causes the process in the
+ /// execution context to continue. If \false, we won't check the execution status.
+ /// @param[in] stop_on_error
+ /// If \b true execution will end on the first command that causes an error.
+ /// @param[in] stop_on_crash
+ /// If \b true when a command causes the target to run, and the end of the run is a
+ /// signal or exception, stop executing the commands.
+ /// @param[in] echo_commands
+ /// If \b true echo the command before executing it. If \false, execute silently.
+ /// @param[in] print_results
+ /// If \b true print the results of the command after executing it. If \false, execute silently.
+ /// @param[in] add_to_history
+ /// If \b true add the commands to the command history. If \false, don't add them.
+ //------------------------------------------------------------------
+ CommandInterpreterRunOptions (LazyBool stop_on_continue,
+ LazyBool stop_on_error,
+ LazyBool stop_on_crash,
+ LazyBool echo_commands,
+ LazyBool print_results,
+ LazyBool add_to_history) :
+ m_stop_on_continue(stop_on_continue),
+ m_stop_on_error(stop_on_error),
+ m_stop_on_crash(stop_on_crash),
+ m_echo_commands(echo_commands),
+ m_print_results(print_results),
+ m_add_to_history(add_to_history)
+ {}
+
+ CommandInterpreterRunOptions () :
+ m_stop_on_continue(eLazyBoolCalculate),
+ m_stop_on_error(eLazyBoolCalculate),
+ m_stop_on_crash(eLazyBoolCalculate),
+ m_echo_commands(eLazyBoolCalculate),
+ m_print_results(eLazyBoolCalculate),
+ m_add_to_history(eLazyBoolCalculate)
+ {}
+
+ void
+ SetSilent (bool silent)
+ {
+ LazyBool value = silent ? eLazyBoolNo : eLazyBoolYes;
+
+ m_echo_commands = value;
+ m_print_results = value;
+ m_add_to_history = value;
+ }
+ // These return the default behaviors if the behavior is not eLazyBoolCalculate.
+ // But I've also left the ivars public since for different ways of running the
+ // interpreter you might want to force different defaults... In that case, just grab
+ // the LazyBool ivars directly and do what you want with eLazyBoolCalculate.
+ bool
+ GetStopOnContinue () const
+ {
+ return DefaultToNo (m_stop_on_continue);
+ }
+
+ void
+ SetStopOnContinue (bool stop_on_continue)
+ {
+ m_stop_on_continue = stop_on_continue ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool
+ GetStopOnError () const
+ {
+ return DefaultToNo (m_stop_on_continue);
+ }
+
+ void
+ SetStopOnError (bool stop_on_error)
+ {
+ m_stop_on_error = stop_on_error ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool
+ GetStopOnCrash () const
+ {
+ return DefaultToNo (m_stop_on_crash);
+ }
+
+ void
+ SetStopOnCrash (bool stop_on_crash)
+ {
+ m_stop_on_crash = stop_on_crash ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool
+ GetEchoCommands () const
+ {
+ return DefaultToYes (m_echo_commands);
+ }
+
+ void
+ SetEchoCommands (bool echo_commands)
+ {
+ m_echo_commands = echo_commands ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool
+ GetPrintResults () const
+ {
+ return DefaultToYes (m_print_results);
+ }
+
+ void
+ SetPrintResults (bool print_results)
+ {
+ m_print_results = print_results ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ bool
+ GetAddToHistory () const
+ {
+ return DefaultToYes (m_add_to_history);
+ }
+
+ void
+ SetAddToHistory (bool add_to_history)
+ {
+ m_add_to_history = add_to_history ? eLazyBoolYes : eLazyBoolNo;
+ }
+
+ LazyBool m_stop_on_continue;
+ LazyBool m_stop_on_error;
+ LazyBool m_stop_on_crash;
+ LazyBool m_echo_commands;
+ LazyBool m_print_results;
+ LazyBool m_add_to_history;
+
+ private:
+ static bool
+ DefaultToYes (LazyBool flag)
+ {
+ switch (flag)
+ {
+ case eLazyBoolNo:
+ return false;
+ default:
+ return true;
+ }
+ }
+
+ static bool
+ DefaultToNo (LazyBool flag)
+ {
+ switch (flag)
+ {
+ case eLazyBoolYes:
+ return true;
+ default:
+ return false;
+ }
+ }
+};
+
class CommandInterpreter :
public Broadcaster,
public Properties,
public IOHandlerDelegate
{
public:
+
+
typedef std::map<std::string, OptionArgVectorSP> OptionArgMap;
enum
@@ -115,6 +282,10 @@ public:
AddAlias (const char *alias_name,
lldb::CommandObjectSP& command_obj_sp);
+ // Remove a command if it is removable (python or regex command)
+ bool
+ RemoveCommand (const char *cmd);
+
bool
RemoveAlias (const char *alias_name);
@@ -168,27 +339,17 @@ public:
/// @param[in/out] context
/// The execution context in which to run the commands. Can be NULL in which case the default
/// context will be used.
- /// @param[in] stop_on_continue
- /// If \b true execution will end on the first command that causes the process in the
- /// execution context to continue. If \false, we won't check the execution status.
- /// @param[in] stop_on_error
- /// If \b true execution will end on the first command that causes an error.
- /// @param[in] echo_commands
- /// If \b true echo the command before executing it. If \false, execute silently.
- /// @param[in] print_results
- /// If \b true print the results of the command after executing it. If \false, execute silently.
- /// @param[out] result
+ /// @param[in] options
+ /// This object holds the options used to control when to stop, whether to execute commands,
+ /// etc.
+ /// @param[out] result
/// This is marked as succeeding with no output if all commands execute safely,
/// and failed with some explanation if we aborted executing the commands at some point.
//------------------------------------------------------------------
void
HandleCommands (const StringList &commands,
- ExecutionContext *context,
- bool stop_on_continue,
- bool stop_on_error,
- bool echo_commands,
- bool print_results,
- LazyBool add_to_history,
+ ExecutionContext *context,
+ CommandInterpreterRunOptions &options,
CommandReturnObject &result);
//------------------------------------------------------------------
@@ -199,27 +360,17 @@ public:
/// @param[in/out] context
/// The execution context in which to run the commands. Can be NULL in which case the default
/// context will be used.
- /// @param[in] stop_on_continue
- /// If \b true execution will end on the first command that causes the process in the
- /// execution context to continue. If \false, we won't check the execution status.
- /// @param[in] stop_on_error
- /// If \b true execution will end on the first command that causes an error.
- /// @param[in] echo_commands
- /// If \b true echo the command before executing it. If \false, execute silently.
- /// @param[in] print_results
- /// If \b true print the results of the command after executing it. If \false, execute silently.
- /// @param[out] result
+ /// @param[in] options
+ /// This object holds the options used to control when to stop, whether to execute commands,
+ /// etc.
+ /// @param[out] result
/// This is marked as succeeding with no output if all commands execute safely,
/// and failed with some explanation if we aborted executing the commands at some point.
//------------------------------------------------------------------
void
HandleCommandsFromFile (FileSpec &file,
- ExecutionContext *context,
- LazyBool stop_on_continue,
- LazyBool stop_on_error,
- LazyBool echo_commands,
- LazyBool print_results,
- LazyBool add_to_history,
+ ExecutionContext *context,
+ CommandInterpreterRunOptions &options,
CommandReturnObject &result);
CommandObject *
@@ -442,8 +593,8 @@ public:
void
RunCommandInterpreter (bool auto_handle_events,
- bool spawn_thread);
-
+ bool spawn_thread,
+ CommandInterpreterRunOptions &options);
void
GetLLDBCommandsFromIOHandler (const char *prompt,
IOHandlerDelegate &delegate,
@@ -467,6 +618,27 @@ public:
bool
GetStopCmdSourceOnError () const;
+
+ uint32_t
+ GetNumErrors() const
+ {
+ return m_num_errors;
+ }
+
+ bool
+ GetQuitRequested () const
+ {
+ return m_quit_requested;
+ }
+
+ lldb::IOHandlerSP
+ GetIOHandler(bool force_create = false, CommandInterpreterRunOptions *options = NULL);
+
+ bool
+ GetStoppedForCrash () const
+ {
+ return m_stopped_for_crash;
+ }
protected:
friend class Debugger;
@@ -522,6 +694,9 @@ private:
ChildrenTruncatedWarningStatus m_truncation_warning; // Whether we truncated children and whether the user has been told
uint32_t m_command_source_depth;
std::vector<uint32_t> m_command_source_flags;
+ uint32_t m_num_errors;
+ bool m_quit_requested;
+ bool m_stopped_for_crash;
};
diff --git a/include/lldb/Interpreter/CommandObject.h b/include/lldb/Interpreter/CommandObject.h
index 7bdf55a393d72..bace3264dafa6 100644
--- a/include/lldb/Interpreter/CommandObject.h
+++ b/include/lldb/Interpreter/CommandObject.h
@@ -525,6 +525,11 @@ protected:
return "invalid frame, no registers";
}
+ // This is for use in the command interpreter, when you either want the selected target, or if no target
+ // is present you want to prime the dummy target with entities that will be copied over to new targets.
+ Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
+ Target *GetDummyTarget();
+
//------------------------------------------------------------------
/// Check the command to make sure anything required by this
/// command is available.
@@ -605,7 +610,7 @@ public:
virtual bool
Execute (const char *args_string, CommandReturnObject &result);
-
+
protected:
virtual bool
DoExecute (const char *command, CommandReturnObject &result) = 0;
diff --git a/include/lldb/Interpreter/CommandObjectRegexCommand.h b/include/lldb/Interpreter/CommandObjectRegexCommand.h
index 8855680d5f8bb..d865446387765 100644
--- a/include/lldb/Interpreter/CommandObjectRegexCommand.h
+++ b/include/lldb/Interpreter/CommandObjectRegexCommand.h
@@ -34,12 +34,16 @@ public:
const char *help,
const char *syntax,
uint32_t max_matches,
- uint32_t completion_type_mask = 0);
+ uint32_t completion_type_mask,
+ bool is_removable);
virtual
~CommandObjectRegexCommand ();
bool
+ IsRemovable () const override { return m_is_removable; }
+
+ bool
AddRegexCommand (const char *re_cstr, const char *command_cstr);
bool
@@ -48,18 +52,18 @@ public:
return !m_entries.empty();
}
- virtual int
+ int
HandleCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
int match_start_point,
int max_return_elements,
bool &word_complete,
- StringList &matches);
+ StringList &matches) override;
protected:
- virtual bool
- DoExecute (const char *command, CommandReturnObject &result);
+ bool
+ DoExecute (const char *command, CommandReturnObject &result) override;
struct Entry
{
@@ -71,6 +75,7 @@ protected:
const uint32_t m_max_matches;
const uint32_t m_completion_type_mask;
EntryCollection m_entries;
+ bool m_is_removable;
private:
DISALLOW_COPY_AND_ASSIGN (CommandObjectRegexCommand);
diff --git a/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h b/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
index c09528f9f5143..5cce126f89bf6 100644
--- a/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
+++ b/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
@@ -59,7 +59,8 @@ public:
ptr_depth != 0 ||
use_synth == false ||
be_raw == true ||
- ignore_cap == true;
+ ignore_cap == true ||
+ run_validator == true;
}
DumpValueObjectOptions
@@ -67,17 +68,19 @@ public:
lldb::Format format = lldb::eFormatDefault,
lldb::TypeSummaryImplSP summary_sp = lldb::TypeSummaryImplSP());
- bool show_types;
+ bool show_types : 1,
+ show_location : 1,
+ flat_output : 1,
+ use_objc : 1,
+ use_synth : 1,
+ be_raw : 1,
+ ignore_cap : 1,
+ run_validator : 1;
+
uint32_t no_summary_depth;
- bool show_location;
- bool flat_output;
- bool use_objc;
uint32_t max_depth;
uint32_t ptr_depth;
lldb::DynamicValueType use_dynamic;
- bool use_synth;
- bool be_raw;
- bool ignore_cap;
};
} // namespace lldb_private
diff --git a/include/lldb/Interpreter/OptionValue.h b/include/lldb/Interpreter/OptionValue.h
index 33e7fc5f818b3..0e8f23453a8aa 100644
--- a/include/lldb/Interpreter/OptionValue.h
+++ b/include/lldb/Interpreter/OptionValue.h
@@ -26,12 +26,14 @@ namespace lldb_private {
class OptionValue
{
public:
- typedef enum {
+ typedef enum
+ {
eTypeInvalid = 0,
eTypeArch,
eTypeArgs,
eTypeArray,
eTypeBoolean,
+ eTypeChar,
eTypeDictionary,
eTypeEnum,
eTypeFileSpec,
@@ -41,11 +43,11 @@ namespace lldb_private {
eTypeProperties,
eTypeRegex,
eTypeSInt64,
- eTypeString,
+ eTypeString,
eTypeUInt64,
eTypeUUID
} Type;
-
+
enum {
eDumpOptionName = (1u << 0),
eDumpOptionType = (1u << 1),
@@ -58,11 +60,15 @@ namespace lldb_private {
OptionValue () :
+ m_callback (nullptr),
+ m_baton(nullptr),
m_value_was_set (false)
{
}
OptionValue (const OptionValue &rhs) :
+ m_callback (rhs.m_callback),
+ m_baton (rhs.m_baton),
m_value_was_set (rhs.m_value_was_set)
{
}
@@ -173,6 +179,7 @@ namespace lldb_private {
case 1u << eTypeArgs: return eTypeArgs;
case 1u << eTypeArray: return eTypeArray;
case 1u << eTypeBoolean: return eTypeBoolean;
+ case 1u << eTypeChar: return eTypeChar;
case 1u << eTypeDictionary: return eTypeDictionary;
case 1u << eTypeEnum: return eTypeEnum;
case 1u << eTypeFileSpec: return eTypeFileSpec;
@@ -221,10 +228,16 @@ namespace lldb_private {
OptionValueBoolean *
GetAsBoolean ();
-
+
+ OptionValueChar *
+ GetAsChar ();
+
const OptionValueBoolean *
GetAsBoolean () const;
-
+
+ const OptionValueChar *
+ GetAsChar () const;
+
OptionValueDictionary *
GetAsDictionary ();
@@ -302,7 +315,11 @@ namespace lldb_private {
bool
SetBooleanValue (bool new_value);
-
+
+ char GetCharValue(char fail_value) const;
+
+ char SetCharValue(char new_value);
+
int64_t
GetEnumerationValue (int64_t fail_value = -1) const;
@@ -368,8 +385,26 @@ namespace lldb_private {
{
m_parent_wp = parent_sp;
}
+
+ void
+ SetValueChangedCallback (OptionValueChangedCallback callback,
+ void *baton)
+ {
+ assert (m_callback == NULL);
+ m_callback = callback;
+ m_baton = baton;
+ }
+
+ void
+ NotifyValueChanged ()
+ {
+ if (m_callback)
+ m_callback (m_baton, this);
+ }
protected:
lldb::OptionValueWP m_parent_wp;
+ OptionValueChangedCallback m_callback;
+ void *m_baton;
bool m_value_was_set; // This can be used to see if a value has been set
// by a call to SetValueFromCString(). It is often
// handy to know if an option value was set from
diff --git a/include/lldb/Interpreter/OptionValueChar.h b/include/lldb/Interpreter/OptionValueChar.h
new file mode 100644
index 0000000000000..55f4b63538eae
--- /dev/null
+++ b/include/lldb/Interpreter/OptionValueChar.h
@@ -0,0 +1,113 @@
+//===-- OptionValueBoolean.h ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueChar_h_
+#define liblldb_OptionValueChar_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueChar : public OptionValue
+{
+public:
+ OptionValueChar (char value) :
+ OptionValue(),
+ m_current_value (value),
+ m_default_value (value)
+ {
+ }
+ OptionValueChar (char current_value,
+ char default_value) :
+ OptionValue(),
+ m_current_value (current_value),
+ m_default_value (default_value)
+ {
+ }
+
+ virtual
+ ~OptionValueChar()
+ {
+ }
+
+ //---------------------------------------------------------------------
+ // Virtual subclass pure virtual overrides
+ //---------------------------------------------------------------------
+
+ virtual OptionValue::Type
+ GetType () const
+ {
+ return eTypeChar;
+ }
+
+ virtual void
+ DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+
+ virtual Error
+ SetValueFromCString (const char *value,
+ VarSetOperationType op = eVarSetOperationAssign);
+
+ virtual bool
+ Clear ()
+ {
+ m_current_value = m_default_value;
+ m_value_was_set = false;
+ return true;
+ }
+
+ //---------------------------------------------------------------------
+ // Subclass specific functions
+ //---------------------------------------------------------------------
+
+ const char &
+ operator = (char c)
+ {
+ m_current_value = c;
+ return m_current_value;
+ }
+
+ char
+ GetCurrentValue() const
+ {
+ return m_current_value;
+ }
+
+ char
+ GetDefaultValue() const
+ {
+ return m_default_value;
+ }
+
+ void
+ SetCurrentValue (char value)
+ {
+ m_current_value = value;
+ }
+
+ void
+ SetDefaultValue (char value)
+ {
+ m_default_value = value;
+ }
+
+ virtual lldb::OptionValueSP
+ DeepCopy () const;
+
+protected:
+ char m_current_value;
+ char m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_OptionValueChar_h_
diff --git a/include/lldb/Interpreter/OptionValueProperties.h b/include/lldb/Interpreter/OptionValueProperties.h
index 0024f20e2ff6e..a67ea5d66e54e 100644
--- a/include/lldb/Interpreter/OptionValueProperties.h
+++ b/include/lldb/Interpreter/OptionValueProperties.h
@@ -243,8 +243,20 @@ public:
GetSubProperty (const ExecutionContext *exe_ctx,
const ConstString &name);
+ void
+ SetValueChangedCallback (uint32_t property_idx,
+ OptionValueChangedCallback callback,
+ void *baton);
protected:
-
+
+ Property *
+ ProtectedGetPropertyAtIndex (uint32_t idx)
+ {
+ if (idx < m_properties.size())
+ return &m_properties[idx];
+ return NULL;
+ }
+
const Property *
ProtectedGetPropertyAtIndex (uint32_t idx) const
{
diff --git a/include/lldb/Interpreter/OptionValues.h b/include/lldb/Interpreter/OptionValues.h
index 41b9d2e351f4d..c66fc4dab2f6b 100644
--- a/include/lldb/Interpreter/OptionValues.h
+++ b/include/lldb/Interpreter/OptionValues.h
@@ -15,6 +15,7 @@
#include "lldb/Interpreter/OptionValueArgs.h"
#include "lldb/Interpreter/OptionValueArray.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueChar.h"
#include "lldb/Interpreter/OptionValueDictionary.h"
#include "lldb/Interpreter/OptionValueEnumeration.h"
#include "lldb/Interpreter/OptionValueFileSpec.h"
diff --git a/include/lldb/Interpreter/Property.h b/include/lldb/Interpreter/Property.h
index b192758cbc415..cb4c827ded062 100644
--- a/include/lldb/Interpreter/Property.h
+++ b/include/lldb/Interpreter/Property.h
@@ -29,7 +29,7 @@ namespace lldb_private {
{
const char *name;
OptionValue::Type type;
- bool global;
+ bool global; // false == this setting is a global setting by default
uintptr_t default_uint_value;
const char *default_cstr_value;
OptionEnumValueElement *enum_values;
@@ -97,6 +97,9 @@ namespace lldb_private {
uint32_t output_width,
bool display_qualified_name) const;
+ void
+ SetValueChangedCallback (OptionValueChangedCallback callback, void *baton);
+
protected:
ConstString m_name;
ConstString m_description;
diff --git a/include/lldb/Interpreter/ScriptInterpreter.h b/include/lldb/Interpreter/ScriptInterpreter.h
index 5a8322f8eb4f6..35ba9491ded01 100644
--- a/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/include/lldb/Interpreter/ScriptInterpreter.h
@@ -98,12 +98,19 @@ public:
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* (*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* (*SWIGPythonCreateOSPlugin) (const char *python_class_name,
const char *session_dictionary_name,
const lldb::ProcessSP& process_sp);
@@ -115,13 +122,14 @@ public:
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_private::CommandReturnObject& cmd_retobj,
+ lldb::ExecutionContextRefSP exe_ctx_ref_sp);
typedef bool (*SWIGPythonCallModuleInit) (const char *python_module_name,
const char *session_dictionary_name,
@@ -145,6 +153,11 @@ public:
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,
@@ -348,6 +361,39 @@ public:
}
virtual lldb::ScriptInterpreterObjectSP
+ CreateScriptedThreadPlan (const char *class_name,
+ lldb::ThreadPlanSP thread_plan_sp)
+ {
+ return lldb::ScriptInterpreterObjectSP();
+ }
+
+ virtual bool
+ ScriptedThreadPlanExplainsStop (lldb::ScriptInterpreterObjectSP implementor_sp,
+ Event *event,
+ bool &script_error)
+ {
+ script_error = true;
+ return true;
+ }
+
+ virtual bool
+ ScriptedThreadPlanShouldStop (lldb::ScriptInterpreterObjectSP implementor_sp,
+ Event *event,
+ bool &script_error)
+ {
+ script_error = true;
+ return true;
+ }
+
+ virtual lldb::StateType
+ ScriptedThreadPlanGetRunState (lldb::ScriptInterpreterObjectSP implementor_sp,
+ bool &script_error)
+ {
+ script_error = true;
+ return lldb::eStateStepping;
+ }
+
+ virtual lldb::ScriptInterpreterObjectSP
LoadPluginModule (const FileSpec& file_spec,
lldb_private::Error& error)
{
@@ -417,6 +463,7 @@ public:
GetScriptedSummary (const char *function_name,
lldb::ValueObjectSP valobj,
lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
+ const TypeSummaryOptions& options,
std::string& retval)
{
return false;
@@ -458,12 +505,19 @@ public:
return true;
}
+ virtual lldb::ValueObjectSP
+ GetSyntheticValue (const lldb::ScriptInterpreterObjectSP& implementor)
+ {
+ return nullptr;
+ }
+
virtual bool
RunScriptBasedCommand (const char* impl_function,
const char* args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject& cmd_retobj,
- Error& error)
+ Error& error,
+ const lldb_private::ExecutionContext& exe_ctx)
{
return false;
}
@@ -509,6 +563,16 @@ public:
}
virtual bool
+ RunScriptFormatKeyword (const char* impl_function,
+ ValueObject* value,
+ std::string& output,
+ Error& error)
+ {
+ error.SetErrorString("unimplemented");
+ return false;
+ }
+
+ virtual bool
GetDocumentationForItem (const char* item, std::string& dest)
{
dest.clear();
@@ -566,6 +630,7 @@ public:
SWIGPythonGetValueObjectSPFromSBValue swig_get_valobj_sp_from_sbvalue,
SWIGPythonUpdateSynthProviderInstance swig_update_provider,
SWIGPythonMightHaveChildrenSynthProviderInstance swig_mighthavechildren_provider,
+ SWIGPythonGetValueSynthProviderInstance swig_getvalue_provider,
SWIGPythonCallCommand swig_call_command,
SWIGPythonCallModuleInit swig_call_module_init,
SWIGPythonCreateOSPlugin swig_create_os_plugin,
@@ -573,7 +638,10 @@ public:
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);
+ SWIGPythonScriptKeyword_Value swig_run_script_keyword_value,
+ SWIGPython_GetDynamicSetting swig_plugin_get,
+ SWIGPythonCreateScriptedThreadPlan swig_thread_plan_script,
+ SWIGPythonCallThreadPlan swig_call_thread_plan);
virtual void
ResetOutputFileHandle (FILE *new_fh) { } //By default, do nothing.
diff --git a/include/lldb/Interpreter/ScriptInterpreterPython.h b/include/lldb/Interpreter/ScriptInterpreterPython.h
index 14a62d67fde60..edcc4c44facb6 100644
--- a/include/lldb/Interpreter/ScriptInterpreterPython.h
+++ b/include/lldb/Interpreter/ScriptInterpreterPython.h
@@ -80,6 +80,22 @@ public:
lldb::ScriptInterpreterObjectSP
CreateSyntheticScriptedProvider (const char *class_name,
lldb::ValueObjectSP valobj);
+
+ lldb::ScriptInterpreterObjectSP
+ virtual CreateScriptedThreadPlan (const char *class_name,
+ lldb::ThreadPlanSP thread_plan);
+
+ virtual bool
+ ScriptedThreadPlanExplainsStop (lldb::ScriptInterpreterObjectSP implementor_sp,
+ Event *event,
+ bool &script_error);
+ virtual bool
+ ScriptedThreadPlanShouldStop (lldb::ScriptInterpreterObjectSP implementor_sp,
+ Event *event,
+ bool &script_error);
+ virtual lldb::StateType
+ ScriptedThreadPlanGetRunState (lldb::ScriptInterpreterObjectSP implementor_sp,
+ bool &script_error);
virtual lldb::ScriptInterpreterObjectSP
OSPlugin_CreatePluginObject (const char *class_name,
@@ -125,12 +141,16 @@ public:
virtual bool
MightHaveChildrenSynthProviderInstance (const lldb::ScriptInterpreterObjectSP& implementor);
+ virtual lldb::ValueObjectSP
+ GetSyntheticValue (const lldb::ScriptInterpreterObjectSP& implementor);
+
virtual bool
RunScriptBasedCommand(const char* impl_function,
const char* args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject& cmd_retobj,
- Error& error);
+ Error& error,
+ const lldb_private::ExecutionContext& exe_ctx);
Error
GenerateFunction(const char *signature, const StringList &input);
@@ -170,6 +190,7 @@ public:
GetScriptedSummary (const char *function_name,
lldb::ValueObjectSP valobj,
lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
+ const TypeSummaryOptions& options,
std::string& retval);
virtual void
@@ -212,6 +233,12 @@ public:
Error& error);
virtual bool
+ RunScriptFormatKeyword (const char* impl_function,
+ ValueObject* value,
+ std::string& output,
+ Error& error);
+
+ virtual bool
LoadScriptingModule (const char* filename,
bool can_reload,
bool init_session,
@@ -268,6 +295,7 @@ public:
SWIGPythonGetValueObjectSPFromSBValue swig_get_valobj_sp_from_sbvalue,
SWIGPythonUpdateSynthProviderInstance swig_update_provider,
SWIGPythonMightHaveChildrenSynthProviderInstance swig_mighthavechildren_provider,
+ SWIGPythonGetValueSynthProviderInstance swig_getvalue_provider,
SWIGPythonCallCommand swig_call_command,
SWIGPythonCallModuleInit swig_call_module_init,
SWIGPythonCreateOSPlugin swig_create_os_plugin,
@@ -275,7 +303,10 @@ public:
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);
+ SWIGPythonScriptKeyword_Value swig_run_script_keyword_value,
+ SWIGPython_GetDynamicSetting swig_plugin_get,
+ SWIGPythonCreateScriptedThreadPlan swig_thread_plan_script,
+ SWIGPythonCallThreadPlan swig_call_thread_plan);
const char *
GetDictionaryName ()