OSDN Git Service

[LLDB] Fix LinuxPTraceDefines_arm64sve.h for AArch64 Linux host
authorMuhammad Omair Javaid <omair.javaid@linaro.org>
Tue, 21 Jul 2020 09:02:06 +0000 (14:02 +0500)
committerMuhammad Omair Javaid <omair.javaid@linaro.org>
Tue, 21 Jul 2020 09:31:47 +0000 (14:31 +0500)
LinuxPTraceDefines_arm64sve.h defines essential macros for manipulating
AArch64 SVE core dump registers. Add guard for aarch64/Linux hosts where
newer versions of ptrace.h or sigcontext.h might already define SVE macros.

Differential Revision: https://reviews.llvm.org/D83541

lldb/source/Plugins/Process/Utility/LinuxPTraceDefines_arm64sve.h

index bc0b773..04d49bf 100644 (file)
@@ -9,6 +9,11 @@
 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LINUXPTRACEDEFINES_ARM64SVE_H
 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LINUXPTRACEDEFINES_ARM64SVE_H
 
+// LinuxPTraceDefines_arm64sve.h defines essential macros for manipulating
+// AArch64 SVE core dump registers. Add guard for aarch64/Linux hosts where
+// newer versions of ptrace.h or sigcontext.h might already define SVE macros.
+#ifndef SVE_SIG_REGS_OFFSET
+
 #include <stdint.h>
 
 struct _aarch64_context {
@@ -257,4 +262,6 @@ struct user_sve_header {
        ? SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags)                        \
        : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
 
+#endif // SVE_SIG_REGS_OFFSET
+
 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LINUXPTRACEDEFINES_ARM64SVE_H