diff options
| author | Zachary Turner <zturner@google.com> | 2017-03-04 01:31:06 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2017-03-04 01:31:06 +0000 |
| commit | ed96be99fa780edd51876f769b74252bfb2d8b1b (patch) | |
| tree | ae9113a6f3f450d182cbc38ccbcb1337b07ca37d /lldb/source/Host/windows | |
| parent | 2325bb34c1ce78849925eb43213116e5a74e8041 (diff) | |
| download | bcm5719-llvm-ed96be99fa780edd51876f769b74252bfb2d8b1b.tar.gz bcm5719-llvm-ed96be99fa780edd51876f769b74252bfb2d8b1b.zip | |
Delete LLDB's code for getting / setting thread name.
This is now functionality in LLVM, and all callers have
already been updated to use the LLVM functions.
llvm-svn: 296946
Diffstat (limited to 'lldb/source/Host/windows')
| -rw-r--r-- | lldb/source/Host/windows/Host.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Host/windows/ThisThread.cpp | 63 |
2 files changed, 0 insertions, 67 deletions
diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp index b86cd3ea015..4505164e053 100644 --- a/lldb/source/Host/windows/Host.cpp +++ b/lldb/source/Host/windows/Host.cpp @@ -101,10 +101,6 @@ lldb::DataBufferSP Host::GetAuxvData(lldb_private::Process *process) { return 0; } -lldb::tid_t Host::GetCurrentThreadID() { - return lldb::tid_t(::GetCurrentThreadId()); -} - lldb::thread_t Host::GetCurrentThread() { return lldb::thread_t(::GetCurrentThread()); } diff --git a/lldb/source/Host/windows/ThisThread.cpp b/lldb/source/Host/windows/ThisThread.cpp deleted file mode 100644 index 6a11e5d1af9..00000000000 --- a/lldb/source/Host/windows/ThisThread.cpp +++ /dev/null @@ -1,63 +0,0 @@ -//===-- ThisThread.cpp ------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Utility/Error.h" - -#include "lldb/Host/ThisThread.h" -#include "lldb/Host/windows/windows.h" - -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallVector.h" - -using namespace lldb; -using namespace lldb_private; - -#if defined(_MSC_VER) && !defined(__clang__) - -namespace { -static const DWORD MS_VC_EXCEPTION = 0x406D1388; - -#pragma pack(push, 8) -struct THREADNAME_INFO { - DWORD dwType; // Must be 0x1000. - LPCSTR szName; // Pointer to thread name - DWORD dwThreadId; // Thread ID (-1 == current thread) - DWORD dwFlags; // Reserved. Do not use. -}; -#pragma pack(pop) -} - -#endif - -void ThisThread::SetName(llvm::StringRef name) { -// Other compilers don't yet support SEH, so we can only set the thread if -// compiling with MSVC. -// TODO(zturner): Once clang-cl supports SEH, relax this conditional. -#if defined(_MSC_VER) && !defined(__clang__) - THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = name.data(); - info.dwThreadId = ::GetCurrentThreadId(); - info.dwFlags = 0; - - __try { - ::RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), - (ULONG_PTR *)&info); - } __except (EXCEPTION_EXECUTE_HANDLER) { - } -#endif -} - -void ThisThread::GetName(llvm::SmallVectorImpl<char> &name) { - // Getting the thread name is not supported on Windows. - // TODO(zturner): In SetName(), make a TLS entry that contains the thread's - // name, and in this function - // try to extract that TLS entry. - name.clear(); -} |

