summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/Host.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Host/common/Host.cpp')
-rw-r--r--lldb/source/Host/common/Host.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 51702d0e251..2f10ae2ad0a 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -22,6 +22,7 @@
#include <sys/wait.h>
#if defined (__APPLE__)
+#include <dispatch/dispatch.h>
#include <libproc.h>
#include <mach-o/dyld.h>
#endif
@@ -545,6 +546,13 @@ Host::GetThreadName (lldb::pid_t pid, lldb::tid_t tid)
name = ThreadNameAccessor (true, pid, tid, NULL);
}
}
+
+ if (name == NULL)
+ {
+ dispatch_queue_t current_queue = ::dispatch_get_current_queue ();
+ if (current_queue != NULL)
+ name = dispatch_queue_get_label (current_queue);
+ }
}
#endif
}
OpenPOWER on IntegriCloud