diff options
author | Caroline Tice <ctice@apple.com> | 2010-09-16 19:05:55 +0000 |
---|---|---|
committer | Caroline Tice <ctice@apple.com> | 2010-09-16 19:05:55 +0000 |
commit | 9e41c15d8484ec71b31bb791bac3d3b41719bf5f (patch) | |
tree | 86927a8ccf1e6c5d95a7c166cc51bc1f798f570c /lldb/source/Target/Thread.cpp | |
parent | 20154b3ed4d7214e96986e90612f5d009a3e6348 (diff) | |
download | bcm5719-llvm-9e41c15d8484ec71b31bb791bac3d3b41719bf5f.tar.gz bcm5719-llvm-9e41c15d8484ec71b31bb791bac3d3b41719bf5f.zip |
Fix issues with CreateInstanceName, a virtual function, being called
in an initializer.
llvm-svn: 114107
Diffstat (limited to 'lldb/source/Target/Thread.cpp')
-rw-r--r-- | lldb/source/Target/Thread.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 7fa64912a97..9bc244bd155 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -967,12 +967,19 @@ Thread::ThreadSettingsController::CreateNewInstanceSettings (const char *instanc //-------------------------------------------------------------- ThreadInstanceSettings::ThreadInstanceSettings (UserSettingsController &owner, bool live_instance, const char *name) : - InstanceSettings (owner, (name == NULL ? CreateInstanceName().AsCString() : name), live_instance), + InstanceSettings (owner, (name == NULL ? InstanceSettings::InvalidName().AsCString() : name), live_instance), m_avoid_regexp_ap () { // 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())); + m_owner.RegisterInstanceSettings (this); + } if (live_instance) { |