diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2014-07-02 21:34:04 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2014-07-02 21:34:04 +0000 |
commit | dda6194399bc2c7c0764138e15275207fe44d467 (patch) | |
tree | 10d7cb04c222a71ddf6c17296f4a12d37b37b4db /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | |
parent | 5f9fd210b34141f5eddea0aadbe792bff89c0ed7 (diff) | |
download | bcm5719-llvm-dda6194399bc2c7c0764138e15275207fe44d467.tar.gz bcm5719-llvm-dda6194399bc2c7c0764138e15275207fe44d467.zip |
lldb - problem with some PTRACE_* constants in NativeProcessLinux.cpp file
See http://reviews.llvm.org/D4366 for details.
Change by Paul Paul Osmialowski
Today this is the only problem that I'm facing trying to cross-compile lldb for AArch64 using Linaro's toolchain.
PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS are not defined for AArch64
These things can be defined different ways for other architectures, e.g. for x86_64 Linux, asm/ptrace-abi.h defines them as preprocessor constants while sys/ptrace.h defines them in enum along with corresponding PT_* preprocessor constants
NativeProcessLinux.cpp includes sys/ptrace.h
To avoid accidental redefinition of enums with preprocessor constants, I'm proposing this patch which first checks for PT_* preprocessor constants then checks for PTRACE_* constants then when it still can not find them, it defines preprocessor constants.
Similar approach was already used for PTRACE_GETREGSET and PTRACE_SETREGSET constants; in this case however it was easier, since enum values in sys/ptrace.h and preprocessor constants shared all exactly the same names (e.g. there's no additional PT_GETREGSET name defined).
llvm-svn: 212225
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index ea245f7fcaf..46810778ea0 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -53,12 +53,26 @@ #define DEBUG_PTRACE_MAXBYTES 20 // Support ptrace extensions even when compiled without required kernel support +#ifndef PT_GETREGS #ifndef PTRACE_GETREGS -#define PTRACE_GETREGS 12 + #define PTRACE_GETREGS 12 #endif +#endif +#ifndef PT_SETREGS #ifndef PTRACE_SETREGS #define PTRACE_SETREGS 13 #endif +#endif +#ifndef PT_GETFPREGS +#ifndef PTRACE_GETFPREGS + #define PTRACE_GETFPREGS 14 +#endif +#endif +#ifndef PT_SETFPREGS +#ifndef PTRACE_SETFPREGS + #define PTRACE_SETFPREGS 15 +#endif +#endif #ifndef PTRACE_GETREGSET #define PTRACE_GETREGSET 0x4204 #endif |