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).
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113519 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index 422257f..7fa6491 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -970,13 +970,15 @@
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);
}
}