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
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
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()
//
//===----------------------------------------------------------------------===//
+#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"
return ::SetThreadContext(
wthread.GetHostThread().GetNativeThread().GetSystemHandle(), &m_context);
}
+
+#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
#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"
};
}
+#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+
#endif // #ifndef liblldb_RegisterContextWindows_x64_H_
//
//===----------------------------------------------------------------------===//
+#if defined(__i386__) || defined(_M_IX86)
+
#include "lldb/Host/windows/HostThreadWindows.h"
#include "lldb/Host/windows/windows.h"
#include "lldb/Utility/RegisterValue.h"
reg_value.SetUInt32(value);
return true;
}
+
+#endif // defined(__i386__) || defined(_M_IX86)
#ifndef liblldb_RegisterContextWindows_x86_H_
#define liblldb_RegisterContextWindows_x86_H_
+#if defined(__i386__) || defined(_M_IX86)
+
#include "RegisterContextWindows.h"
#include "lldb/lldb-forward.h"
};
}
+#endif // defined(__i386__) || defined(_M_IX86)
+
#endif // #ifndef liblldb_RegisterContextWindows_x86_H_