summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatyana Krasnukha <tatyana@synopsys.com>2019-07-31 12:00:30 +0000
committerTatyana Krasnukha <tatyana@synopsys.com>2019-07-31 12:00:30 +0000
commite98b4188dc6e65617c2424ed3fa83658593bf6bb (patch)
treea3698c7b6f418f2c613ca29900a469ccb443fab9
parente84f78412bb6cf06e7ff35cb49da60596f582aa7 (diff)
downloadbcm5719-llvm-e98b4188dc6e65617c2424ed3fa83658593bf6bb.tar.gz
bcm5719-llvm-e98b4188dc6e65617c2424ed3fa83658593bf6bb.zip
[ProcessWindows] Choose a register context file by preprocessor
Replaced Cmake option based check with the preprocessor macro as CMAKE_SYSTEM_PROCESSOR doesn't work as expected on Windows. Fixes llvm.org/pr42724 Differential Revision: https://reviews.llvm.org/D65409 llvm-svn: 367414
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt13
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp4
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h4
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp4
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h4
5 files changed, 19 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
index 68486c1d990..1d7b8ccd49a 100644
--- a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
@@ -7,6 +7,9 @@ add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN
ProcessWindowsLog.cpp
RegisterContextWindows.cpp
TargetThreadWindows.cpp
+ x64/RegisterContextWindows_x64.cpp
+ x86/RegisterContextWindows_x86.cpp
+ # TODO add support for ARM (NT) and ARM64
LINK_LIBS
lldbCore
@@ -20,13 +23,3 @@ add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN
LINK_COMPONENTS
Support
)
-
-# TODO add support for ARM (NT) and ARM64
-# TODO build these unconditionally as we cannot do cross-debugging or WoW
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
- target_sources(lldbPluginProcessWindowsCommon PRIVATE
- x64/RegisterContextWindows_x64.cpp)
-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i?86|X86")
- target_sources(lldbPluginProcessWindowsCommon PRIVATE
- x86/RegisterContextWindows_x86.cpp)
-endif()
diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
index 4101aa1f1b5..11f72c00211 100644
--- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+
#include "lldb/Host/windows/HostThreadWindows.h"
#include "lldb/Host/windows/windows.h"
#include "lldb/Utility/RegisterValue.h"
@@ -534,3 +536,5 @@ bool RegisterContextWindows_x64::WriteRegister(const RegisterInfo *reg_info,
return ::SetThreadContext(
wthread.GetHostThread().GetNativeThread().GetSystemHandle(), &m_context);
}
+
+#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
index 5f252e16293..20d2cb90ece 100644
--- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
+++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
@@ -9,6 +9,8 @@
#ifndef liblldb_RegisterContextWindows_x64_H_
#define liblldb_RegisterContextWindows_x64_H_
+#if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+
#include "RegisterContextWindows.h"
#include "lldb/lldb-forward.h"
@@ -40,4 +42,6 @@ public:
};
}
+#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+
#endif // #ifndef liblldb_RegisterContextWindows_x64_H_
diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
index 0c25853e1c1..b8f7bb46181 100644
--- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#if defined(__i386__) || defined(_M_IX86)
+
#include "lldb/Host/windows/HostThreadWindows.h"
#include "lldb/Host/windows/windows.h"
#include "lldb/Utility/RegisterValue.h"
@@ -282,3 +284,5 @@ bool RegisterContextWindows_x86::ReadRegisterHelper(
reg_value.SetUInt32(value);
return true;
}
+
+#endif // defined(__i386__) || defined(_M_IX86)
diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h
index 8dca1dc995b..6517de0bbdf 100644
--- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h
+++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h
@@ -9,6 +9,8 @@
#ifndef liblldb_RegisterContextWindows_x86_H_
#define liblldb_RegisterContextWindows_x86_H_
+#if defined(__i386__) || defined(_M_IX86)
+
#include "RegisterContextWindows.h"
#include "lldb/lldb-forward.h"
@@ -44,4 +46,6 @@ private:
};
}
+#endif // defined(__i386__) || defined(_M_IX86)
+
#endif // #ifndef liblldb_RegisterContextWindows_x86_H_
OpenPOWER on IntegriCloud