Create more useful instance names for target, process and thread instances.
Change default 'set' behavior so that all instance settings for the specified variable will be
updated, unless the "-n" ("--no_override") command options is specified.
llvm-svn: 114808
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 11273b1..d4fbfdf 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -62,6 +62,7 @@
log->Printf ("%p Thread::Thread(tid = 0x%4.4x)", this, GetID());
QueueFundamentalPlan(true);
+ UpdateInstanceName();
}
@@ -938,6 +939,21 @@
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
//--------------------------------------------------------------