summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Thread.cpp')
-rw-r--r--lldb/source/Target/Thread.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 11273b180e1..d4fbfdf3bfb 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -62,6 +62,7 @@ Thread::Thread (Process &process, lldb::tid_t tid) :
log->Printf ("%p Thread::Thread(tid = 0x%4.4x)", this, GetID());
QueueFundamentalPlan(true);
+ UpdateInstanceName();
}
@@ -938,6 +939,21 @@ Thread::GetSettingsController (bool finish)
return g_settings_controller;
}
+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(), GetID());
+
+ if (sstr.GetSize() > 0)
+ Thread::GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
+}
+
//--------------------------------------------------------------
// class Thread::ThreadSettingsController
//--------------------------------------------------------------
OpenPOWER on IntegriCloud