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.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114808 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index 11273b1..d4fbfdf 100644
--- a/source/Target/Thread.cpp
+++ b/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
//--------------------------------------------------------------