diff options
| author | Caroline Tice <ctice@apple.com> | 2010-09-08 17:48:55 +0000 |
|---|---|---|
| committer | Caroline Tice <ctice@apple.com> | 2010-09-08 17:48:55 +0000 |
| commit | 91123da2d1ee7d4f09e3f62e59d33ddf8aa0b27e (patch) | |
| tree | 3619476dca69d0acd798c70a1c4ca3d249d9eb16 /lldb/source/Target | |
| parent | f7fee1c1859340bd0c8188a507127aa959bcef68 (diff) | |
| download | llvm-91123da2d1ee7d4f09e3f62e59d33ddf8aa0b27e.tar.gz llvm-91123da2d1ee7d4f09e3f62e59d33ddf8aa0b27e.tar.bz2 llvm-91123da2d1ee7d4f09e3f62e59d33ddf8aa0b27e.zip | |
Make sure creating a pending instance doesn't also trigger creating a live instance; also make sure creating a
pending instance uses the specified instance name rather than creating a new one; add brackets to instance names
when searching for and removing pending instances.
llvm-svn: 113370
Diffstat (limited to 'lldb/source/Target')
| -rw-r--r-- | lldb/source/Target/Process.cpp | 15 | ||||
| -rw-r--r-- | lldb/source/Target/Thread.cpp | 14 |
2 files changed, 17 insertions, 12 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index fa0fd19dcae2..ee2ad0fbe424 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1951,7 +1951,8 @@ Process::GetSettingsController (bool finish) Process::ProcessSettingsController::ProcessSettingsController () : UserSettingsController ("process", Debugger::GetSettingsController()) { - m_default_settings.reset (new ProcessInstanceSettings (*this, InstanceSettings::GetDefaultName().AsCString())); + m_default_settings.reset (new ProcessInstanceSettings (*this, false, + InstanceSettings::GetDefaultName().AsCString())); } Process::ProcessSettingsController::~ProcessSettingsController () @@ -1959,9 +1960,10 @@ Process::ProcessSettingsController::~ProcessSettingsController () } lldb::InstanceSettingsSP -Process::ProcessSettingsController::CreateNewInstanceSettings () +Process::ProcessSettingsController::CreateNewInstanceSettings (const char *instance_name) { - ProcessInstanceSettings *new_settings = new ProcessInstanceSettings (*(Process::GetSettingsController().get())); + ProcessInstanceSettings *new_settings = new ProcessInstanceSettings (*(Process::GetSettingsController().get()), + false, instance_name); lldb::InstanceSettingsSP new_settings_sp (new_settings); return new_settings_sp; } @@ -1970,8 +1972,9 @@ Process::ProcessSettingsController::CreateNewInstanceSettings () // class ProcessInstanceSettings //-------------------------------------------------------------- -ProcessInstanceSettings::ProcessInstanceSettings (UserSettingsController &owner, const char *name) : - InstanceSettings (owner, (name == NULL ? CreateInstanceName().AsCString() : name)), +ProcessInstanceSettings::ProcessInstanceSettings (UserSettingsController &owner, bool live_instance, + const char *name) : + InstanceSettings (owner, (name == NULL ? CreateInstanceName().AsCString() : name), live_instance), m_run_args (), m_env_vars (), m_input_path (), @@ -1980,7 +1983,7 @@ ProcessInstanceSettings::ProcessInstanceSettings (UserSettingsController &owner, m_plugin (), m_disable_aslr (true) { - if (m_instance_name != InstanceSettings::GetDefaultName()) + if (m_instance_name != InstanceSettings::GetDefaultName() && live_instance) { const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name); CopyInstanceSettings (pending_settings,false); diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 44b6f12d96c2..422257f8ad02 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -945,7 +945,8 @@ Thread::GetSettingsController (bool finish) Thread::ThreadSettingsController::ThreadSettingsController () : UserSettingsController ("thread", Process::GetSettingsController()) { - m_default_settings.reset (new ThreadInstanceSettings (*this, InstanceSettings::GetDefaultName().AsCString())); + m_default_settings.reset (new ThreadInstanceSettings (*this, false, + InstanceSettings::GetDefaultName().AsCString())); } Thread::ThreadSettingsController::~ThreadSettingsController () @@ -953,9 +954,10 @@ Thread::ThreadSettingsController::~ThreadSettingsController () } lldb::InstanceSettingsSP -Thread::ThreadSettingsController::CreateNewInstanceSettings () +Thread::ThreadSettingsController::CreateNewInstanceSettings (const char *instance_name) { - ThreadInstanceSettings *new_settings = new ThreadInstanceSettings (*(Thread::GetSettingsController().get())); + ThreadInstanceSettings *new_settings = new ThreadInstanceSettings (*(Thread::GetSettingsController().get()), + false, instance_name); lldb::InstanceSettingsSP new_settings_sp (new_settings); return new_settings_sp; } @@ -964,13 +966,13 @@ Thread::ThreadSettingsController::CreateNewInstanceSettings () // class ThreadInstanceSettings //-------------------------------------------------------------- -ThreadInstanceSettings::ThreadInstanceSettings (UserSettingsController &owner, const char *name) : - InstanceSettings (owner, (name == NULL ? CreateInstanceName().AsCString() : name)), +ThreadInstanceSettings::ThreadInstanceSettings (UserSettingsController &owner, bool live_instance, const char *name) : + InstanceSettings (owner, (name == NULL ? CreateInstanceName().AsCString() : name), live_instance), m_avoid_regexp_ap () { // FIXME: This seems like generic code, why was it duplicated (with the slight difference that // DebuggerInstanceSettings checks name, not m_instance_name below) in Process & Debugger? - if (m_instance_name != InstanceSettings::GetDefaultName()) + if (m_instance_name != InstanceSettings::GetDefaultName() && live_instance) { const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name); CopyInstanceSettings (pending_settings,false); |
