summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Thread.cpp
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-09-27 00:30:10 +0000
committerCaroline Tice <ctice@apple.com>2010-09-27 00:30:10 +0000
commit1559a46b3eae1f941a67937abfafaf7d12f5ec1c (patch)
treed1de2061dc9a9fd0dfb0ffd0f8c73a1baa036a02 /lldb/source/Target/Thread.cpp
parentc8a4973389b8d6b75c06c02112873e823a82a27b (diff)
downloadbcm5719-llvm-1559a46b3eae1f941a67937abfafaf7d12f5ec1c.tar.gz
bcm5719-llvm-1559a46b3eae1f941a67937abfafaf7d12f5ec1c.zip
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
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