summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/netbsd/HostThreadNetBSD.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-03-17 09:51:23 +0000
committerPavel Labath <labath@google.com>2017-03-17 09:51:23 +0000
commit225b79524de987d810f4085e6a1bf61a289e4adf (patch)
treece526121fcde21c1dd730c01c9629b3d3a465d3e /lldb/source/Host/netbsd/HostThreadNetBSD.cpp
parentc7c9b75804e8cd0f25b421fc5146213dc482e95b (diff)
downloadbcm5719-llvm-225b79524de987d810f4085e6a1bf61a289e4adf.tar.gz
bcm5719-llvm-225b79524de987d810f4085e6a1bf61a289e4adf.zip
Remove HostThreadLinux/Free/NetBSD
Summary: These classes existed only because of the GetName() static function, which can be moved to a more natural place anyway. I move the linux version to NativeProcessLinux (and get rid of ProcFileReader), the freebsd version to ProcessFreeBSD (and fix a bug where it was using the current process ID, instead of the inferior pid), and remove the NetBSD version (which was probably incorrect anyway, as it assumes the current process instead of the inferior. I also add an llgs test to that verifies thread names are read correctly. Reviewers: zturner, krytarowski, emaste Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30981 llvm-svn: 298058
Diffstat (limited to 'lldb/source/Host/netbsd/HostThreadNetBSD.cpp')
-rw-r--r--lldb/source/Host/netbsd/HostThreadNetBSD.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/lldb/source/Host/netbsd/HostThreadNetBSD.cpp b/lldb/source/Host/netbsd/HostThreadNetBSD.cpp
deleted file mode 100644
index e8c106b7f22..00000000000
--- a/lldb/source/Host/netbsd/HostThreadNetBSD.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===-- HostThreadNetBSD.cpp -----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// lldb Includes
-#include "lldb/Host/netbsd/HostThreadNetBSD.h"
-#include "lldb/Host/Host.h"
-
-// C includes
-#include <errno.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-
-// C++ includes
-#include <string>
-
-using namespace lldb_private;
-
-HostThreadNetBSD::HostThreadNetBSD() {}
-
-HostThreadNetBSD::HostThreadNetBSD(lldb::thread_t thread)
- : HostThreadPosix(thread) {}
-
-void HostThreadNetBSD::SetName(lldb::thread_t thread, llvm::StringRef &name) {
- ::pthread_setname_np(thread, "%s", const_cast<char *>(name.data()));
-}
-
-void HostThreadNetBSD::GetName(lldb::thread_t thread,
- llvm::SmallVectorImpl<char> &name) {
- char buf[PTHREAD_MAX_NAMELEN_NP];
- ::pthread_getname_np(thread, buf, PTHREAD_MAX_NAMELEN_NP);
-
- name.clear();
- name.append(buf, buf + strlen(buf));
-}
OpenPOWER on IntegriCloud