[Lldb-commits] [lldb] r162376 - in /lldb/trunk: include/lldb/ include/lldb/API/ include/lldb/Core/ include/lldb/Interpreter/ include/lldb/Target/ source/API/ source/Commands/ source/Core/ source/Interpreter/ source/Target/
Greg Clayton
gclayton at apple.com
Wed Aug 22 11:39:04 PDT 2012
Author: gclayton
Date: Wed Aug 22 13:39:03 2012
New Revision: 162376
URL: http://llvm.org/viewvc/llvm-project?rev=162376&view=rev
Log:
Remove further outdated "settings" code and also implement a few missing things.
Modified:
lldb/trunk/include/lldb/API/SBStringList.h
lldb/trunk/include/lldb/Core/UserSettingsController.h
lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h
lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/source/API/SBDebugger.cpp
lldb/trunk/source/Commands/CommandCompletions.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/UserSettingsController.cpp
lldb/trunk/source/Interpreter/OptionValue.cpp
lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
lldb/trunk/source/Interpreter/OptionValueProperties.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Target/TargetList.cpp
lldb/trunk/source/Target/Thread.cpp
Modified: lldb/trunk/include/lldb/API/SBStringList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBStringList.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBStringList.h (original)
+++ lldb/trunk/include/lldb/API/SBStringList.h Wed Aug 22 13:39:03 2012
@@ -50,6 +50,7 @@
protected:
friend class SBCommandInterpreter;
+ friend class SBDebugger;
SBStringList (const lldb_private::StringList *lldb_strings);
Modified: lldb/trunk/include/lldb/Core/UserSettingsController.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UserSettingsController.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/UserSettingsController.h (original)
+++ lldb/trunk/include/lldb/Core/UserSettingsController.h Wed Aug 22 13:39:03 2012
@@ -29,16 +29,6 @@
namespace lldb_private {
-
-//typedef struct
-//{
-// lldb::UserSettingsControllerSP parent;
-// ConstString level_name;
-// std::vector<SettingEntry> global_settings;
-// std::vector<SettingEntry> instance_settings;
-//} UserSettingDefinition;
-//
-
class Properties
{
public:
@@ -100,414 +90,6 @@
lldb::OptionValuePropertiesSP m_collection_sp;
};
-//class UserSettingsController :
-// public STD_ENABLE_SHARED_FROM_THIS(UserSettingsController)
-//{
-//public:
-//
-// UserSettingsController (const char *level_name,
-// const lldb::UserSettingsControllerSP &parent);
-//
-// virtual
-// ~UserSettingsController ();
-//
-// // Pure virtual functions, which all sub-classes must implement.
-// virtual lldb::InstanceSettingsSP
-// CreateInstanceSettings (const char *instance_name) = 0;
-//
-// // Virtual functions that you can override if you have global settings
-// // (not instance specific).
-// virtual bool
-// SetGlobalVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const SettingEntry &entry,
-// const VarSetOperationType op,
-// Error &err);
-//
-// virtual bool
-// GetGlobalVariable (const ConstString &var_name,
-// StringList &value,
-// Error &err);
-//
-// // End of pure virtual functions.
-// StringList
-// GetVariable (const char *full_dot_name,
-// SettableVariableType &var_type,
-// const char *debugger_instance_name,
-// Error &err);
-//
-// Error
-// SetVariable (const char *full_dot_name,
-// const char *value,
-// const VarSetOperationType op,
-// const bool override,
-// const char *debugger_instance_name,
-// const char *index_value = NULL);
-//
-// const lldb::UserSettingsControllerSP &
-// GetParent ();
-//
-// const ConstString &
-// GetLevelName ();
-//
-// void
-// RegisterChild (const lldb::UserSettingsControllerSP &child);
-//
-// void
-// RemoveChild (const lldb::UserSettingsControllerSP &child);
-//
-// void
-// CreateSettingsVector (const SettingEntry *table,
-// const bool global);
-//
-// void
-// CreateDefaultInstanceSettings ();
-//
-// void
-// InitializeGlobalVariables ();
-//
-// const lldb::InstanceSettingsSP &
-// FindPendingSettings (const ConstString &instance_name);
-//
-// void
-// RemovePendingSettings (const ConstString &instance_name);
-//
-// void
-// RegisterInstanceSettings (InstanceSettings *instance_settings);
-//
-// void
-// UnregisterInstanceSettings (InstanceSettings *instance_settings);
-//
-// void
-// RenameInstanceSettings (const char *old_name, const char *new_name);
-//
-// void
-// SetDefaultInstanceSettings (const lldb::InstanceSettingsSP &instance_settings_sp)
-// {
-// m_default_settings = instance_settings_sp;
-// }
-// // -------------------------------------------------------------------------
-// // Public static methods
-// // -------------------------------------------------------------------------
-//
-// static void
-// FindAllSettingsDescriptions (CommandInterpreter &interpreter,
-// const lldb::UserSettingsControllerSP& usc_sp,
-// const char *current_prefix,
-// Stream &result_stream,
-// Error &err);
-//
-// static void
-// FindSettingsDescriptions (CommandInterpreter &interpreter,
-// const lldb::UserSettingsControllerSP& usc_sp,
-// const char *current_prefix,
-// const char *search_name,
-// Stream &result_stream,
-// Error &err);
-//
-// static void
-// SearchAllSettingsDescriptions (CommandInterpreter &interpreter,
-// const lldb::UserSettingsControllerSP& usc_sp,
-// const char *current_prefix,
-// const char *search_word,
-// Stream &result_stream);
-//
-// static void
-// GetAllVariableValues (CommandInterpreter &interpreter,
-// const lldb::UserSettingsControllerSP& usc_sp,
-// const char *current_prefix,
-// Stream &result_stream,
-// Error &err);
-//
-// static bool
-// DumpValue (CommandInterpreter &interpreter,
-// const lldb::UserSettingsControllerSP& usc_sp,
-// const char *variable_dot_name,
-// Stream &strm);
-//
-// static bool
-// DumpValue (const char *variable_dot_name,
-// SettableVariableType var_type,
-// const StringList &variable_value,
-// Stream &strm);
-//
-// static int
-// CompleteSettingsNames (const lldb::UserSettingsControllerSP& usc_sp,
-// Args &partial_setting_name_pieces,
-// bool &word_complete,
-// StringList &matches);
-//
-// static int
-// CompleteSettingsValue (const lldb::UserSettingsControllerSP& usc_sp,
-// const char *full_dot_name,
-// const char *partial_value,
-// bool &word_complete,
-// StringList &matches);
-//
-// static Args
-// BreakNameIntoPieces (const char *full_dot_name);
-//
-// static const char *
-// GetTypeString (SettableVariableType var_type);
-//
-//
-// static const char *
-// EnumToString (const OptionEnumValueElement *enum_values, int value);
-//
-// static void
-// UpdateStringVariable (VarSetOperationType op,
-// std::string &string_var,
-// const char *new_value,
-// Error &err);
-//
-//
-// static void
-// UpdateBooleanVariable (VarSetOperationType op,
-// bool &bool_var,
-// const char *new_value,
-// bool clear_value, // Used for op == eVarSetOperationClear
-// Error &err);
-//
-// static void
-// UpdateStringArrayVariable (VarSetOperationType op,
-// const char *index_value,
-// Args &array_var,
-// const char *new_value,
-// Error &err);
-//
-// static void
-// UpdateDictionaryVariable (VarSetOperationType op,
-// const char *index_value,
-// std::map<std::string, std::string> &dictionary,
-// const char *new_value,
-// Error &err);
-//
-// static void
-// UpdateEnumVariable (OptionEnumValueElement *enum_values,
-// int *enum_var,
-// const char *new_value,
-// Error &err);
-//
-// static Error
-// UpdateStringOptionValue (const char *new_value_cstr,
-// VarSetOperationType op,
-// OptionValueString &option_value);
-//
-// static Error
-// UpdateBooleanOptionValue (const char *new_value_cstr,
-// VarSetOperationType op,
-// OptionValueBoolean &option_value);
-//
-// static Error
-// UpdateFileSpecOptionValue (const char *new_value_cstr,
-// VarSetOperationType op,
-// OptionValueFileSpec &option_value);
-//
-// static bool
-// InitializeSettingsController (lldb::UserSettingsControllerSP &controller_sp,
-// SettingEntry *global_settings,
-// SettingEntry *instance_settings);
-//
-// static void
-// FinalizeSettingsController (lldb::UserSettingsControllerSP &controller_sp);
-//
-//
-// lldb::InstanceSettingsSP
-// GetDefaultInstanceSettings ()
-// {
-// return m_default_settings;
-// }
-//
-//protected:
-//
-// // -------------------------------------------------------------------------
-// // Protected methods are declared below here.
-// // -------------------------------------------------------------------------
-//
-// bool
-// IsLiveInstance (const std::string &instance_name);
-//
-// int
-// GlobalVariableMatches (const char *partial_name,
-// const std::string &complete_prefix,
-// StringList &matches);
-//
-// int
-// InstanceVariableMatches (const char *partial_name,
-// const std::string &complete_prefix,
-// const char *instance_name,
-// StringList &matches);
-//
-// int
-// LiveInstanceMatches (const char *partial_name,
-// const std::string &complete_prefix,
-// bool &word_complete,
-// StringList &matches);
-//
-// int
-// ChildMatches (const char *partial_name,
-// const std::string &complete_prefix,
-// bool &word_complete,
-// StringList &matches);
-//
-//
-// size_t
-// GetNumChildren ();
-//
-// const lldb::UserSettingsControllerSP
-// GetChildAtIndex (size_t index);
-//
-//
-// const SettingEntry *
-// GetGlobalEntry (const ConstString &var_name);
-//
-// const SettingEntry *
-// GetInstanceEntry (const ConstString &var_name);
-//
-// void
-// BuildParentPrefix (std::string &parent_prefix);
-//
-//
-// void
-// CopyDefaultSettings (const lldb::InstanceSettingsSP &new_settings,
-// const ConstString &instance_name,
-// bool pending);
-//
-// lldb::InstanceSettingsSP
-// PendingSettingsForInstance (const ConstString &instance_name);
-//
-// InstanceSettings *
-// FindSettingsForInstance (const ConstString &instance_name);
-//
-// void
-// GetAllPendingSettingValues (Stream &result_stream);
-//
-// void
-// GetAllDefaultSettingValues (Stream &result_stream);
-//
-// void
-// GetAllInstanceVariableValues (CommandInterpreter &interpreter,
-// Stream &result_stream);
-//
-// void
-// OverrideAllInstances (const ConstString &var_name,
-// const char *value,
-// VarSetOperationType op,
-// const char *index_value,
-// Error &err);
-//
-// UserSettingDefinition &
-// GetControllerSettings () { return m_settings; }
-//
-// // -------------------------------------------------------------------------
-// // Static protected methods are declared below here.
-// // -------------------------------------------------------------------------
-//
-// static void
-// PrintEnumValues (const OptionEnumValueElement *enum_values,
-// Stream &str);
-//
-//
-// static int
-// BooleanMatches (const char *partial_value,
-// bool &word_complete,
-// StringList &matches);
-//
-// static int
-// EnumMatches (const char *partial_value,
-// OptionEnumValueElement *enum_values,
-// bool &word_complete,
-// StringList &matches);
-//
-// static void
-// VerifyOperationForType (SettableVariableType var_type,
-// VarSetOperationType op,
-// const ConstString &var_name,
-// Error &err);
-//
-// // This is protected rather than private so that classes that inherit from UserSettingsController can access it.
-//
-// lldb::InstanceSettingsSP m_default_settings;
-//
-//private:
-//
-// UserSettingDefinition m_settings;
-//
-// typedef std::map<std::string,InstanceSettings*> InstanceSettingsMap;
-//
-// std::vector<lldb::UserSettingsControllerSP> m_children;
-// std::map <std::string, lldb::InstanceSettingsSP> m_pending_settings;
-// InstanceSettingsMap m_live_settings; // live settings should never be NULL (hence 'live')
-// mutable Mutex m_children_mutex;
-// mutable Mutex m_pending_settings_mutex;
-// mutable Mutex m_live_settings_mutex;
-//
-// DISALLOW_COPY_AND_ASSIGN (UserSettingsController);
-//};
-//
-//class InstanceSettings
-//{
-//public:
-//
-// InstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, const char *instance_name, bool live_instance = true);
-//
-// InstanceSettings (const InstanceSettings &rhs);
-//
-// virtual
-// ~InstanceSettings ();
-//
-// InstanceSettings&
-// operator= (const InstanceSettings &rhs);
-//
-// // Begin Pure Virtual Functions
-//
-// virtual void
-// UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending) = 0;
-//
-// virtual bool
-// GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err) = 0;
-//
-// virtual void
-// CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-// bool pending) = 0;
-//
-// virtual const ConstString
-// CreateInstanceName () = 0;
-//
-// // End Pure Virtual Functions
-//
-// const ConstString &
-// GetInstanceName () { return m_instance_name; }
-//
-//
-// void
-// ChangeInstanceName (const std::string &new_instance_name);
-//
-// static const ConstString &
-// GetDefaultName ();
-//
-// static const ConstString &
-// InvalidName ();
-//
-//protected:
-//
-// lldb::UserSettingsControllerWP m_owner_wp;
-// ConstString m_instance_name;
-//};
-//
-
-
} // namespace lldb_private
#endif // liblldb_UserSettingsController_h_
Modified: lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h Wed Aug 22 13:39:03 2012
@@ -25,14 +25,16 @@
OptionValueFileSpec () :
OptionValue(),
m_current_value (),
- m_default_value ()
+ m_default_value (),
+ m_data_sp()
{
}
OptionValueFileSpec (const FileSpec &value) :
OptionValue(),
m_current_value (value),
- m_default_value (value)
+ m_default_value (value),
+ m_data_sp()
{
}
@@ -40,7 +42,8 @@
const FileSpec &default_value) :
OptionValue(),
m_current_value (current_value),
- m_default_value (default_value)
+ m_default_value (default_value),
+ m_data_sp()
{
}
@@ -71,6 +74,7 @@
{
m_current_value = m_default_value;
m_value_was_set = false;
+ m_data_sp.reset();
return true;
}
@@ -108,9 +112,12 @@
}
void
- SetCurrentValue (const FileSpec &value)
+ SetCurrentValue (const FileSpec &value, bool set_value_was_set)
{
m_current_value = value;
+ if (set_value_was_set)
+ m_value_was_set = true;
+ m_data_sp.reset();
}
void
@@ -119,9 +126,13 @@
m_default_value = value;
}
+ const lldb::DataBufferSP &
+ GetFileContents();
+
protected:
FileSpec m_current_value;
FileSpec m_default_value;
+ lldb::DataBufferSP m_data_sp;
};
} // namespace lldb_private
Modified: lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h Wed Aug 22 13:39:03 2012
@@ -211,6 +211,9 @@
bool
SetPropertyAtIndexAsString (const ExecutionContext *exe_ctx, uint32_t idx, const char *new_value);
+ OptionValueFileSpec *
+ GetPropertyAtIndexAsOptionValueFileSpec (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const;
+
FileSpec
GetPropertyAtIndexAsFileSpec (const ExecutionContext *exe_ctx, uint32_t idx) const;
Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Wed Aug 22 13:39:03 2012
@@ -48,92 +48,28 @@
namespace lldb_private {
- class ProcessProperties : public Properties
- {
- public:
- ProcessProperties(bool is_global);
+//----------------------------------------------------------------------
+// ProcessProperties
+//----------------------------------------------------------------------
+class ProcessProperties : public Properties
+{
+public:
+ ProcessProperties(bool is_global);
- virtual
- ~ProcessProperties();
-
- bool GetDisableMemoryCache() const;
+ virtual
+ ~ProcessProperties();
+
+ bool
+ GetDisableMemoryCache() const;
- Args //&
- GetExtraStartupCommands () const;
+ Args
+ GetExtraStartupCommands () const;
- void
- SetExtraStartupCommands (const Args &args);
- };
-
- typedef STD_SHARED_PTR(ProcessProperties) ProcessPropertiesSP;
-////----------------------------------------------------------------------
-//// ProcessInstanceSettings
-////----------------------------------------------------------------------
-//class ProcessInstanceSettings : public InstanceSettings
-//{
-//public:
-//
-// ProcessInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-//
-// ProcessInstanceSettings (const ProcessInstanceSettings &rhs);
-//
-// virtual
-// ~ProcessInstanceSettings ();
-//
-// ProcessInstanceSettings&
-// operator= (const ProcessInstanceSettings &rhs);
-//
-//
-// void
-// UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending);
-//
-// bool
-// GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err);
-//
-// bool GetDisableMemoryCache() const
-// {
-// return m_disable_memory_cache;
-// }
-//
-// const Args &
-// GetExtraStartupCommands () const
-// {
-// return m_extra_startup_commands;
-// }
-//
-// void
-// SetExtraStartupCommands (const Args &args)
-// {
-// m_extra_startup_commands = args;
-// }
-//
-//protected:
-// const ConstString &
-// GetDisableMemoryCacheVarName () const;
-//
-// const ConstString &
-// GetExtraStartupCommandVarName () const;
-//
-// void
-// CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-// bool pending);
-//
-// const ConstString
-// CreateInstanceName ();
-//
-// bool m_disable_memory_cache;
-// Args m_extra_startup_commands;
-//};
+ void
+ SetExtraStartupCommands (const Args &args);
+};
+
+typedef STD_SHARED_PTR(ProcessProperties) ProcessPropertiesSP;
//----------------------------------------------------------------------
// ProcessInfo
@@ -1525,31 +1461,6 @@
};
-// class SettingsController : public UserSettingsController
-// {
-// public:
-//
-// SettingsController ();
-//
-// virtual
-// ~SettingsController ();
-//
-// static SettingEntry global_settings_table[];
-// static SettingEntry instance_settings_table[];
-//
-// protected:
-//
-// lldb::InstanceSettingsSP
-// CreateInstanceSettings (const char *instance_name);
-//
-// private:
-//
-// // Class-wide settings.
-//
-// DISALLOW_COPY_AND_ASSIGN (SettingsController);
-// };
-
-
#endif
static void
@@ -1561,26 +1472,6 @@
static const ProcessPropertiesSP &
GetGlobalProperties();
- const Args //&
- GetExtraStartupCommands () const
- {
- // TODO: SETTINGS
- return Args();
- }
-
- void
- SetExtraStartupCommands (const Args &args)
- {
- // TODO: SETTINGS
- }
-
- bool
- GetDisableMemoryCache() const
- {
- // TODO: SETTINGS
- return false;
- }
-
//------------------------------------------------------------------
/// Construct with a shared pointer to a target, and the Process listener.
//------------------------------------------------------------------
Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Wed Aug 22 13:39:03 2012
@@ -37,325 +37,93 @@
namespace lldb_private {
-//----------------------------------------------------------------------
-// TargetInstanceSettings
-//----------------------------------------------------------------------
extern OptionEnumValueElement g_dynamic_value_types[];
-//class TargetInstanceSettings : public InstanceSettings
-//{
-//public:
-// static OptionEnumValueElement g_dynamic_value_types[];
-//
-// TargetInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-//
-// TargetInstanceSettings (const TargetInstanceSettings &rhs);
-//
-// virtual
-// ~TargetInstanceSettings ();
-//
-// TargetInstanceSettings&
-// operator= (const TargetInstanceSettings &rhs);
-//
-// void
-// UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending);
-//
-// bool
-// GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err);
-//
-// lldb::DynamicValueType
-// GetPreferDynamicValue()
-// {
-// return (lldb::DynamicValueType) g_dynamic_value_types[m_prefer_dynamic_value].value;
-// }
-//
-// bool
-// GetEnableSyntheticValue ()
-// {
-// return m_enable_synthetic_value;
-// }
-//
-// void
-// SetEnableSyntheticValue (bool b)
-// {
-// m_enable_synthetic_value = b;
-// }
-//
-// bool
-// GetSkipPrologue()
-// {
-// return m_skip_prologue;
-// }
-//
-// PathMappingList &
-// GetSourcePathMap ()
-// {
-// return m_source_map;
-// }
-//
-// FileSpecList &
-// GetExecutableSearchPaths ()
-// {
-// return m_exe_search_paths;
-// }
-//
-// const FileSpecList &
-// GetExecutableSearchPaths () const
-// {
-// return m_exe_search_paths;
-// }
-//
-//
-// uint32_t
-// GetMaximumNumberOfChildrenToDisplay()
-// {
-// return m_max_children_display;
-// }
-// uint32_t
-// GetMaximumSizeOfStringSummary()
-// {
-// return m_max_strlen_length;
-// }
-//
-// bool
-// GetBreakpointsConsultPlatformAvoidList ()
-// {
-// return m_breakpoints_use_platform_avoid;
-// }
-//
-// const Args &
-// GetRunArguments () const
-// {
-// return m_run_args;
-// }
-//
-// void
-// SetRunArguments (const Args &args)
-// {
-// m_run_args = args;
-// }
-//
-// void
-// GetHostEnvironmentIfNeeded ();
-//
-// size_t
-// GetEnvironmentAsArgs (Args &env);
-//
-// const char *
-// GetStandardInputPath () const
-// {
-// if (m_input_path.empty())
-// return NULL;
-// return m_input_path.c_str();
-// }
-//
-// void
-// SetStandardInputPath (const char *path)
-// {
-// if (path && path[0])
-// m_input_path.assign (path);
-// else
-// {
-// // Make sure we deallocate memory in string...
-// std::string tmp;
-// tmp.swap (m_input_path);
-// }
-// }
-//
-// const char *
-// GetStandardOutputPath () const
-// {
-// if (m_output_path.empty())
-// return NULL;
-// return m_output_path.c_str();
-// }
-//
-// void
-// SetStandardOutputPath (const char *path)
-// {
-// if (path && path[0])
-// m_output_path.assign (path);
-// else
-// {
-// // Make sure we deallocate memory in string...
-// std::string tmp;
-// tmp.swap (m_output_path);
-// }
-// }
-//
-// const char *
-// GetStandardErrorPath () const
-// {
-// if (m_error_path.empty())
-// return NULL;
-// return m_error_path.c_str();
-// }
-//
-// void
-// SetStandardErrorPath (const char *path)
-// {
-// if (path && path[0])
-// m_error_path.assign (path);
-// else
-// {
-// // Make sure we deallocate memory in string...
-// std::string tmp;
-// tmp.swap (m_error_path);
-// }
-// }
-//
-// bool
-// GetDisableASLR () const
-// {
-// return m_disable_aslr;
-// }
-//
-// void
-// SetDisableASLR (bool b)
-// {
-// m_disable_aslr = b;
-// }
-//
-// bool
-// GetDisableSTDIO () const
-// {
-// return m_disable_stdio;
-// }
-//
-// void
-// SetDisableSTDIO (bool b)
-// {
-// m_disable_stdio = b;
-// }
-//
-//
-//protected:
-//
-// void
-// CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-// bool pending);
-//
-// const ConstString
-// CreateInstanceName ();
-//
-// OptionValueFileSpec m_expr_prefix_file;
-// std::string m_expr_prefix_contents;
-// int m_prefer_dynamic_value;
-// OptionValueBoolean m_enable_synthetic_value;
-// OptionValueBoolean m_skip_prologue;
-// PathMappingList m_source_map;
-// FileSpecList m_exe_search_paths;
-// uint32_t m_max_children_display;
-// uint32_t m_max_strlen_length;
-// OptionValueBoolean m_breakpoints_use_platform_avoid;
-// typedef std::map<std::string, std::string> dictionary;
-// Args m_run_args;
-// dictionary m_env_vars;
-// std::string m_input_path;
-// std::string m_output_path;
-// std::string m_error_path;
-// bool m_disable_aslr;
-// bool m_disable_stdio;
-// bool m_inherit_host_env;
-// bool m_got_host_env;
-//
-//
-//};
- class TargetProperties;
- typedef STD_SHARED_PTR(TargetProperties) TargetPropertiesSP;
- class TargetProperties : public Properties
- {
- public:
- TargetProperties(Target *target);
+//----------------------------------------------------------------------
+// TargetProperties
+//----------------------------------------------------------------------
+class TargetProperties : public Properties
+{
+public:
+ TargetProperties(Target *target);
- virtual
- ~TargetProperties();
-
- virtual lldb::OptionValuePropertiesSP
- GetValueProperties () const
- {
- return m_collection_sp;
- }
+ virtual
+ ~TargetProperties();
+
+ ArchSpec
+ GetDefaultArchitecture () const;
+
+ void
+ SetDefaultArchitecture (const ArchSpec& arch);
- ArchSpec
- GetDefaultArchitecture () const;
-
- void
- SetDefaultArchitecture (const ArchSpec& arch);
+ lldb::DynamicValueType
+ GetPreferDynamicValue() const;
+
+ bool
+ GetDisableASLR () const;
+
+ void
+ SetDisableASLR (bool b);
+
+ bool
+ GetDisableSTDIO () const;
+
+ void
+ SetDisableSTDIO (bool b);
+
+ bool
+ GetRunArguments (Args &args) const;
+
+ void
+ SetRunArguments (const Args &args);
+
+ size_t
+ GetEnvironmentAsArgs (Args &env) const;
+
+ bool
+ GetSkipPrologue() const;
+
+ PathMappingList &
+ GetSourcePathMap () const;
+
+ FileSpecList &
+ GetExecutableSearchPaths ();
+
+ bool
+ GetEnableSyntheticValue () const;
+
+ uint32_t
+ GetMaximumNumberOfChildrenToDisplay() const;
+
+ uint32_t
+ GetMaximumSizeOfStringSummary() const;
+
+ FileSpec
+ GetStandardInputPath () const;
+
+ void
+ SetStandardInputPath (const char *path);
+
+ FileSpec
+ GetStandardOutputPath () const;
+
+ void
+ SetStandardOutputPath (const char *path);
+
+ FileSpec
+ GetStandardErrorPath () const;
+
+ void
+ SetStandardErrorPath (const char *path);
+
+ bool
+ GetBreakpointsConsultPlatformAvoidList ();
+
+ const char *
+ GetExpressionPrefixContentsAsCString ();
+};
- lldb::DynamicValueType
- GetPreferDynamicValue() const;
-
- bool
- GetDisableASLR () const;
-
- void
- SetDisableASLR (bool b);
-
- bool
- GetDisableSTDIO () const;
-
- void
- SetDisableSTDIO (bool b);
-
- bool
- GetRunArguments (Args &args) const;
-
- void
- SetRunArguments (const Args &args);
-
- size_t
- GetEnvironmentAsArgs (Args &env) const;
-
- bool
- GetSkipPrologue() const;
-
- PathMappingList &
- GetSourcePathMap () const;
-
- FileSpecList &
- GetExecutableSearchPaths () const;
-
- bool
- GetEnableSyntheticValue () const;
-
- uint32_t
- GetMaximumNumberOfChildrenToDisplay() const;
-
- uint32_t
- GetMaximumSizeOfStringSummary() const;
-
- FileSpec
- GetStandardInputPath () const;
-
- void
- SetStandardInputPath (const char *path);
-
- FileSpec
- GetStandardOutputPath () const;
-
- void
- SetStandardOutputPath (const char *path);
-
- FileSpec
- GetStandardErrorPath () const;
-
- void
- SetStandardErrorPath (const char *path);
-
- bool
- GetBreakpointsConsultPlatformAvoidList ();
- };
+typedef STD_SHARED_PTR(TargetProperties) TargetPropertiesSP;
//----------------------------------------------------------------------
// Target
@@ -551,9 +319,9 @@
// Use this to create breakpoint that matches regex against the source lines in files given in source_file_list:
lldb::BreakpointSP
CreateSourceRegexBreakpoint (const FileSpecList *containingModules,
- const FileSpecList *source_file_list,
- RegularExpression &source_regex,
- bool internal = false);
+ const FileSpecList *source_file_list,
+ RegularExpression &source_regex,
+ bool internal = false);
// Use this to create a breakpoint from a load address
lldb::BreakpointSP
@@ -570,10 +338,10 @@
// setting, else we use the values passed in
lldb::BreakpointSP
CreateFuncRegexBreakpoint (const FileSpecList *containingModules,
- const FileSpecList *containingSourceFiles,
- RegularExpression &func_regexp,
- LazyBool skip_prologue = eLazyBoolCalculate,
- bool internal = false);
+ const FileSpecList *containingSourceFiles,
+ RegularExpression &func_regexp,
+ LazyBool skip_prologue = eLazyBoolCalculate,
+ bool internal = false);
// Use this to create a function breakpoint by name in containingModule, or all modules if it is NULL
// When "skip_prologue is set to eLazyBoolCalculate, we use the current target
@@ -980,9 +748,6 @@
ClangASTImporter *
GetClangASTImporter();
- const char *
- GetExpressionPrefixContentsAsCString ();
-
// Since expressions results can persist beyond the lifetime of a process,
// and the const expression results are available after a process is gone,
// we provide a way for expressions to be evaluated from the Target itself.
@@ -1187,51 +952,6 @@
}
//------------------------------------------------------------------
- // Target::SettingsController
- //------------------------------------------------------------------
-// class SettingsController : public UserSettingsController
-// {
-// public:
-// SettingsController ();
-//
-// virtual
-// ~SettingsController ();
-//
-// bool
-// SetGlobalVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const SettingEntry &entry,
-// const VarSetOperationType op,
-// Error&err);
-//
-// bool
-// GetGlobalVariable (const ConstString &var_name,
-// StringList &value,
-// Error &err);
-//
-// static SettingEntry global_settings_table[];
-// static SettingEntry instance_settings_table[];
-//
-// ArchSpec &
-// GetArchitecture ()
-// {
-// return m_default_architecture;
-// }
-// protected:
-//
-// lldb::InstanceSettingsSP
-// CreateInstanceSettings (const char *instance_name);
-//
-// private:
-//
-// // Class-wide settings.
-// ArchSpec m_default_architecture;
-//
-// DISALLOW_COPY_AND_ASSIGN (SettingsController);
-// };
-
- //------------------------------------------------------------------
// Methods.
//------------------------------------------------------------------
lldb::SearchFilterSP
Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Wed Aug 22 13:39:03 2012
@@ -47,102 +47,14 @@
typedef STD_SHARED_PTR(ThreadProperties) ThreadPropertiesSP;
-//class ThreadInstanceSettings : public InstanceSettings
-//{
-//public:
-//
-// ThreadInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-//
-// ThreadInstanceSettings (const ThreadInstanceSettings &rhs);
-//
-// virtual
-// ~ThreadInstanceSettings ();
-//
-// ThreadInstanceSettings&
-// operator= (const ThreadInstanceSettings &rhs);
-//
-//
-// void
-// UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending);
-//
-// bool
-// GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err);
-//
-// RegularExpression *
-// GetSymbolsToAvoidRegexp()
-// {
-// return m_avoid_regexp_ap.get();
-// }
-//
-// static const ConstString &
-// StepAvoidRegexpVarName ();
-//
-// bool
-// GetTraceEnabledState()
-// {
-// return m_trace_enabled;
-// }
-// static const ConstString &
-// GetTraceThreadVarName ();
-//
-//protected:
-//
-// void
-// CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-// bool pending);
-//
-// const ConstString
-// CreateInstanceName ();
-//
-//private:
-//
-// std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
-// bool m_trace_enabled;
-//};
-class Thread :
+ class Thread :
public STD_ENABLE_SHARED_FROM_THIS(Thread),
public ThreadProperties,
public UserID,
- public ExecutionContextScope//,
- //public ThreadInstanceSettings
+ public ExecutionContextScope
{
public:
-
-// class SettingsController : public UserSettingsController
-// {
-// public:
-//
-// SettingsController ();
-//
-// virtual
-// ~SettingsController ();
-//
-// static SettingEntry global_settings_table[];
-// static SettingEntry instance_settings_table[];
-//
-// protected:
-//
-// lldb::InstanceSettingsSP
-// CreateInstanceSettings (const char *instance_name);
-//
-// private:
-//
-// // Class-wide settings.
-//
-// DISALLOW_COPY_AND_ASSIGN (SettingsController);
-// };
-
// TODO: You shouldn't just checkpoint the register state alone, so this should get
// moved to protected. To do that ThreadStateCheckpoint needs to be returned as a token...
class RegisterCheckpoint
Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Wed Aug 22 13:39:03 2012
@@ -112,7 +112,6 @@
class FunctionInfo;
class InlineFunctionInfo;
class InputReader;
-class InstanceSettings;
class Instruction;
class InstructionList;
class LanguageRuntime;
@@ -239,7 +238,6 @@
class UnwindAssembly;
class UnwindPlan;
class UnwindTable;
-class UserSettingsController;
class VMRange;
class Value;
class TypeFormatImpl;
@@ -292,7 +290,6 @@
typedef STD_SHARED_PTR(lldb_private::FuncUnwinders) FuncUnwindersSP;
typedef STD_SHARED_PTR(lldb_private::InlineFunctionInfo) InlineFunctionInfoSP;
typedef STD_SHARED_PTR(lldb_private::InputReader) InputReaderSP;
- typedef STD_SHARED_PTR(lldb_private::InstanceSettings) InstanceSettingsSP;
typedef STD_SHARED_PTR(lldb_private::Instruction) InstructionSP;
typedef STD_SHARED_PTR(lldb_private::LanguageRuntime) LanguageRuntimeSP;
typedef STD_SHARED_PTR(lldb_private::LineTable) LineTableSP;
@@ -367,8 +364,6 @@
#ifndef LLDB_DISABLE_PYTHON
typedef STD_SHARED_PTR(lldb_private::TypeSyntheticImpl) TypeSyntheticImplSP;
#endif
- typedef STD_SHARED_PTR(lldb_private::UserSettingsController) UserSettingsControllerSP;
- typedef STD_WEAK_PTR( lldb_private::UserSettingsController) UserSettingsControllerWP;
typedef STD_SHARED_PTR(lldb_private::UnwindPlan) UnwindPlanSP;
typedef lldb_private::SharingPtr<lldb_private::ValueObject> ValueObjectSP;
typedef STD_SHARED_PTR(lldb_private::Value) ValueSP;
Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Wed Aug 22 13:39:03 2012
@@ -908,55 +908,62 @@
const char *
SBDebugger::GetInstanceName()
{
- // TODO: SETTINGS -- fill this in
-// if (m_opaque_sp)
-// return m_opaque_sp->GetInstanceName().AsCString();
-// else
+ if (m_opaque_sp)
+ return m_opaque_sp->GetInstanceName().AsCString();
+ else
return NULL;
}
SBError
SBDebugger::SetInternalVariable (const char *var_name, const char *value, const char *debugger_instance_name)
{
- // TODO: SETTINGS -- fill this in
-// UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
-//
-// Error err = root_settings_controller->SetVariable (var_name,
-// value,
-// eVarSetOperationAssign,
-// true,
-// debugger_instance_name);
-// SBError sb_error;
-// sb_error.SetError (err);
-//
-// return sb_error;
- return SBError();
+ SBError sb_error;
+ DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName (ConstString(debugger_instance_name)));
+ Error error;
+ if (debugger_sp)
+ {
+ ExecutionContext exe_ctx (debugger_sp->GetCommandInterpreter().GetExecutionContext());
+ error = debugger_sp->SetPropertyValue (&exe_ctx,
+ eVarSetOperationAssign,
+ var_name,
+ value);
+ }
+ else
+ {
+ error.SetErrorStringWithFormat ("invalid debugger instance name '%s'", debugger_instance_name);
+ }
+ if (error.Fail())
+ sb_error.SetError(error);
+ return sb_error;
}
SBStringList
SBDebugger::GetInternalVariableValue (const char *var_name, const char *debugger_instance_name)
{
SBStringList ret_value;
- // TODO: SETTINGS -- fill this in
-// SettableVariableType var_type;
-// Error err;
-//
-// UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
-//
-// StringList value = root_settings_controller->GetVariable (var_name, var_type, debugger_instance_name, err);
-//
-// if (err.Success())
-// {
-// for (unsigned i = 0; i != value.GetSize(); ++i)
-// ret_value.AppendString (value.GetStringAtIndex(i));
-// }
-// else
-// {
-// ret_value.AppendString (err.AsCString());
-// }
-//
-//
- return ret_value;
+ DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName (ConstString(debugger_instance_name)));
+ Error error;
+ if (debugger_sp)
+ {
+ ExecutionContext exe_ctx (debugger_sp->GetCommandInterpreter().GetExecutionContext());
+ lldb::OptionValueSP value_sp (debugger_sp->GetPropertyValue (&exe_ctx,
+ var_name,
+ false,
+ error));
+ if (value_sp)
+ {
+ StreamString value_strm;
+ value_sp->DumpValue (&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
+ const std::string &value_str = value_strm.GetString();
+ if (!value_str.empty())
+ {
+ StringList string_list;
+ string_list.SplitIntoLines(value_str.c_str(), value_str.size());
+ return SBStringList(&string_list);
+ }
+ }
+ }
+ return SBStringList();
}
uint32_t
Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Wed Aug 22 13:39:03 2012
@@ -422,11 +422,6 @@
size_t exact_matches_idx = SIZE_MAX;
const size_t num_matches = g_property_names.AutoComplete (partial_setting_name, matches, exact_matches_idx);
-// return UserSettingsController::CompleteSettingsNames (root_settings,
-// partial_setting_name_pieces,
-// word_complete,
-// matches);
-//
word_complete = exact_matches_idx != SIZE_MAX;
return num_matches;
}
Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Wed Aug 22 13:39:03 2012
@@ -65,91 +65,6 @@
static DebuggerList g_list;
return g_list;
}
-//
-//
-//static const ConstString &
-//PromptVarName ()
-//{
-// static ConstString g_const_string ("prompt");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetNotifyVoidName ()
-//{
-// static ConstString g_const_string ("notify-void");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetFrameFormatName ()
-//{
-// static ConstString g_const_string ("frame-format");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetThreadFormatName ()
-//{
-// static ConstString g_const_string ("thread-format");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//ScriptLangVarName ()
-//{
-// static ConstString g_const_string ("script-lang");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//TermWidthVarName ()
-//{
-// static ConstString g_const_string ("term-width");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//UseExternalEditorVarName ()
-//{
-// static ConstString g_const_string ("use-external-editor");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//AutoConfirmName ()
-//{
-// static ConstString g_const_string ("auto-confirm");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//StopSourceContextBeforeName ()
-//{
-// static ConstString g_const_string ("stop-line-count-before");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//StopSourceContextAfterName ()
-//{
-// static ConstString g_const_string ("stop-line-count-after");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//StopDisassemblyCountName ()
-//{
-// static ConstString g_const_string ("stop-disassembly-count");
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//StopDisassemblyDisplayName ()
-//{
-// static ConstString g_const_string ("stop-disassembly-display");
-// return g_const_string;
-//}
OptionEnumValueElement
g_show_disassembly_enum_values[] =
@@ -383,33 +298,13 @@
void
Debugger::SettingsInitialize ()
{
-// static bool g_initialized = false;
-//
-// if (!g_initialized)
-// {
-// g_initialized = true;
-// UserSettingsController::InitializeSettingsController (GetSettingsController(),
-// SettingsController::global_settings_table,
-// SettingsController::instance_settings_table);
-// // Now call SettingsInitialize for each settings 'child' of Debugger
-// Target::SettingsInitialize ();
-// }
+ Target::SettingsInitialize ();
}
void
Debugger::SettingsTerminate ()
{
-//
-// // Must call SettingsTerminate() for each settings 'child' of Debugger, before terminating the Debugger's
-// // Settings.
-//
-// Target::SettingsTerminate ();
-//
-// // Now terminate the Debugger Settings.
-//
-// UserSettingsControllerSP &usc = GetSettingsController();
-// UserSettingsController::FinalizeSettingsController (usc);
-// usc.reset();
+ Target::SettingsTerminate ();
}
DebuggerSP
@@ -452,22 +347,21 @@
Debugger::FindDebuggerWithInstanceName (const ConstString &instance_name)
{
DebuggerSP debugger_sp;
- // TODO: SETTINGS
-// if (g_shared_debugger_refcount > 0)
-// {
-// Mutex::Locker locker (GetDebuggerListMutex ());
-// DebuggerList &debugger_list = GetDebuggerList();
-// DebuggerList::iterator pos, end = debugger_list.end();
-//
-// for (pos = debugger_list.begin(); pos != end; ++pos)
-// {
-// if ((*pos).get()->m_instance_name == instance_name)
-// {
-// debugger_sp = *pos;
-// break;
-// }
-// }
-// }
+ if (g_shared_debugger_refcount > 0)
+ {
+ Mutex::Locker locker (GetDebuggerListMutex ());
+ DebuggerList &debugger_list = GetDebuggerList();
+ DebuggerList::iterator pos, end = debugger_list.end();
+
+ for (pos = debugger_list.begin(); pos != end; ++pos)
+ {
+ if ((*pos).get()->m_instance_name == instance_name)
+ {
+ debugger_sp = *pos;
+ break;
+ }
+ }
+ }
return debugger_sp;
}
@@ -2591,803 +2485,3 @@
return false;
}
-#pragma mark Debugger::SettingsController
-
-//--------------------------------------------------
-// class Debugger::SettingsController
-//--------------------------------------------------
-
-//Debugger::SettingsController::SettingsController () :
-// UserSettingsController ("", UserSettingsControllerSP())
-//{
-//}
-//
-//Debugger::SettingsController::~SettingsController ()
-//{
-//}
-//
-//
-//InstanceSettingsSP
-//Debugger::SettingsController::CreateInstanceSettings (const char *instance_name)
-//{
-// InstanceSettingsSP new_settings_sp (new DebuggerInstanceSettings (GetSettingsController(),
-// false,
-// instance_name));
-// return new_settings_sp;
-//}
-
-#pragma mark DebuggerInstanceSettings
-//--------------------------------------------------
-// class DebuggerInstanceSettings
-//--------------------------------------------------
-
-//DebuggerInstanceSettings::DebuggerInstanceSettings
-//(
-// const UserSettingsControllerSP &m_owner_sp,
-// bool live_instance,
-// const char *name
-//) :
-// InstanceSettings (m_owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
-// m_term_width (80),
-// m_stop_source_before_count (3),
-// m_stop_source_after_count (3),
-// m_stop_disassembly_count (4),
-// m_stop_disassembly_display (eStopDisassemblyTypeNoSource),
-// m_prompt (),
-// m_frame_format (),
-// m_thread_format (),
-// m_script_lang (),
-// m_use_external_editor (false),
-// m_auto_confirm_on (false)
-//{
-// // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-// // until the vtables for DebuggerInstanceSettings are properly set up, i.e. AFTER all the initializers.
-// // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-// // The same is true of CreateInstanceName().
-//
-// if (GetInstanceName() == InstanceSettings::InvalidName())
-// {
-// ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-// m_owner_sp->RegisterInstanceSettings (this);
-// }
-//
-// if (live_instance)
-// {
-// const InstanceSettingsSP &pending_settings = m_owner_sp->FindPendingSettings (m_instance_name);
-// CopyInstanceSettings (pending_settings, false);
-// }
-//}
-//
-//DebuggerInstanceSettings::DebuggerInstanceSettings (const DebuggerInstanceSettings &rhs) :
-// InstanceSettings (Debugger::GetSettingsController(), CreateInstanceName ().AsCString()),
-// m_prompt (rhs.m_prompt),
-// m_frame_format (rhs.m_frame_format),
-// m_thread_format (rhs.m_thread_format),
-// m_script_lang (rhs.m_script_lang),
-// m_use_external_editor (rhs.m_use_external_editor),
-// m_auto_confirm_on(rhs.m_auto_confirm_on)
-//{
-// UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-// if (owner_sp)
-// {
-// CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
-// owner_sp->RemovePendingSettings (m_instance_name);
-// }
-//}
-//
-//DebuggerInstanceSettings::~DebuggerInstanceSettings ()
-//{
-//}
-//
-//DebuggerInstanceSettings&
-//DebuggerInstanceSettings::operator= (const DebuggerInstanceSettings &rhs)
-//{
-// if (this != &rhs)
-// {
-// m_term_width = rhs.m_term_width;
-// m_prompt = rhs.m_prompt;
-// m_frame_format = rhs.m_frame_format;
-// m_thread_format = rhs.m_thread_format;
-// m_script_lang = rhs.m_script_lang;
-// m_use_external_editor = rhs.m_use_external_editor;
-// m_auto_confirm_on = rhs.m_auto_confirm_on;
-// }
-//
-// return *this;
-//}
-//
-//bool
-//DebuggerInstanceSettings::ValidTermWidthValue (const char *value, Error err)
-//{
-// bool valid = false;
-//
-// // Verify we have a value string.
-// if (value == NULL || value[0] == '\0')
-// {
-// err.SetErrorString ("missing value, can't set terminal width without a value");
-// }
-// else
-// {
-// char *end = NULL;
-// const uint32_t width = ::strtoul (value, &end, 0);
-//
-// if (end && end[0] == '\0')
-// {
-// return ValidTermWidthValue (width, err);
-// }
-// else
-// err.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string", value);
-// }
-//
-// return valid;
-//}
-//
-//bool
-//DebuggerInstanceSettings::ValidTermWidthValue (uint32_t value, Error err)
-//{
-// if (value >= 10 && value <= 1024)
-// return true;
-// else
-// {
-// err.SetErrorString ("invalid term-width value; value must be between 10 and 1024");
-// return false;
-// }
-//}
-//
-//void
-//DebuggerInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending)
-//{
-//
-// if (var_name == TermWidthVarName())
-// {
-// if (ValidTermWidthValue (value, err))
-// {
-// m_term_width = ::strtoul (value, NULL, 0);
-// }
-// }
-// else if (var_name == PromptVarName())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_prompt, value, err);
-// if (!pending)
-// {
-// // 'instance_name' is actually (probably) in the form '[<instance_name>]'; if so, we need to
-// // strip off the brackets before passing it to BroadcastPromptChange.
-//
-// std::string tmp_instance_name (instance_name.AsCString());
-// if ((tmp_instance_name[0] == '[')
-// && (tmp_instance_name[instance_name.GetLength() - 1] == ']'))
-// tmp_instance_name = tmp_instance_name.substr (1, instance_name.GetLength() - 2);
-// ConstString new_name (tmp_instance_name.c_str());
-//
-// BroadcastPromptChange (new_name, m_prompt.c_str());
-// }
-// }
-// else if (var_name == GetFrameFormatName())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_frame_format, value, err);
-// }
-// else if (var_name == GetThreadFormatName())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_thread_format, value, err);
-// }
-// else if (var_name == ScriptLangVarName())
-// {
-// bool success;
-// m_script_lang = Args::StringToScriptLanguage (value, eScriptLanguageDefault,
-// &success);
-// }
-// else if (var_name == UseExternalEditorVarName ())
-// {
-// UserSettingsController::UpdateBooleanVariable (op, m_use_external_editor, value, false, err);
-// }
-// else if (var_name == AutoConfirmName ())
-// {
-// UserSettingsController::UpdateBooleanVariable (op, m_auto_confirm_on, value, false, err);
-// }
-// else if (var_name == StopSourceContextBeforeName ())
-// {
-// uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-// if (new_value != UINT32_MAX)
-// m_stop_source_before_count = new_value;
-// else
-// err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextBeforeName ().GetCString());
-// }
-// else if (var_name == StopSourceContextAfterName ())
-// {
-// uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-// if (new_value != UINT32_MAX)
-// m_stop_source_after_count = new_value;
-// else
-// err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextAfterName ().GetCString());
-// }
-// else if (var_name == StopDisassemblyCountName ())
-// {
-// uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-// if (new_value != UINT32_MAX)
-// m_stop_disassembly_count = new_value;
-// else
-// err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopDisassemblyCountName ().GetCString());
-// }
-// else if (var_name == StopDisassemblyDisplayName ())
-// {
-// int new_value;
-// UserSettingsController::UpdateEnumVariable (g_show_disassembly_enum_values, &new_value, value, err);
-// if (err.Success())
-// m_stop_disassembly_display = (StopDisassemblyType)new_value;
-// }
-//}
-//
-//bool
-//DebuggerInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err)
-//{
-// if (var_name == PromptVarName())
-// {
-// value.AppendString (m_prompt.c_str(), m_prompt.size());
-//
-// }
-// else if (var_name == ScriptLangVarName())
-// {
-// value.AppendString (ScriptInterpreter::LanguageToString (m_script_lang).c_str());
-// }
-// else if (var_name == TermWidthVarName())
-// {
-// StreamString width_str;
-// width_str.Printf ("%u", m_term_width);
-// value.AppendString (width_str.GetData());
-// }
-// else if (var_name == GetFrameFormatName ())
-// {
-// value.AppendString(m_frame_format.c_str(), m_frame_format.size());
-// }
-// else if (var_name == GetThreadFormatName ())
-// {
-// value.AppendString(m_thread_format.c_str(), m_thread_format.size());
-// }
-// else if (var_name == UseExternalEditorVarName())
-// {
-// if (m_use_external_editor)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == AutoConfirmName())
-// {
-// if (m_auto_confirm_on)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == StopSourceContextAfterName ())
-// {
-// StreamString strm;
-// strm.Printf ("%u", m_stop_source_after_count);
-// value.AppendString (strm.GetData());
-// }
-// else if (var_name == StopSourceContextBeforeName ())
-// {
-// StreamString strm;
-// strm.Printf ("%u", m_stop_source_before_count);
-// value.AppendString (strm.GetData());
-// }
-// else if (var_name == StopDisassemblyCountName ())
-// {
-// StreamString strm;
-// strm.Printf ("%u", m_stop_disassembly_count);
-// value.AppendString (strm.GetData());
-// }
-// else if (var_name == StopDisassemblyDisplayName ())
-// {
-// if (m_stop_disassembly_display >= eStopDisassemblyTypeNever && m_stop_disassembly_display <= eStopDisassemblyTypeAlways)
-// value.AppendString (g_show_disassembly_enum_values[m_stop_disassembly_display].string_value);
-// else
-// value.AppendString ("<invalid>");
-// }
-// else
-// {
-// if (err)
-// err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-// return false;
-// }
-// return true;
-//}
-//
-//void
-//DebuggerInstanceSettings::CopyInstanceSettings (const InstanceSettingsSP &new_settings,
-// bool pending)
-//{
-// if (new_settings.get() == NULL)
-// return;
-//
-// DebuggerInstanceSettings *new_debugger_settings = (DebuggerInstanceSettings *) new_settings.get();
-//
-// m_prompt = new_debugger_settings->m_prompt;
-// if (!pending)
-// {
-// // 'instance_name' is actually (probably) in the form '[<instance_name>]'; if so, we need to
-// // strip off the brackets before passing it to BroadcastPromptChange.
-//
-// std::string tmp_instance_name (m_instance_name.AsCString());
-// if ((tmp_instance_name[0] == '[')
-// && (tmp_instance_name[m_instance_name.GetLength() - 1] == ']'))
-// tmp_instance_name = tmp_instance_name.substr (1, m_instance_name.GetLength() - 2);
-// ConstString new_name (tmp_instance_name.c_str());
-//
-// BroadcastPromptChange (new_name, m_prompt.c_str());
-// }
-// m_frame_format = new_debugger_settings->m_frame_format;
-// m_thread_format = new_debugger_settings->m_thread_format;
-// m_term_width = new_debugger_settings->m_term_width;
-// m_script_lang = new_debugger_settings->m_script_lang;
-// m_use_external_editor = new_debugger_settings->m_use_external_editor;
-// m_auto_confirm_on = new_debugger_settings->m_auto_confirm_on;
-//}
-//
-//
-//bool
-//DebuggerInstanceSettings::BroadcastPromptChange (const ConstString &instance_name, const char *new_prompt)
-//{
-// std::string tmp_prompt;
-//
-// if (new_prompt != NULL)
-// {
-// tmp_prompt = new_prompt ;
-// int len = tmp_prompt.size();
-// if (len > 1
-// && (tmp_prompt[0] == '\'' || tmp_prompt[0] == '"')
-// && (tmp_prompt[len-1] == tmp_prompt[0]))
-// {
-// tmp_prompt = tmp_prompt.substr(1,len-2);
-// }
-// len = tmp_prompt.size();
-// if (tmp_prompt[len-1] != ' ')
-// tmp_prompt.append(" ");
-// }
-// EventSP new_event_sp;
-// new_event_sp.reset (new Event(CommandInterpreter::eBroadcastBitResetPrompt,
-// new EventDataBytes (tmp_prompt.c_str())));
-//
-// if (instance_name.GetLength() != 0)
-// {
-// // Set prompt for a particular instance.
-// Debugger *dbg = Debugger::FindDebuggerWithInstanceName (instance_name).get();
-// if (dbg != NULL)
-// {
-// dbg->GetCommandInterpreter().BroadcastEvent (new_event_sp);
-// }
-// }
-//
-// return true;
-//}
-//
-//const ConstString
-//DebuggerInstanceSettings::CreateInstanceName ()
-//{
-// static int instance_count = 1;
-// StreamString sstr;
-//
-// sstr.Printf ("debugger_%d", instance_count);
-// ++instance_count;
-//
-// const ConstString ret_val (sstr.GetData());
-//
-// return ret_val;
-//}
-//
-//
-
-//DebuggerInstanceSettings::DebuggerInstanceSettings
-//(
-// const UserSettingsControllerSP &m_owner_sp,
-// bool live_instance,
-// const char *name
-//) :
-// InstanceSettings (m_owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
-// m_term_width (80),
-// m_stop_source_before_count (3),
-// m_stop_source_after_count (3),
-// m_stop_disassembly_count (4),
-// m_stop_disassembly_display (eStopDisassemblyTypeNoSource),
-// m_prompt (),
-// m_notify_void (false),
-// m_frame_format (),
-// m_thread_format (),
-// m_script_lang (),
-// m_use_external_editor (false),
-// m_auto_confirm_on (false)
-//{
-// // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-// // until the vtables for DebuggerInstanceSettings are properly set up, i.e. AFTER all the initializers.
-// // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-// // The same is true of CreateInstanceName().
-//
-// if (GetInstanceName() == InstanceSettings::InvalidName())
-// {
-// ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-// m_owner_sp->RegisterInstanceSettings (this);
-// }
-//
-// if (live_instance)
-// {
-// const InstanceSettingsSP &pending_settings = m_owner_sp->FindPendingSettings (m_instance_name);
-// CopyInstanceSettings (pending_settings, false);
-// }
-//}
-//
-//DebuggerInstanceSettings::DebuggerInstanceSettings (const DebuggerInstanceSettings &rhs) :
-// InstanceSettings (Debugger::GetSettingsController(), CreateInstanceName ().AsCString()),
-// m_prompt (rhs.m_prompt),
-// m_notify_void (rhs.m_notify_void),
-// m_frame_format (rhs.m_frame_format),
-// m_thread_format (rhs.m_thread_format),
-// m_script_lang (rhs.m_script_lang),
-// m_use_external_editor (rhs.m_use_external_editor),
-// m_auto_confirm_on(rhs.m_auto_confirm_on)
-//{
-// UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-// if (owner_sp)
-// {
-// CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
-// owner_sp->RemovePendingSettings (m_instance_name);
-// }
-//}
-//
-//DebuggerInstanceSettings::~DebuggerInstanceSettings ()
-//{
-//}
-//
-//DebuggerInstanceSettings&
-//DebuggerInstanceSettings::operator= (const DebuggerInstanceSettings &rhs)
-//{
-// if (this != &rhs)
-// {
-// m_term_width = rhs.m_term_width;
-// m_prompt = rhs.m_prompt;
-// m_notify_void = rhs.m_notify_void;
-// m_frame_format = rhs.m_frame_format;
-// m_thread_format = rhs.m_thread_format;
-// m_script_lang = rhs.m_script_lang;
-// m_use_external_editor = rhs.m_use_external_editor;
-// m_auto_confirm_on = rhs.m_auto_confirm_on;
-// }
-//
-// return *this;
-//}
-//
-//bool
-//DebuggerInstanceSettings::ValidTermWidthValue (const char *value, Error err)
-//{
-// bool valid = false;
-//
-// // Verify we have a value string.
-// if (value == NULL || value[0] == '\0')
-// {
-// err.SetErrorString ("missing value, can't set terminal width without a value");
-// }
-// else
-// {
-// char *end = NULL;
-// const uint32_t width = ::strtoul (value, &end, 0);
-//
-// if (end && end[0] == '\0')
-// {
-// return ValidTermWidthValue (width, err);
-// }
-// else
-// err.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string", value);
-// }
-//
-// return valid;
-//}
-//
-//bool
-//DebuggerInstanceSettings::ValidTermWidthValue (uint32_t value, Error err)
-//{
-// if (value >= 10 && value <= 1024)
-// return true;
-// else
-// {
-// err.SetErrorString ("invalid term-width value; value must be between 10 and 1024");
-// return false;
-// }
-//}
-//
-//void
-//DebuggerInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending)
-//{
-//
-// if (var_name == TermWidthVarName())
-// {
-// if (ValidTermWidthValue (value, err))
-// {
-// m_term_width = ::strtoul (value, NULL, 0);
-// }
-// }
-// else if (var_name == PromptVarName())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_prompt, value, err);
-// if (!pending)
-// {
-// // 'instance_name' is actually (probably) in the form '[<instance_name>]'; if so, we need to
-// // strip off the brackets before passing it to BroadcastPromptChange.
-//
-// std::string tmp_instance_name (instance_name.AsCString());
-// if ((tmp_instance_name[0] == '[')
-// && (tmp_instance_name[instance_name.GetLength() - 1] == ']'))
-// tmp_instance_name = tmp_instance_name.substr (1, instance_name.GetLength() - 2);
-// ConstString new_name (tmp_instance_name.c_str());
-//
-// BroadcastPromptChange (new_name, m_prompt.c_str());
-// }
-// }
-// else if (var_name == GetNotifyVoidName())
-// {
-// UserSettingsController::UpdateBooleanVariable (op, m_notify_void, value, false, err);
-// }
-// else if (var_name == GetFrameFormatName())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_frame_format, value, err);
-// }
-// else if (var_name == GetThreadFormatName())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_thread_format, value, err);
-// }
-// else if (var_name == ScriptLangVarName())
-// {
-// bool success;
-// m_script_lang = Args::StringToScriptLanguage (value, eScriptLanguageDefault,
-// &success);
-// }
-// else if (var_name == UseExternalEditorVarName ())
-// {
-// UserSettingsController::UpdateBooleanVariable (op, m_use_external_editor, value, false, err);
-// }
-// else if (var_name == AutoConfirmName ())
-// {
-// UserSettingsController::UpdateBooleanVariable (op, m_auto_confirm_on, value, false, err);
-// }
-// else if (var_name == StopSourceContextBeforeName ())
-// {
-// uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-// if (new_value != UINT32_MAX)
-// m_stop_source_before_count = new_value;
-// else
-// err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextBeforeName ().GetCString());
-// }
-// else if (var_name == StopSourceContextAfterName ())
-// {
-// uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-// if (new_value != UINT32_MAX)
-// m_stop_source_after_count = new_value;
-// else
-// err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextAfterName ().GetCString());
-// }
-// else if (var_name == StopDisassemblyCountName ())
-// {
-// uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-// if (new_value != UINT32_MAX)
-// m_stop_disassembly_count = new_value;
-// else
-// err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopDisassemblyCountName ().GetCString());
-// }
-// else if (var_name == StopDisassemblyDisplayName ())
-// {
-// int new_value;
-// UserSettingsController::UpdateEnumVariable (g_show_disassembly_enum_values, &new_value, value, err);
-// if (err.Success())
-// m_stop_disassembly_display = (StopDisassemblyType)new_value;
-// }
-//}
-//
-//bool
-//DebuggerInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err)
-//{
-// if (var_name == PromptVarName())
-// {
-// value.AppendString (m_prompt.c_str(), m_prompt.size());
-// }
-// else if (var_name == GetNotifyVoidName())
-// {
-// value.AppendString (m_notify_void ? "true" : "false");
-// }
-// else if (var_name == ScriptLangVarName())
-// {
-// value.AppendString (ScriptInterpreter::LanguageToString (m_script_lang).c_str());
-// }
-// else if (var_name == TermWidthVarName())
-// {
-// StreamString width_str;
-// width_str.Printf ("%u", m_term_width);
-// value.AppendString (width_str.GetData());
-// }
-// else if (var_name == GetFrameFormatName ())
-// {
-// value.AppendString(m_frame_format.c_str(), m_frame_format.size());
-// }
-// else if (var_name == GetThreadFormatName ())
-// {
-// value.AppendString(m_thread_format.c_str(), m_thread_format.size());
-// }
-// else if (var_name == UseExternalEditorVarName())
-// {
-// if (m_use_external_editor)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == AutoConfirmName())
-// {
-// if (m_auto_confirm_on)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == StopSourceContextAfterName ())
-// {
-// StreamString strm;
-// strm.Printf ("%u", m_stop_source_after_count);
-// value.AppendString (strm.GetData());
-// }
-// else if (var_name == StopSourceContextBeforeName ())
-// {
-// StreamString strm;
-// strm.Printf ("%u", m_stop_source_before_count);
-// value.AppendString (strm.GetData());
-// }
-// else if (var_name == StopDisassemblyCountName ())
-// {
-// StreamString strm;
-// strm.Printf ("%u", m_stop_disassembly_count);
-// value.AppendString (strm.GetData());
-// }
-// else if (var_name == StopDisassemblyDisplayName ())
-// {
-// if (m_stop_disassembly_display >= eStopDisassemblyTypeNever && m_stop_disassembly_display <= eStopDisassemblyTypeAlways)
-// value.AppendString (g_show_disassembly_enum_values[m_stop_disassembly_display].string_value);
-// else
-// value.AppendString ("<invalid>");
-// }
-// else
-// {
-// if (err)
-// err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-// return false;
-// }
-// return true;
-//}
-//
-//void
-//DebuggerInstanceSettings::CopyInstanceSettings (const InstanceSettingsSP &new_settings,
-// bool pending)
-//{
-// if (new_settings.get() == NULL)
-// return;
-//
-// DebuggerInstanceSettings *new_debugger_settings = (DebuggerInstanceSettings *) new_settings.get();
-//
-// m_prompt = new_debugger_settings->m_prompt;
-// if (!pending)
-// {
-// // 'instance_name' is actually (probably) in the form '[<instance_name>]'; if so, we need to
-// // strip off the brackets before passing it to BroadcastPromptChange.
-//
-// std::string tmp_instance_name (m_instance_name.AsCString());
-// if ((tmp_instance_name[0] == '[')
-// && (tmp_instance_name[m_instance_name.GetLength() - 1] == ']'))
-// tmp_instance_name = tmp_instance_name.substr (1, m_instance_name.GetLength() - 2);
-// ConstString new_name (tmp_instance_name.c_str());
-//
-// BroadcastPromptChange (new_name, m_prompt.c_str());
-// }
-// m_notify_void = new_debugger_settings->m_notify_void;
-// m_frame_format = new_debugger_settings->m_frame_format;
-// m_thread_format = new_debugger_settings->m_thread_format;
-// m_term_width = new_debugger_settings->m_term_width;
-// m_script_lang = new_debugger_settings->m_script_lang;
-// m_use_external_editor = new_debugger_settings->m_use_external_editor;
-// m_auto_confirm_on = new_debugger_settings->m_auto_confirm_on;
-//}
-//
-//
-//bool
-//DebuggerInstanceSettings::BroadcastPromptChange (const ConstString &instance_name, const char *new_prompt)
-//{
-// std::string tmp_prompt;
-//
-// if (new_prompt != NULL)
-// {
-// tmp_prompt = new_prompt ;
-// int len = tmp_prompt.size();
-// if (len > 1
-// && (tmp_prompt[0] == '\'' || tmp_prompt[0] == '"')
-// && (tmp_prompt[len-1] == tmp_prompt[0]))
-// {
-// tmp_prompt = tmp_prompt.substr(1,len-2);
-// }
-// len = tmp_prompt.size();
-// if (tmp_prompt[len-1] != ' ')
-// tmp_prompt.append(" ");
-// }
-// EventSP new_event_sp;
-// new_event_sp.reset (new Event(CommandInterpreter::eBroadcastBitResetPrompt,
-// new EventDataBytes (tmp_prompt.c_str())));
-//
-// if (instance_name.GetLength() != 0)
-// {
-// // Set prompt for a particular instance.
-// Debugger *dbg = Debugger::FindDebuggerWithInstanceName (instance_name).get();
-// if (dbg != NULL)
-// {
-// dbg->GetCommandInterpreter().BroadcastEvent (new_event_sp);
-// }
-// }
-//
-// return true;
-//}
-//
-//const ConstString
-//DebuggerInstanceSettings::CreateInstanceName ()
-//{
-// static int instance_count = 1;
-// StreamString sstr;
-//
-// sstr.Printf ("debugger_%d", instance_count);
-// ++instance_count;
-//
-// const ConstString ret_val (sstr.GetData());
-//
-// return ret_val;
-//}
-//
-
-//--------------------------------------------------
-// SettingsController Variable Tables
-//--------------------------------------------------
-
-//
-//SettingEntry
-//Debugger::SettingsController::global_settings_table[] =
-//{
-// //{ "var-name", var-type, "default", enum-table, init'd, hidden, "help-text"},
-// // The Debugger level global table should always be empty; all Debugger settable variables should be instance
-// // variables.
-// { NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-//};
-
-//SettingEntry
-//Debugger::SettingsController::instance_settings_table[] =
-//{
-//// NAME Setting variable type Default Enum Init'd Hidden Help
-//// ======================= ======================= ====================== ==== ====== ====== ======================
-//{ "frame-format", eSetVarTypeString, DEFAULT_FRAME_FORMAT, NULL, false, false, "The default frame format string to use when displaying thread information." },
-//{ "prompt", eSetVarTypeString, "(lldb) ", NULL, false, false, "The debugger command line prompt displayed for the user." },
-//{ "script-lang", eSetVarTypeString, "python", NULL, false, false, "The script language to be used for evaluating user-written scripts." },
-//{ "term-width", eSetVarTypeInt, "80" , NULL, false, false, "The maximum number of columns to use for displaying text." },
-//{ "thread-format", eSetVarTypeString, DEFAULT_THREAD_FORMAT, NULL, false, false, "The default thread format string to use when displaying thread information." },
-//{ "use-external-editor", eSetVarTypeBoolean, "false", NULL, false, false, "Whether to use an external editor or not." },
-//{ "auto-confirm", eSetVarTypeBoolean, "false", NULL, false, false, "If true all confirmation prompts will receive their default reply." },
-//{ "stop-line-count-before",eSetVarTypeInt, "3", NULL, false, false, "The number of sources lines to display that come before the current source line when displaying a stopped context." },
-//{ "stop-line-count-after", eSetVarTypeInt, "3", NULL, false, false, "The number of sources lines to display that come after the current source line when displaying a stopped context." },
-//{ "stop-disassembly-count", eSetVarTypeInt, "0", NULL, false, false, "The number of disassembly lines to show when displaying a stopped context." },
-//{ "stop-disassembly-display", eSetVarTypeEnum, "no-source", g_show_disassembly_enum_values, false, false, "Control when to display disassembly when displaying a stopped context." },
-//{ NULL, eSetVarTypeNone, NULL, NULL, false, false, NULL }
-//};
Modified: lldb/trunk/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserSettingsController.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Core/UserSettingsController.cpp (original)
+++ lldb/trunk/source/Core/UserSettingsController.cpp Wed Aug 22 13:39:03 2012
@@ -21,50 +21,6 @@
using namespace lldb;
using namespace lldb_private;
-//static void
-//DumpSettingEntry (CommandInterpreter &interpreter,
-// Stream &strm,
-// const uint32_t max_len,
-// const SettingEntry &entry)
-//{
-// StreamString description;
-//
-// if (entry.description)
-// description.Printf ("%s", entry.description);
-//
-// if (entry.default_value && entry.default_value[0])
-// description.Printf (" (default: %s)", entry.default_value);
-//
-// interpreter.OutputFormattedHelpText (strm,
-// entry.var_name,
-// "--",
-// description.GetData(),
-// max_len);
-//
-// if (entry.enum_values && entry.enum_values[0].string_value)
-// {
-// interpreter.OutputFormattedHelpText (strm,
-// "",
-// " ",
-// "Enumeration values:",
-// max_len);
-// for (uint32_t enum_idx=0; entry.enum_values[enum_idx].string_value != NULL; ++enum_idx)
-// {
-// description.Clear();
-// if (entry.enum_values[enum_idx].usage)
-// description.Printf ("%s = %s",
-// entry.enum_values[enum_idx].string_value,
-// entry.enum_values[enum_idx].usage);
-// else
-// description.Printf ("%s", entry.enum_values[enum_idx].string_value);
-// interpreter.OutputFormattedHelpText (strm,
-// "",
-// " ",
-// description.GetData(),
-// max_len);
-// }
-// }
-//}
lldb::OptionValueSP
Properties::GetPropertyValue (const ExecutionContext *exe_ctx,
Modified: lldb/trunk/source/Interpreter/OptionValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValue.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValue.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValue.cpp Wed Aug 22 13:39:03 2012
@@ -379,7 +379,7 @@
OptionValueFileSpec *option_value = GetAsFileSpec ();
if (option_value)
{
- option_value->SetCurrentValue(file_spec);
+ option_value->SetCurrentValue(file_spec, false);
return true;
}
return false;
Modified: lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp Wed Aug 22 13:39:03 2012
@@ -113,4 +113,12 @@
+const lldb::DataBufferSP &
+OptionValueFileSpec::GetFileContents()
+{
+ if (!m_data_sp && m_current_value)
+ m_data_sp = m_current_value.ReadFileContents();
+ return m_data_sp;
+}
+
Modified: lldb/trunk/source/Interpreter/OptionValueProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueProperties.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueProperties.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueProperties.cpp Wed Aug 22 13:39:03 2012
@@ -407,6 +407,20 @@
}
+OptionValueFileSpec *
+OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpec (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+{
+ const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+ if (property)
+ {
+ OptionValue *value = property->GetValue().get();
+ if (value)
+ return value->GetAsFileSpec();
+ }
+ return NULL;
+}
+
+
FileSpec
OptionValueProperties::GetPropertyAtIndexAsFileSpec (const ExecutionContext *exe_ctx, uint32_t idx) const
{
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Aug 22 13:39:03 2012
@@ -4062,38 +4062,16 @@
// break;
// }
// }
-// UserSettingsControllerSP &usc = GetSettingsController();
-// UserSettingsController::InitializeSettingsController (usc,
-// SettingsController::global_settings_table,
-// SettingsController::instance_settings_table);
//
-// // Now call SettingsInitialize() for each 'child' of Process settings
-// Thread::SettingsInitialize ();
+ Thread::SettingsInitialize ();
}
void
Process::SettingsTerminate ()
{
-// // Must call SettingsTerminate() on each 'child' of Process settings before terminating Process settings.
-//
-// Thread::SettingsTerminate ();
-//
-// // Now terminate Process Settings.
-//
-// UserSettingsControllerSP &usc = GetSettingsController();
-// UserSettingsController::FinalizeSettingsController (usc);
-// usc.reset();
+ Thread::SettingsTerminate ();
}
-//PropertiesSP &
-//Process::GetProperties ()
-//{
-// static PropertiesSP g_settings_sp;
-// if (!g_settings_sp)
-// g_settings_sp.reset (new ProcessProperties());
-// return g_settings_sp;
-//}
-
ExecutionResults
Process::RunThreadPlan (ExecutionContext &exe_ctx,
lldb::ThreadPlanSP &thread_plan_sp,
@@ -4925,222 +4903,3 @@
{
m_thread_list.Flush();
}
-
-//--------------------------------------------------------------
-// class Process::SettingsController
-//--------------------------------------------------------------
-
-//Process::SettingsController::SettingsController () :
-// UserSettingsController ("process", Target::GetSettingsController())
-//{
-//}
-//
-//Process::SettingsController::~SettingsController ()
-//{
-//}
-//
-//lldb::InstanceSettingsSP
-//Process::SettingsController::CreateInstanceSettings (const char *instance_name)
-//{
-// lldb::InstanceSettingsSP new_settings_sp (new ProcessInstanceSettings (GetSettingsController(),
-// false,
-// instance_name));
-// return new_settings_sp;
-//}
-
-//--------------------------------------------------------------
-// class ProcessInstanceSettings
-//--------------------------------------------------------------
-//
-//ProcessInstanceSettings::ProcessInstanceSettings
-//(
-// const UserSettingsControllerSP &owner_sp,
-// bool live_instance,
-// const char *name
-//) :
-// InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance)
-//{
-// // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-// // until the vtables for ProcessInstanceSettings are properly set up, i.e. AFTER all the initializers.
-// // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-// // This is true for CreateInstanceName() too.
-//
-// if (GetInstanceName () == InstanceSettings::InvalidName())
-// {
-// ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-// owner_sp->RegisterInstanceSettings (this);
-// }
-//
-// if (live_instance)
-// {
-// const lldb::InstanceSettingsSP &pending_settings = owner_sp->FindPendingSettings (m_instance_name);
-// CopyInstanceSettings (pending_settings,false);
-// }
-//}
-//
-//ProcessInstanceSettings::ProcessInstanceSettings (const ProcessInstanceSettings &rhs) :
-// InstanceSettings (Process::GetSettingsController(), CreateInstanceName().AsCString()),
-// m_disable_memory_cache(rhs.m_disable_memory_cache),
-// m_extra_startup_commands (rhs.m_extra_startup_commands)
-//{
-// if (m_instance_name != InstanceSettings::GetDefaultName())
-// {
-// UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-// if (owner_sp)
-// {
-// CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
-// owner_sp->RemovePendingSettings (m_instance_name);
-// }
-// }
-//}
-//
-//ProcessInstanceSettings::~ProcessInstanceSettings ()
-//{
-//}
-//
-//ProcessInstanceSettings&
-//ProcessInstanceSettings::operator= (const ProcessInstanceSettings &rhs)
-//{
-// if (this != &rhs)
-// {
-// m_disable_memory_cache = rhs.m_disable_memory_cache;
-// m_extra_startup_commands = rhs.m_extra_startup_commands;
-// }
-//
-// return *this;
-//}
-//
-//
-//void
-//ProcessInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending)
-//{
-// if (var_name == GetDisableMemoryCacheVarName())
-// {
-// bool success;
-// bool result = Args::StringToBoolean(value, false, &success);
-//
-// if (success)
-// {
-// m_disable_memory_cache = result;
-// }
-// else
-// {
-// err.SetErrorStringWithFormat ("Bad value \"%s\" for %s, should be Boolean.", value, GetDisableMemoryCacheVarName().AsCString());
-// }
-//
-// }
-// else if (var_name == GetExtraStartupCommandVarName())
-// {
-// UserSettingsController::UpdateStringArrayVariable (op, index_value, m_extra_startup_commands, value, err);
-// }
-//}
-//
-//void
-//ProcessInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-// bool pending)
-//{
-// if (new_settings.get() == NULL)
-// return;
-//
-// ProcessInstanceSettings *new_settings_ptr = static_cast <ProcessInstanceSettings *> (new_settings.get());
-//
-// if (!new_settings_ptr)
-// return;
-//
-// *this = *new_settings_ptr;
-//}
-//
-//bool
-//ProcessInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err)
-//{
-// if (var_name == GetDisableMemoryCacheVarName())
-// {
-// value.AppendString(m_disable_memory_cache ? "true" : "false");
-// return true;
-// }
-// else if (var_name == GetExtraStartupCommandVarName())
-// {
-// if (m_extra_startup_commands.GetArgumentCount() > 0)
-// {
-// for (int i = 0; i < m_extra_startup_commands.GetArgumentCount(); ++i)
-// value.AppendString (m_extra_startup_commands.GetArgumentAtIndex (i));
-// }
-// return true;
-// }
-// else
-// {
-// if (err)
-// err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-// return false;
-// }
-//}
-//
-//const ConstString
-//ProcessInstanceSettings::CreateInstanceName ()
-//{
-// static int instance_count = 1;
-// StreamString sstr;
-//
-// sstr.Printf ("process_%d", instance_count);
-// ++instance_count;
-//
-// const ConstString ret_val (sstr.GetData());
-// return ret_val;
-//}
-//
-//const ConstString &
-//ProcessInstanceSettings::GetDisableMemoryCacheVarName () const
-//{
-// static ConstString disable_memory_cache_var_name ("disable-memory-cache");
-//
-// return disable_memory_cache_var_name;
-//}
-//
-//const ConstString &
-//ProcessInstanceSettings::GetExtraStartupCommandVarName () const
-//{
-// static ConstString extra_startup_command_var_name ("extra-startup-command");
-//
-// return extra_startup_command_var_name;
-//}
-//
-////--------------------------------------------------
-//// SettingsController Variable Tables
-////--------------------------------------------------
-//
-//SettingEntry
-//Process::SettingsController::global_settings_table[] =
-//{
-// //{ "var-name", var-type , "default", enum-table, init'd, hidden, "help-text"},
-// { NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-//};
-//
-//
-//SettingEntry
-//Process::SettingsController::instance_settings_table[] =
-//{
-// //{ "var-name", var-type, "default", enum-table, init'd, hidden, "help-text"},
-// { "disable-memory-cache", eSetVarTypeBoolean,
-//#ifdef ENABLE_MEMORY_CACHING
-// "false",
-//#else
-// "true",
-//#endif
-// NULL, false, false, "Disable reading and caching of memory in fixed-size units." },
-// { "extra-startup-command", eSetVarTypeArray, NULL, NULL, false, false, "A list containing extra commands understood by the particular process plugin used." },
-// { NULL, eSetVarTypeNone, NULL, NULL, false, false, NULL }
-//};
-//
-//
-
-
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Wed Aug 22 13:39:03 2012
@@ -56,7 +56,6 @@
Target::Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::PlatformSP &platform_sp) :
TargetProperties (this),
Broadcaster (&debugger, "lldb.target"),
-//TargetInstanceSettings (GetSettingsController()),
ExecutionContextScope (),
m_debugger (debugger),
m_platform_sp (platform_sp),
@@ -966,8 +965,6 @@
}
}
}
-
-// UpdateInstanceName();
}
@@ -999,7 +996,7 @@
ModuleSpec module_spec (executable_sp->GetFileSpec(), arch_spec);
Error error = ModuleList::GetSharedModule (module_spec,
executable_sp,
- NULL, // &GetExecutableSearchPaths(), // TODO: SETTINGS
+ &GetExecutableSearchPaths(),
NULL,
NULL);
@@ -1350,7 +1347,7 @@
transformed_spec.GetFileSpec().GetFilename() = module_spec.GetFileSpec().GetFilename();
error = ModuleList::GetSharedModule (transformed_spec,
module_sp,
- NULL, // TODO: SETTINGS &GetExecutableSearchPaths(),
+ &GetExecutableSearchPaths(),
&old_module_sp,
&did_create_module);
}
@@ -1371,7 +1368,7 @@
// We have a UUID, it is OK to check the global module list...
error = ModuleList::GetSharedModule (module_spec,
module_sp,
- NULL, // TODO: SETTINGS &GetExecutableSearchPaths(),
+ &GetExecutableSearchPaths(),
&old_module_sp,
&did_create_module);
}
@@ -1385,7 +1382,7 @@
FileSpec platform_file_spec;
error = m_platform_sp->GetSharedModule (module_spec,
module_sp,
- NULL, // TODO: SETTINGS &GetExecutableSearchPaths(),
+ &GetExecutableSearchPaths(),
&old_module_sp,
&did_create_module);
}
@@ -1527,47 +1524,14 @@
void
Target::SettingsInitialize ()
{
-// UserSettingsController::InitializeSettingsController (GetSettingsController(),
-// SettingsController::global_settings_table,
-// SettingsController::instance_settings_table);
-//
-// // Now call SettingsInitialize() on each 'child' setting of Target
-// Process::SettingsInitialize ();
+ Process::SettingsInitialize ();
}
void
Target::SettingsTerminate ()
{
-
- // Must call SettingsTerminate() on each settings 'child' of Target, before terminating Target's Settings.
-//
-// Process::SettingsTerminate ();
-//
-// // Now terminate Target Settings.
-//
-// UserSettingsControllerSP &usc = GetSettingsController();
-// UserSettingsController::FinalizeSettingsController (usc);
-// usc.reset();
-}
-
-//UserSettingsControllerSP &
-//Target::GetSettingsController ()
-//{
-// static UserSettingsControllerSP g_settings_controller_sp;
-// if (!g_settings_controller_sp)
-// {
-// g_settings_controller_sp.reset (new Target::SettingsController);
-// // The first shared pointer to Target::SettingsController in
-// // g_settings_controller_sp must be fully created above so that
-// // the TargetInstanceSettings can use a weak_ptr to refer back
-// // to the master setttings controller
-// InstanceSettingsSP default_instance_settings_sp (new TargetInstanceSettings (g_settings_controller_sp,
-// false,
-// InstanceSettings::GetDefaultName().AsCString()));
-// g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
-// }
-// return g_settings_controller_sp;
-//}
+ Process::SettingsTerminate ();
+}
FileSpecList
Target::GetDefaultExecutableSearchPaths ()
@@ -1610,31 +1574,6 @@
return target;
}
-
-//void
-//Target::UpdateInstanceName ()
-//{
-// StreamString sstr;
-//
-// Module *exe_module = GetExecutableModulePointer();
-// if (exe_module)
-// {
-// sstr.Printf ("%s_%s",
-// exe_module->GetFileSpec().GetFilename().AsCString(),
-// exe_module->GetArchitecture().GetArchitectureName());
-// GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
-// }
-//}
-//
-const char *
-Target::GetExpressionPrefixContentsAsCString ()
-{
- // TODO: SETTINGS
-// if (!m_expr_prefix_contents.empty())
-// return m_expr_prefix_contents.c_str();
- return NULL;
-}
-
ExecutionResults
Target::EvaluateExpression
(
@@ -2140,214 +2079,6 @@
s->SetIndentLevel (indent_level);
}
-
-//--------------------------------------------------------------
-// class Target::SettingsController
-//--------------------------------------------------------------
-
-//Target::SettingsController::SettingsController () :
-// UserSettingsController ("target", Debugger::GetSettingsController()),
-// m_default_architecture ()
-//{
-//}
-//
-//Target::SettingsController::~SettingsController ()
-//{
-//}
-//
-//lldb::InstanceSettingsSP
-//Target::SettingsController::CreateInstanceSettings (const char *instance_name)
-//{
-// lldb::InstanceSettingsSP new_settings_sp (new TargetInstanceSettings (GetSettingsController(),
-// false,
-// instance_name));
-// return new_settings_sp;
-//}
-//
-//
-//#define TSC_DEFAULT_ARCH "default-arch"
-//#define TSC_EXPR_PREFIX "expr-prefix"
-//#define TSC_PREFER_DYNAMIC "prefer-dynamic-value"
-//#define TSC_ENABLE_SYNTHETIC "enable-synthetic-value"
-//#define TSC_SKIP_PROLOGUE "skip-prologue"
-//#define TSC_SOURCE_MAP "source-map"
-//#define TSC_EXE_SEARCH_PATHS "exec-search-paths"
-//#define TSC_MAX_CHILDREN "max-children-count"
-//#define TSC_MAX_STRLENSUMMARY "max-string-summary-length"
-//#define TSC_PLATFORM_AVOID "breakpoints-use-platform-avoid-list"
-//#define TSC_RUN_ARGS "run-args"
-//#define TSC_ENV_VARS "env-vars"
-//#define TSC_INHERIT_ENV "inherit-env"
-//#define TSC_STDIN_PATH "input-path"
-//#define TSC_STDOUT_PATH "output-path"
-//#define TSC_STDERR_PATH "error-path"
-//#define TSC_DISABLE_ASLR "disable-aslr"
-//#define TSC_DISABLE_STDIO "disable-stdio"
-//
-//
-//static const ConstString &
-//GetSettingNameForDefaultArch ()
-//{
-// static ConstString g_const_string (TSC_DEFAULT_ARCH);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForExpressionPrefix ()
-//{
-// static ConstString g_const_string (TSC_EXPR_PREFIX);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForPreferDynamicValue ()
-//{
-// static ConstString g_const_string (TSC_PREFER_DYNAMIC);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForEnableSyntheticValue ()
-//{
-// static ConstString g_const_string (TSC_ENABLE_SYNTHETIC);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForSourcePathMap ()
-//{
-// static ConstString g_const_string (TSC_SOURCE_MAP);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForExecutableSearchPaths ()
-//{
-// static ConstString g_const_string (TSC_EXE_SEARCH_PATHS);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForSkipPrologue ()
-//{
-// static ConstString g_const_string (TSC_SKIP_PROLOGUE);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForMaxChildren ()
-//{
-// static ConstString g_const_string (TSC_MAX_CHILDREN);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForMaxStringSummaryLength ()
-//{
-// static ConstString g_const_string (TSC_MAX_STRLENSUMMARY);
-// return g_const_string;
-//}
-//
-//static const ConstString &
-//GetSettingNameForPlatformAvoid ()
-//{
-// static ConstString g_const_string (TSC_PLATFORM_AVOID);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForRunArgs ()
-//{
-// static ConstString g_const_string (TSC_RUN_ARGS);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForEnvVars ()
-//{
-// static ConstString g_const_string (TSC_ENV_VARS);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForInheritHostEnv ()
-//{
-// static ConstString g_const_string (TSC_INHERIT_ENV);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForInputPath ()
-//{
-// static ConstString g_const_string (TSC_STDIN_PATH);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForOutputPath ()
-//{
-// static ConstString g_const_string (TSC_STDOUT_PATH);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForErrorPath ()
-//{
-// static ConstString g_const_string (TSC_STDERR_PATH);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForDisableASLR ()
-//{
-// static ConstString g_const_string (TSC_DISABLE_ASLR);
-// return g_const_string;
-//}
-//
-//const ConstString &
-//GetSettingNameForDisableSTDIO ()
-//{
-// static ConstString g_const_string (TSC_DISABLE_STDIO);
-// return g_const_string;
-//}
-//
-//bool
-//Target::SettingsController::SetGlobalVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const SettingEntry &entry,
-// const VarSetOperationType op,
-// Error&err)
-//{
-// if (var_name == GetSettingNameForDefaultArch())
-// {
-// m_default_architecture.SetTriple (value);
-// if (!m_default_architecture.IsValid())
-// err.SetErrorStringWithFormat ("'%s' is not a valid architecture or triple.", value);
-// }
-// return true;
-//}
-//
-//
-//bool
-//Target::SettingsController::GetGlobalVariable (const ConstString &var_name,
-// StringList &value,
-// Error &err)
-//{
-// if (var_name == GetSettingNameForDefaultArch())
-// {
-// // If the arch is invalid (the default), don't show a string for it
-// if (m_default_architecture.IsValid())
-// value.AppendString (m_default_architecture.GetArchitectureName());
-// return true;
-// }
-// else
-// err.SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-//
-// return false;
-//}
-
-
//--------------------------------------------------------------
// class TargetProperties
//--------------------------------------------------------------
@@ -2621,7 +2352,7 @@
}
FileSpecList &
-TargetProperties::GetExecutableSearchPaths () const
+TargetProperties::GetExecutableSearchPaths ()
{
const uint32_t idx = ePropertyExecutableSearchPaths;
OptionValueFileSpecList *option_value = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList (NULL, false, idx);
@@ -2685,6 +2416,16 @@
return m_collection_sp->GetPropertyAtIndexAsFileSpec(NULL, idx);
}
+const char *
+TargetProperties::GetExpressionPrefixContentsAsCString ()
+{
+ const uint32_t idx = ePropertyExprPrefix;
+ OptionValueFileSpec *file = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec (NULL, false, idx);
+ if (file)
+ return (const char *)file->GetFileContents()->GetBytes();
+ return NULL;
+}
+
void
TargetProperties::SetStandardErrorPath (const char *p)
{
@@ -2710,609 +2451,6 @@
return g_settings_sp;
}
-// TODO: SETTINGS
-//bool
-//TargetProperties::GetRunArguments (Args &args) const
-//{
-// if (m_run_args)
-// {
-// m_run_args->GetArgs(args);
-// return true;
-// }
-// else if (m_parent_sp)
-// {
-// return m_parent_sp->GetRunArguments(args);
-// }
-// return false;
-//}
-//
-//void
-//TargetProperties::SetRunArguments (const Args &args)
-//{
-// // TODO: SETTINGS
-//}
-
-
-//--------------------------------------------------------------
-// class TargetInstanceSettings
-//--------------------------------------------------------------
-
-//TargetInstanceSettings::TargetInstanceSettings
-//(
-// const lldb::UserSettingsControllerSP &owner_sp,
-// bool live_instance,
-// const char *name
-//) :
-// InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
-// m_expr_prefix_file (),
-// m_expr_prefix_contents (),
-// m_prefer_dynamic_value (2),
-// m_enable_synthetic_value(true, true),
-// m_skip_prologue (true, true),
-// m_source_map (NULL, NULL),
-// m_exe_search_paths (),
-// m_max_children_display(256),
-// m_max_strlen_length(1024),
-// m_breakpoints_use_platform_avoid (true, true),
-// m_run_args (),
-// m_env_vars (),
-// m_input_path (),
-// m_output_path (),
-// m_error_path (),
-// m_disable_aslr (true),
-// m_disable_stdio (false),
-// m_inherit_host_env (true),
-// m_got_host_env (false)
-//{
-// // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-// // until the vtables for TargetInstanceSettings are properly set up, i.e. AFTER all the initializers.
-// // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-// // This is true for CreateInstanceName() too.
-//
-// if (GetInstanceName () == InstanceSettings::InvalidName())
-// {
-// ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-// owner_sp->RegisterInstanceSettings (this);
-// }
-//
-// if (live_instance)
-// {
-// const lldb::InstanceSettingsSP &pending_settings = owner_sp->FindPendingSettings (m_instance_name);
-// CopyInstanceSettings (pending_settings,false);
-// }
-//}
-//
-//TargetInstanceSettings::TargetInstanceSettings (const TargetInstanceSettings &rhs) :
-// InstanceSettings (Target::GetSettingsController(), CreateInstanceName().AsCString()),
-// m_expr_prefix_file (rhs.m_expr_prefix_file),
-// m_expr_prefix_contents (rhs.m_expr_prefix_contents),
-// m_prefer_dynamic_value (rhs.m_prefer_dynamic_value),
-// m_enable_synthetic_value(rhs.m_enable_synthetic_value),
-// m_skip_prologue (rhs.m_skip_prologue),
-// m_source_map (rhs.m_source_map),
-// m_exe_search_paths (rhs.m_exe_search_paths),
-// m_max_children_display (rhs.m_max_children_display),
-// m_max_strlen_length (rhs.m_max_strlen_length),
-// m_breakpoints_use_platform_avoid (rhs.m_breakpoints_use_platform_avoid),
-// m_run_args (rhs.m_run_args),
-// m_env_vars (rhs.m_env_vars),
-// m_input_path (rhs.m_input_path),
-// m_output_path (rhs.m_output_path),
-// m_error_path (rhs.m_error_path),
-// m_disable_aslr (rhs.m_disable_aslr),
-// m_disable_stdio (rhs.m_disable_stdio),
-// m_inherit_host_env (rhs.m_inherit_host_env)
-//{
-// if (m_instance_name != InstanceSettings::GetDefaultName())
-// {
-// UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-// if (owner_sp)
-// CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name),false);
-// }
-//}
-//
-//TargetInstanceSettings::~TargetInstanceSettings ()
-//{
-//}
-//
-//TargetInstanceSettings&
-//TargetInstanceSettings::operator= (const TargetInstanceSettings &rhs)
-//{
-// if (this != &rhs)
-// {
-// m_expr_prefix_file = rhs.m_expr_prefix_file;
-// m_expr_prefix_contents = rhs.m_expr_prefix_contents;
-// m_prefer_dynamic_value = rhs.m_prefer_dynamic_value;
-// m_enable_synthetic_value = rhs.m_enable_synthetic_value;
-// m_skip_prologue = rhs.m_skip_prologue;
-// m_source_map = rhs.m_source_map;
-// m_exe_search_paths = rhs.m_exe_search_paths;
-// m_max_children_display = rhs.m_max_children_display;
-// m_max_strlen_length = rhs.m_max_strlen_length;
-// m_breakpoints_use_platform_avoid = rhs.m_breakpoints_use_platform_avoid;
-// m_run_args = rhs.m_run_args;
-// m_env_vars = rhs.m_env_vars;
-// m_input_path = rhs.m_input_path;
-// m_output_path = rhs.m_output_path;
-// m_error_path = rhs.m_error_path;
-// m_disable_aslr = rhs.m_disable_aslr;
-// m_disable_stdio = rhs.m_disable_stdio;
-// m_inherit_host_env = rhs.m_inherit_host_env;
-// }
-//
-// return *this;
-//}
-//
-//void
-//TargetInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending)
-//{
-// if (var_name == GetSettingNameForExpressionPrefix ())
-// {
-// err = UserSettingsController::UpdateFileSpecOptionValue (value, op, m_expr_prefix_file);
-// if (err.Success())
-// {
-// switch (op)
-// {
-// default:
-// break;
-// case eVarSetOperationAssign:
-// case eVarSetOperationAppend:
-// {
-// m_expr_prefix_contents.clear();
-//
-// if (!m_expr_prefix_file.GetCurrentValue().Exists())
-// {
-// err.SetErrorToGenericError ();
-// err.SetErrorStringWithFormat ("%s does not exist", value);
-// return;
-// }
-//
-// DataBufferSP file_data_sp (m_expr_prefix_file.GetCurrentValue().ReadFileContents(0, SIZE_MAX, &err));
-//
-// if (err.Success())
-// {
-// if (file_data_sp && file_data_sp->GetByteSize() > 0)
-// {
-// m_expr_prefix_contents.assign((const char*)file_data_sp->GetBytes(), file_data_sp->GetByteSize());
-// }
-// else
-// {
-// err.SetErrorStringWithFormat ("couldn't read data from '%s'", value);
-// }
-// }
-// }
-// break;
-// case eVarSetOperationClear:
-// m_expr_prefix_contents.clear();
-// }
-// }
-// }
-// else if (var_name == GetSettingNameForPreferDynamicValue())
-// {
-// int new_value;
-// UserSettingsController::UpdateEnumVariable (g_dynamic_value_types, &new_value, value, err);
-// if (err.Success())
-// m_prefer_dynamic_value = new_value;
-// }
-// else if (var_name == GetSettingNameForEnableSyntheticValue())
-// {
-// bool ok;
-// bool new_value = Args::StringToBoolean(value, true, &ok);
-// if (ok)
-// m_enable_synthetic_value.SetCurrentValue(new_value);
-// }
-// else if (var_name == GetSettingNameForSkipPrologue())
-// {
-// err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_skip_prologue);
-// }
-// else if (var_name == GetSettingNameForMaxChildren())
-// {
-// bool ok;
-// uint32_t new_value = Args::StringToUInt32(value, 0, 10, &ok);
-// if (ok)
-// m_max_children_display = new_value;
-// }
-// else if (var_name == GetSettingNameForMaxStringSummaryLength())
-// {
-// bool ok;
-// uint32_t new_value = Args::StringToUInt32(value, 0, 10, &ok);
-// if (ok)
-// m_max_strlen_length = new_value;
-// }
-// else if (var_name == GetSettingNameForExecutableSearchPaths())
-// {
-// switch (op)
-// {
-// case eVarSetOperationReplace:
-// case eVarSetOperationInsertBefore:
-// case eVarSetOperationInsertAfter:
-// case eVarSetOperationRemove:
-// default:
-// break;
-// case eVarSetOperationAssign:
-// m_exe_search_paths.Clear();
-// // Fall through to append....
-// case eVarSetOperationAppend:
-// {
-// Args args(value);
-// const uint32_t argc = args.GetArgumentCount();
-// if (argc > 0)
-// {
-// const char *exe_search_path_dir;
-// for (uint32_t idx = 0; (exe_search_path_dir = args.GetArgumentAtIndex(idx)) != NULL; ++idx)
-// {
-// FileSpec file_spec;
-// file_spec.GetDirectory().SetCString(exe_search_path_dir);
-// FileSpec::FileType file_type = file_spec.GetFileType();
-// if (file_type == FileSpec::eFileTypeDirectory || file_type == FileSpec::eFileTypeInvalid)
-// {
-// m_exe_search_paths.Append(file_spec);
-// }
-// else
-// {
-// err.SetErrorStringWithFormat("executable search path '%s' exists, but it does not resolve to a directory", exe_search_path_dir);
-// }
-// }
-// }
-// }
-// break;
-//
-// case eVarSetOperationClear:
-// m_exe_search_paths.Clear();
-// break;
-// }
-// }
-// else if (var_name == GetSettingNameForSourcePathMap ())
-// {
-// switch (op)
-// {
-// case eVarSetOperationReplace:
-// case eVarSetOperationInsertBefore:
-// case eVarSetOperationInsertAfter:
-// case eVarSetOperationRemove:
-// default:
-// break;
-// case eVarSetOperationAssign:
-// m_source_map.Clear(true);
-// // Fall through to append....
-// case eVarSetOperationAppend:
-// {
-// Args args(value);
-// const uint32_t argc = args.GetArgumentCount();
-// if (argc & 1 || argc == 0)
-// {
-// err.SetErrorStringWithFormat ("an even number of paths must be supplied to to the source-map setting: %u arguments given", argc);
-// }
-// else
-// {
-// char resolved_new_path[PATH_MAX];
-// FileSpec file_spec;
-// const char *old_path;
-// for (uint32_t idx = 0; (old_path = args.GetArgumentAtIndex(idx)) != NULL; idx += 2)
-// {
-// const char *new_path = args.GetArgumentAtIndex(idx+1);
-// assert (new_path); // We have an even number of paths, this shouldn't happen!
-//
-// file_spec.SetFile(new_path, true);
-// if (file_spec.Exists())
-// {
-// if (file_spec.GetPath (resolved_new_path, sizeof(resolved_new_path)) >= sizeof(resolved_new_path))
-// {
-// err.SetErrorStringWithFormat("new path '%s' is too long", new_path);
-// return;
-// }
-// }
-// else
-// {
-// err.SetErrorStringWithFormat("new path '%s' doesn't exist", new_path);
-// return;
-// }
-// m_source_map.Append(ConstString (old_path), ConstString (resolved_new_path), true);
-// }
-// }
-// }
-// break;
-//
-// case eVarSetOperationClear:
-// m_source_map.Clear(true);
-// break;
-// }
-// }
-// else if (var_name == GetSettingNameForPlatformAvoid ())
-// {
-// err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_breakpoints_use_platform_avoid);
-// }
-// else if (var_name == GetSettingNameForRunArgs())
-// {
-// UserSettingsController::UpdateStringArrayVariable (op, index_value, m_run_args, value, err);
-// }
-// else if (var_name == GetSettingNameForEnvVars())
-// {
-// // This is nice for local debugging, but it is isn't correct for
-// // remote debugging. We need to stop process.env-vars from being
-// // populated with the host environment and add this as a launch option
-// // and get the correct environment from the Target's platform.
-// // GetHostEnvironmentIfNeeded ();
-// UserSettingsController::UpdateDictionaryVariable (op, index_value, m_env_vars, value, err);
-// }
-// else if (var_name == GetSettingNameForInputPath())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_input_path, value, err);
-// }
-// else if (var_name == GetSettingNameForOutputPath())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_output_path, value, err);
-// }
-// else if (var_name == GetSettingNameForErrorPath())
-// {
-// UserSettingsController::UpdateStringVariable (op, m_error_path, value, err);
-// }
-// else if (var_name == GetSettingNameForDisableASLR())
-// {
-// UserSettingsController::UpdateBooleanVariable (op, m_disable_aslr, value, true, err);
-// }
-// else if (var_name == GetSettingNameForDisableSTDIO ())
-// {
-// UserSettingsController::UpdateBooleanVariable (op, m_disable_stdio, value, false, err);
-// }
-//}
-//
-//void
-//TargetInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings, bool pending)
-//{
-// TargetInstanceSettings *new_settings_ptr = static_cast <TargetInstanceSettings *> (new_settings.get());
-//
-// if (!new_settings_ptr)
-// return;
-//
-// *this = *new_settings_ptr;
-//}
-//
-//bool
-//TargetInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err)
-//{
-// if (var_name == GetSettingNameForExpressionPrefix ())
-// {
-// char path[PATH_MAX];
-// const size_t path_len = m_expr_prefix_file.GetCurrentValue().GetPath (path, sizeof(path));
-// if (path_len > 0)
-// value.AppendString (path, path_len);
-// }
-// else if (var_name == GetSettingNameForPreferDynamicValue())
-// {
-// value.AppendString (g_dynamic_value_types[m_prefer_dynamic_value].string_value);
-// }
-// else if (var_name == GetSettingNameForEnableSyntheticValue())
-// {
-// if (m_skip_prologue)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == GetSettingNameForSkipPrologue())
-// {
-// if (m_skip_prologue)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == GetSettingNameForExecutableSearchPaths())
-// {
-// if (m_exe_search_paths.GetSize())
-// {
-// for (size_t i = 0, n = m_exe_search_paths.GetSize(); i < n; ++i)
-// {
-// value.AppendString(m_exe_search_paths.GetFileSpecAtIndex (i).GetDirectory().AsCString());
-// }
-// }
-// }
-// else if (var_name == GetSettingNameForSourcePathMap ())
-// {
-// if (m_source_map.GetSize())
-// {
-// size_t i;
-// for (i = 0; i < m_source_map.GetSize(); ++i) {
-// StreamString sstr;
-// m_source_map.Dump(&sstr, i);
-// value.AppendString(sstr.GetData());
-// }
-// }
-// }
-// else if (var_name == GetSettingNameForMaxChildren())
-// {
-// StreamString count_str;
-// count_str.Printf ("%d", m_max_children_display);
-// value.AppendString (count_str.GetData());
-// }
-// else if (var_name == GetSettingNameForMaxStringSummaryLength())
-// {
-// StreamString count_str;
-// count_str.Printf ("%d", m_max_strlen_length);
-// value.AppendString (count_str.GetData());
-// }
-// else if (var_name == GetSettingNameForPlatformAvoid())
-// {
-// if (m_breakpoints_use_platform_avoid)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == GetSettingNameForRunArgs())
-// {
-// if (m_run_args.GetArgumentCount() > 0)
-// {
-// for (int i = 0; i < m_run_args.GetArgumentCount(); ++i)
-// value.AppendString (m_run_args.GetArgumentAtIndex (i));
-// }
-// }
-// else if (var_name == GetSettingNameForEnvVars())
-// {
-// GetHostEnvironmentIfNeeded ();
-//
-// if (m_env_vars.size() > 0)
-// {
-// std::map<std::string, std::string>::iterator pos;
-// for (pos = m_env_vars.begin(); pos != m_env_vars.end(); ++pos)
-// {
-// StreamString value_str;
-// value_str.Printf ("%s=%s", pos->first.c_str(), pos->second.c_str());
-// value.AppendString (value_str.GetData());
-// }
-// }
-// }
-// else if (var_name == GetSettingNameForInputPath())
-// {
-// value.AppendString (m_input_path.c_str());
-// }
-// else if (var_name == GetSettingNameForOutputPath())
-// {
-// value.AppendString (m_output_path.c_str());
-// }
-// else if (var_name == GetSettingNameForErrorPath())
-// {
-// value.AppendString (m_error_path.c_str());
-// }
-// else if (var_name == GetSettingNameForInheritHostEnv())
-// {
-// if (m_inherit_host_env)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == GetSettingNameForDisableASLR())
-// {
-// if (m_disable_aslr)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else if (var_name == GetSettingNameForDisableSTDIO())
-// {
-// if (m_disable_stdio)
-// value.AppendString ("true");
-// else
-// value.AppendString ("false");
-// }
-// else
-// {
-// if (err)
-// err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-// return false;
-// }
-// return true;
-//}
-//
-//void
-//Target::TargetInstanceSettings::GetHostEnvironmentIfNeeded ()
-//{
-// if (m_inherit_host_env && !m_got_host_env)
-// {
-// m_got_host_env = true;
-// StringList host_env;
-// const size_t host_env_count = Host::GetEnvironment (host_env);
-// for (size_t idx=0; idx<host_env_count; idx++)
-// {
-// const char *env_entry = host_env.GetStringAtIndex (idx);
-// if (env_entry)
-// {
-// const char *equal_pos = ::strchr(env_entry, '=');
-// if (equal_pos)
-// {
-// std::string key (env_entry, equal_pos - env_entry);
-// std::string value (equal_pos + 1);
-// if (m_env_vars.find (key) == m_env_vars.end())
-// m_env_vars[key] = value;
-// }
-// }
-// }
-// }
-//}
-//
-//
-//size_t
-//Target::TargetInstanceSettings::GetEnvironmentAsArgs (Args &env)
-//{
-// GetHostEnvironmentIfNeeded ();
-//
-// dictionary::const_iterator pos, end = m_env_vars.end();
-// for (pos = m_env_vars.begin(); pos != end; ++pos)
-// {
-// std::string env_var_equal_value (pos->first);
-// env_var_equal_value.append(1, '=');
-// env_var_equal_value.append (pos->second);
-// env.AppendArgument (env_var_equal_value.c_str());
-// }
-// return env.GetArgumentCount();
-//}
-//
-//
-//const ConstString
-//TargetInstanceSettings::CreateInstanceName ()
-//{
-// StreamString sstr;
-// static int instance_count = 1;
-//
-// sstr.Printf ("target_%d", instance_count);
-// ++instance_count;
-//
-// const ConstString ret_val (sstr.GetData());
-// return ret_val;
-//}
-//
-////--------------------------------------------------
-//// Target::SettingsController Variable Tables
-////--------------------------------------------------
-//
-//
-//SettingEntry
-//Target::SettingsController::global_settings_table[] =
-//{
-// // var-name var-type default enum init'd hidden help-text
-// // ================= ================== =========== ==== ====== ====== =========================================================================
-// { TSC_DEFAULT_ARCH , eSetVarTypeString , NULL , NULL, false, false, "Default architecture to choose, when there's a choice." },
-// { NULL , eSetVarTypeNone , NULL , NULL, false, false, NULL }
-//};
-//
-//SettingEntry
-//Target::SettingsController::instance_settings_table[] =
-//{
-// // var-name var-type default enum init'd hidden help-text
-// // ================= ================== =============== ======================= ====== ====== =========================================================================
-// { TSC_EXPR_PREFIX , eSetVarTypeString , NULL , NULL, false, false, "Path to a file containing expressions to be prepended to all expressions." },
-// { TSC_PREFER_DYNAMIC , eSetVarTypeEnum , NULL , g_dynamic_value_types, false, false, "Should printed values be shown as their dynamic value." },
-// { TSC_ENABLE_SYNTHETIC , eSetVarTypeBoolean, "true" , NULL, false, false, "Should synthetic values be used by default whenever available." },
-// { TSC_SKIP_PROLOGUE , eSetVarTypeBoolean, "true" , NULL, false, false, "Skip function prologues when setting breakpoints by name." },
-// { TSC_SOURCE_MAP , eSetVarTypeArray , NULL , NULL, false, false, "Source path remappings used to track the change of location between a source file when built, and "
-// "where it exists on the current system. It consists of an array of duples, the first element of each duple is "
-// "some part (starting at the root) of the path to the file when it was built, "
-// "and the second is where the remainder of the original build hierarchy is rooted on the local system. "
-// "Each element of the array is checked in order and the first one that results in a match wins." },
-// { TSC_EXE_SEARCH_PATHS , eSetVarTypeArray , NULL , NULL, false, false, "Executable search paths to use when locating executable files whose paths don't match the local file system." },
-// { TSC_MAX_CHILDREN , eSetVarTypeInt , "256" , NULL, true, false, "Maximum number of children to expand in any level of depth." },
-// { TSC_MAX_STRLENSUMMARY , eSetVarTypeInt , "1024" , NULL, true, false, "Maximum number of characters to show when using %s in summary strings." },
-// { TSC_PLATFORM_AVOID , eSetVarTypeBoolean, "true" , NULL, false, false, "Consult the platform module avoid list when setting non-module specific breakpoints." },
-// { TSC_RUN_ARGS , eSetVarTypeArray , NULL , NULL, false, false, "A list containing all the arguments to be passed to the executable when it is run." },
-// { TSC_ENV_VARS , eSetVarTypeDictionary, NULL , NULL, false, false, "A list of all the environment variables to be passed to the executable's environment, and their values." },
-// { TSC_INHERIT_ENV , eSetVarTypeBoolean, "true" , NULL, false, false, "Inherit the environment from the process that is running LLDB." },
-// { TSC_STDIN_PATH , eSetVarTypeString , NULL , NULL, false, false, "The file/path to be used by the executable program for reading its standard input." },
-// { TSC_STDOUT_PATH , eSetVarTypeString , NULL , NULL, false, false, "The file/path to be used by the executable program for writing its standard output." },
-// { TSC_STDERR_PATH , eSetVarTypeString , NULL , NULL, false, false, "The file/path to be used by the executable program for writing its standard error." },
-//// { "plugin", eSetVarTypeEnum, NULL, NULL, false, false, "The plugin to be used to run the process." },
-// { TSC_DISABLE_ASLR , eSetVarTypeBoolean, "true" , NULL, false, false, "Disable Address Space Layout Randomization (ASLR)" },
-// { TSC_DISABLE_STDIO , eSetVarTypeBoolean, "false" , NULL, false, false, "Disable stdin/stdout for process (e.g. for a GUI application)" },
-// { NULL , eSetVarTypeNone , NULL , NULL, false, false, NULL }
-//};
-//
const ConstString &
Target::TargetEventData::GetFlavorString ()
{
Modified: lldb/trunk/source/Target/TargetList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/TargetList.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Target/TargetList.cpp (original)
+++ lldb/trunk/source/Target/TargetList.cpp Wed Aug 22 13:39:03 2012
@@ -216,8 +216,6 @@
if (target_sp)
{
- //target_sp->UpdateInstanceName();
-
Mutex::Locker locker(m_target_list_mutex);
m_selected_target_idx = m_target_list.size();
m_target_list.push_back(target_sp);
Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=162376&r1=162375&r2=162376&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Wed Aug 22 13:39:03 2012
@@ -79,7 +79,7 @@
// is part of a new lldb_private::Thread instance. It will copy all current
// global property values as needed
ThreadOptionValueProperties (ThreadProperties *global_properties) :
- OptionValueProperties(*global_properties->GetValueProperties())
+ OptionValueProperties(*global_properties->GetValueProperties())
{
}
@@ -139,7 +139,6 @@
Thread::Thread (const ProcessSP &process_sp, lldb::tid_t tid) :
ThreadProperties (false),
UserID (tid),
-//ThreadInstanceSettings (GetSettingsController()),
m_process_wp (process_sp),
m_actual_stop_info_sp (),
m_index_id (process_sp->GetNextThreadIndexID ()),
@@ -164,7 +163,6 @@
log->Printf ("%p Thread::Thread(tid = 0x%4.4llx)", this, GetID());
QueueFundamentalPlan(true);
- //UpdateInstanceName();
}
@@ -1290,61 +1288,12 @@
void
Thread::SettingsInitialize ()
{
-// UserSettingsController::InitializeSettingsController (GetSettingsController(),
-// SettingsController::global_settings_table,
-// SettingsController::instance_settings_table);
-//
- // Now call SettingsInitialize() on each 'child' setting of Thread.
- // Currently there are none.
}
void
Thread::SettingsTerminate ()
{
- // Must call SettingsTerminate() on each 'child' setting of Thread before terminating Thread settings.
- // Currently there are none.
-
- // Now terminate Thread Settings.
-//
-// UserSettingsControllerSP &usc = GetSettingsController();
-// UserSettingsController::FinalizeSettingsController (usc);
-// usc.reset();
-}
-
-//UserSettingsControllerSP &
-//Thread::GetSettingsController ()
-//{
-// static UserSettingsControllerSP g_settings_controller_sp;
-// if (!g_settings_controller_sp)
-// {
-// g_settings_controller_sp.reset (new Thread::SettingsController);
-// // The first shared pointer to Target::SettingsController in
-// // g_settings_controller_sp must be fully created above so that
-// // the TargetInstanceSettings can use a weak_ptr to refer back
-// // to the master setttings controller
-// InstanceSettingsSP default_instance_settings_sp (new ThreadInstanceSettings (g_settings_controller_sp,
-// false,
-// InstanceSettings::GetDefaultName().AsCString()));
-//
-// g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
-// }
-// return g_settings_controller_sp;
-//}
-
-//void
-//Thread::UpdateInstanceName ()
-//{
-// StreamString sstr;
-// const char *name = GetName();
-//
-// if (name && name[0] != '\0')
-// sstr.Printf ("%s", name);
-// else if ((GetIndexID() != 0) || (GetID() != 0))
-// sstr.Printf ("0x%4.4x", GetIndexID());
-//
-// if (sstr.GetSize() > 0)
-// Thread::GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
-//}
+}
lldb::StackFrameSP
Thread::GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
@@ -1510,231 +1459,3 @@
ClearStackFrames ();
m_reg_context_sp.reset();
}
-
-
-#pragma mark "Thread::SettingsController"
-//--------------------------------------------------------------
-// class Thread::SettingsController
-//--------------------------------------------------------------
-//
-//Thread::SettingsController::SettingsController () :
-// UserSettingsController ("thread", Process::GetSettingsController())
-//{
-//}
-//
-//Thread::SettingsController::~SettingsController ()
-//{
-//}
-//
-//lldb::InstanceSettingsSP
-//Thread::SettingsController::CreateInstanceSettings (const char *instance_name)
-//{
-// lldb::InstanceSettingsSP new_settings_sp (new ThreadInstanceSettings (GetSettingsController(),
-// false,
-// instance_name));
-// return new_settings_sp;
-//}
-
-//#pragma mark "ThreadInstanceSettings"
-////--------------------------------------------------------------
-//// class ThreadInstanceSettings
-////--------------------------------------------------------------
-//
-//ThreadInstanceSettings::ThreadInstanceSettings (const UserSettingsControllerSP &owner_sp, bool live_instance, const char *name) :
-// InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
-// m_avoid_regexp_ap (),
-// m_trace_enabled (false)
-//{
-// // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-// // until the vtables for ThreadInstanceSettings are properly set up, i.e. AFTER all the initializers.
-// // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-// // This is true for CreateInstanceName() too.
-//
-// if (GetInstanceName() == InstanceSettings::InvalidName())
-// {
-// ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-// owner_sp->RegisterInstanceSettings (this);
-// }
-//
-// if (live_instance)
-// {
-// CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name),false);
-// }
-//}
-//
-//ThreadInstanceSettings::ThreadInstanceSettings (const ThreadInstanceSettings &rhs) :
-// InstanceSettings (Thread::GetSettingsController(), CreateInstanceName().AsCString()),
-// m_avoid_regexp_ap (),
-// m_trace_enabled (rhs.m_trace_enabled)
-//{
-// if (m_instance_name != InstanceSettings::GetDefaultName())
-// {
-// UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-// if (owner_sp)
-// {
-// CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
-// owner_sp->RemovePendingSettings (m_instance_name);
-// }
-// }
-// if (rhs.m_avoid_regexp_ap.get() != NULL)
-// m_avoid_regexp_ap.reset(new RegularExpression(rhs.m_avoid_regexp_ap->GetText()));
-//}
-//
-//ThreadInstanceSettings::~ThreadInstanceSettings ()
-//{
-//}
-//
-//ThreadInstanceSettings&
-//ThreadInstanceSettings::operator= (const ThreadInstanceSettings &rhs)
-//{
-// if (this != &rhs)
-// {
-// if (rhs.m_avoid_regexp_ap.get() != NULL)
-// m_avoid_regexp_ap.reset(new RegularExpression(rhs.m_avoid_regexp_ap->GetText()));
-// else
-// m_avoid_regexp_ap.reset(NULL);
-// }
-// m_trace_enabled = rhs.m_trace_enabled;
-// return *this;
-//}
-//
-//
-//void
-//ThreadInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-// const char *index_value,
-// const char *value,
-// const ConstString &instance_name,
-// const SettingEntry &entry,
-// VarSetOperationType op,
-// Error &err,
-// bool pending)
-//{
-// if (var_name == StepAvoidRegexpVarName())
-// {
-// std::string regexp_text;
-// if (m_avoid_regexp_ap.get() != NULL)
-// regexp_text.append (m_avoid_regexp_ap->GetText());
-// UserSettingsController::UpdateStringVariable (op, regexp_text, value, err);
-// if (regexp_text.empty())
-// m_avoid_regexp_ap.reset();
-// else
-// {
-// m_avoid_regexp_ap.reset(new RegularExpression(regexp_text.c_str()));
-//
-// }
-// }
-// else if (var_name == GetTraceThreadVarName())
-// {
-// bool success;
-// bool result = Args::StringToBoolean(value, false, &success);
-//
-// if (success)
-// {
-// m_trace_enabled = result;
-// if (!pending)
-// {
-// Thread *myself = static_cast<Thread *> (this);
-// myself->EnableTracer(m_trace_enabled, true);
-// }
-// }
-// else
-// {
-// err.SetErrorStringWithFormat ("Bad value \"%s\" for trace-thread, should be Boolean.", value);
-// }
-//
-// }
-//}
-//
-//void
-//ThreadInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-// bool pending)
-//{
-// if (new_settings.get() == NULL)
-// return;
-//
-// ThreadInstanceSettings *new_process_settings = (ThreadInstanceSettings *) new_settings.get();
-// if (new_process_settings->GetSymbolsToAvoidRegexp() != NULL)
-// m_avoid_regexp_ap.reset (new RegularExpression (new_process_settings->GetSymbolsToAvoidRegexp()->GetText()));
-// else
-// m_avoid_regexp_ap.reset ();
-//}
-//
-//bool
-//ThreadInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-// const ConstString &var_name,
-// StringList &value,
-// Error *err)
-//{
-// if (var_name == StepAvoidRegexpVarName())
-// {
-// if (m_avoid_regexp_ap.get() != NULL)
-// {
-// std::string regexp_text("\"");
-// regexp_text.append(m_avoid_regexp_ap->GetText());
-// regexp_text.append ("\"");
-// value.AppendString (regexp_text.c_str());
-// }
-//
-// }
-// else if (var_name == GetTraceThreadVarName())
-// {
-// value.AppendString(m_trace_enabled ? "true" : "false");
-// }
-// else
-// {
-// if (err)
-// err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-// return false;
-// }
-// return true;
-//}
-//
-//const ConstString
-//ThreadInstanceSettings::CreateInstanceName ()
-//{
-// static int instance_count = 1;
-// StreamString sstr;
-//
-// sstr.Printf ("thread_%d", instance_count);
-// ++instance_count;
-//
-// const ConstString ret_val (sstr.GetData());
-// return ret_val;
-//}
-//
-//const ConstString &
-//ThreadInstanceSettings::StepAvoidRegexpVarName ()
-//{
-// static ConstString step_avoid_var_name ("step-avoid-regexp");
-//
-// return step_avoid_var_name;
-//}
-//
-//const ConstString &
-//ThreadInstanceSettings::GetTraceThreadVarName ()
-//{
-// static ConstString trace_thread_var_name ("trace-thread");
-//
-// return trace_thread_var_name;
-//}
-//
-//--------------------------------------------------
-// SettingsController Variable Tables
-//--------------------------------------------------
-//
-//SettingEntry
-//Thread::SettingsController::global_settings_table[] =
-//{
-// //{ "var-name", var-type , "default", enum-table, init'd, hidden, "help-text"},
-// { NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-//};
-//
-//
-//SettingEntry
-//Thread::SettingsController::instance_settings_table[] =
-//{
-// //{ "var-name", var-type, "default", enum-table, init'd, hidden, "help-text"},
-// { "step-avoid-regexp", eSetVarTypeString, "", NULL, false, false, "A regular expression defining functions step-in won't stop in." },
-// { "trace-thread", eSetVarTypeBoolean, "false", NULL, false, false, "If true, this thread will single-step and log execution." },
-// { NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-//};
More information about the lldb-commits
mailing list