diff options
author | Martin Storsjo <martin@martin.st> | 2019-09-24 08:39:06 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-09-24 08:39:06 +0000 |
commit | 02dddfd2aef3ba7696e78003947d72034beadba0 (patch) | |
tree | 5d6751a1bb66105d91d0b4cc6c27a06d66bdfa6d /lldb/source/Plugins | |
parent | 88a5bba7b59c81f442da3f9ea1e9b337b2f5f20d (diff) | |
download | bcm5719-llvm-02dddfd2aef3ba7696e78003947d72034beadba0.tar.gz bcm5719-llvm-02dddfd2aef3ba7696e78003947d72034beadba0.zip |
[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures
While debugging on those architectures might not be supported yet,
the generic code should still be buildable. This file accesses x86
specific fields in the CONTEXT struct.
Differential Revision: https://reviews.llvm.org/D67911
llvm-svn: 372699
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r-- | lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp index 51137fecce3..28e7a590ff9 100644 --- a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp @@ -84,7 +84,7 @@ bool RegisterContextWindows::AddHardwareBreakpoint(uint32_t slot, case 1: case 2: case 4: -#if defined(__x86_64__) || defined(_M_AMD64) +#if defined(_WIN64) case 8: #endif break; @@ -95,6 +95,7 @@ bool RegisterContextWindows::AddHardwareBreakpoint(uint32_t slot, if (!CacheAllRegisterValues()) return false; +#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64) unsigned shift = 2 * slot; m_context.Dr7 |= 1ULL << shift; @@ -109,6 +110,12 @@ bool RegisterContextWindows::AddHardwareBreakpoint(uint32_t slot, m_context.Dr7 |= (read ? 3ULL : (write ? 1ULL : 0)) << shift; return ApplyAllRegisterValues(); + +#else + Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_REGISTERS); + LLDB_LOG(log, "hardware breakpoints not currently supported on this arch"); + return false; +#endif } bool RegisterContextWindows::RemoveHardwareBreakpoint(uint32_t slot) { @@ -118,19 +125,25 @@ bool RegisterContextWindows::RemoveHardwareBreakpoint(uint32_t slot) { if (!CacheAllRegisterValues()) return false; +#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64) unsigned shift = 2 * slot; m_context.Dr7 &= ~(1ULL << shift); return ApplyAllRegisterValues(); +#else + return false; +#endif } uint32_t RegisterContextWindows::GetTriggeredHardwareBreakpointSlotId() { if (!CacheAllRegisterValues()) return LLDB_INVALID_INDEX32; +#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64) for (unsigned i = 0UL; i < NUM_HARDWARE_BREAKPOINT_SLOTS; i++) if (m_context.Dr6 & (1ULL << i)) return i; +#endif return LLDB_INVALID_INDEX32; } |