aboutsummaryrefslogtreecommitdiff
path: root/lldb/source
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-09-09 18:26:37 +0000
committerCaroline Tice <ctice@apple.com>2010-09-09 18:26:37 +0000
commitf20e8239cddff27d9dc0cc2fcadf397879f15608 (patch)
treef875e2873af86e9e7ed0174b26a63edd340e21b0 /lldb/source
parent367a5df8cfca3822dcaf97efa1a9d47ebb6401a2 (diff)
downloadllvm-f20e8239cddff27d9dc0cc2fcadf397879f15608.tar.gz
llvm-f20e8239cddff27d9dc0cc2fcadf397879f15608.tar.bz2
llvm-f20e8239cddff27d9dc0cc2fcadf397879f15608.zip
Add comments to InstanceSettings constructors explaining why they have
to be set up the way they are. Comment out code that removes pending settings for live instances (after the settings are copied over). llvm-svn: 113519
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Core/Debugger.cpp8
-rw-r--r--lldb/source/Target/Process.cpp10
-rw-r--r--lldb/source/Target/Thread.cpp10
3 files changed, 19 insertions, 9 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index d4b9bf6c37c9..304ee119198f 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -633,11 +633,15 @@ DebuggerInstanceSettings::DebuggerInstanceSettings (UserSettingsController &owne
m_prompt (),
m_script_lang ()
{
- if (name == NULL && live_instance)
+ // 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.
+
+ if (live_instance)
{
const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name);
CopyInstanceSettings (pending_settings, false);
- m_owner.RemovePendingSettings (m_instance_name);
+ //m_owner.RemovePendingSettings (m_instance_name);
}
}
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 565e78418814..1519e1f01f41 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -1974,7 +1974,7 @@ Process::ProcessSettingsController::CreateNewInstanceSettings (const char *insta
ProcessInstanceSettings::ProcessInstanceSettings (UserSettingsController &owner, bool live_instance,
const char *name) :
- InstanceSettings (owner, (name == NULL ? CreateInstanceName().AsCString() : name), live_instance),
+ InstanceSettings (owner, (name == NULL ? CreateInstanceName().AsCString() : name), live_instance),
m_run_args (),
m_env_vars (),
m_input_path (),
@@ -1983,11 +1983,15 @@ ProcessInstanceSettings::ProcessInstanceSettings (UserSettingsController &owner,
m_plugin (),
m_disable_aslr (true)
{
- if (m_instance_name != InstanceSettings::GetDefaultName() && 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.
+
+ if (live_instance)
{
const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name);
CopyInstanceSettings (pending_settings,false);
- m_owner.RemovePendingSettings (m_instance_name);
+ //m_owner.RemovePendingSettings (m_instance_name);
}
}
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 422257f8ad02..7fa64912a978 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -970,13 +970,15 @@ ThreadInstanceSettings::ThreadInstanceSettings (UserSettingsController &owner, b
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() && live_instance)
+ // 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.
+
+ if (live_instance)
{
const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name);
CopyInstanceSettings (pending_settings,false);
- m_owner.RemovePendingSettings (m_instance_name);
+ //m_owner.RemovePendingSettings (m_instance_name);
}
}