diff options
author | Zachary Turner <zturner@google.com> | 2014-12-18 18:21:33 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-12-18 18:21:33 +0000 |
commit | 7ae4b6de1d29b544f4a35bbf01cf5b398de89f4c (patch) | |
tree | 2ccc1ff9b9f21970b4035eef4536b933cefd8460 | |
parent | 84ba342ba99c37dc9f4c72b9c80f4c4be439cbc3 (diff) | |
download | bcm5719-llvm-7ae4b6de1d29b544f4a35bbf01cf5b398de89f4c.tar.gz bcm5719-llvm-7ae4b6de1d29b544f4a35bbf01cf5b398de89f4c.zip |
Only compile RegisterContextWindows_x86.cpp for x86 host architecture.
This fixes compilation failures in the 64-bit build of LLDB on Windows.
Patch by Aidan Dodds
Differential Revision: http://reviews.llvm.org/D6704
llvm-svn: 224528
-rw-r--r-- | lldb/source/Host/windows/HostThreadWindows.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/Windows/CMakeLists.txt | 17 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp (renamed from lldb/source/Plugins/Process/Windows/RegisterContextWindows_x86.cpp) | 0 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.h (renamed from lldb/source/Plugins/Process/Windows/RegisterContextWindows_x86.h) | 0 |
5 files changed, 38 insertions, 5 deletions
diff --git a/lldb/source/Host/windows/HostThreadWindows.cpp b/lldb/source/Host/windows/HostThreadWindows.cpp index 2597fa29941..d59064fb1c1 100644 --- a/lldb/source/Host/windows/HostThreadWindows.cpp +++ b/lldb/source/Host/windows/HostThreadWindows.cpp @@ -17,6 +17,14 @@ using namespace lldb; using namespace lldb_private; +namespace +{ +void __stdcall ExitThreadProxy(ULONG_PTR dwExitCode) +{ + ::ExitThread(dwExitCode); +} +} + HostThreadWindows::HostThreadWindows() : HostNativeThreadBase() , m_owns_handle(true) @@ -69,7 +77,7 @@ HostThreadWindows::Cancel() { Error error; - DWORD result = ::QueueUserAPC(::ExitThread, m_thread, 0); + DWORD result = ::QueueUserAPC(::ExitThreadProxy, m_thread, 0); error.SetError(result, eErrorTypeWin32); return error; } diff --git a/lldb/source/Plugins/Process/Windows/CMakeLists.txt b/lldb/source/Plugins/Process/Windows/CMakeLists.txt index e0110e387c0..dce4560d5ac 100644 --- a/lldb/source/Plugins/Process/Windows/CMakeLists.txt +++ b/lldb/source/Plugins/Process/Windows/CMakeLists.txt @@ -1,14 +1,27 @@ set(LLVM_NO_RTTI 1) +macro(add_process_windows_subdirectory group) + list(APPEND PROC_WINDOWS_SOURCES ${ARGN}) + source_group(${group} FILES ${ARGN}) +endmacro() + include_directories(.) include_directories(../Utility) -add_lldb_library(lldbPluginProcessWindows +add_process_windows_subdirectory(common DebuggerThread.cpp DynamicLoaderWindows.cpp LocalDebugDelegate.cpp ProcessWindows.cpp - RegisterContextWindows_x86.cpp TargetThreadWindows.cpp ) +if (CMAKE_SIZEOF_VOID_P EQUAL 4) + add_process_windows_subdirectory(x86 + x86/RegisterContextWindows_x86.cpp + ) +endif() + +add_lldb_library(lldbPluginProcessWindows + ${PROC_WINDOWS_SOURCES} + ) diff --git a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp index 1c33f218084..2f5ddc93056 100644 --- a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp @@ -15,9 +15,12 @@ #include "TargetThreadWindows.h" #include "ProcessWindows.h" -#include "RegisterContextWindows_x86.h" #include "UnwindLLDB.h" +#if !defined(_WIN64) +#include "x86/RegisterContextWindows_x86.h" +#endif + using namespace lldb; using namespace lldb_private; @@ -72,10 +75,19 @@ TargetThreadWindows::CreateRegisterContextForFrameIndex(uint32_t idx) switch (arch.GetMachine()) { case llvm::Triple::x86: +#if defined(_WIN64) + // FIXME: This is a Wow64 process, create a RegisterContextWindows_Wow64 +#else m_reg_context_sp.reset(new RegisterContextWindows_x86(*this, idx)); +#endif break; + case llvm::Triple::x86_64: +#if defined(_WIN64) + // FIXME: This is a 64-bit process, create a RegisterContextWindows_x86_64 +#else + // LLDB is 32-bit, but the target process is 64-bit. We probably can't debug this. +#endif default: - // FIXME: Support x64 by creating a RegisterContextWindows_x86_64 break; } } diff --git a/lldb/source/Plugins/Process/Windows/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp index f4bef83557b..f4bef83557b 100644 --- a/lldb/source/Plugins/Process/Windows/RegisterContextWindows_x86.cpp +++ b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp diff --git a/lldb/source/Plugins/Process/Windows/RegisterContextWindows_x86.h b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.h index d2439b529fd..d2439b529fd 100644 --- a/lldb/source/Plugins/Process/Windows/RegisterContextWindows_x86.h +++ b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.h |