llvm/lldb/include/lldb/Host/linux/Ptrace.h

//===-- Ptrace.h ------------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// This file defines ptrace functions & structures

#ifndef liblldb_Host_linux_Ptrace_h_
#define liblldb_Host_linux_Ptrace_h_

#include <sys/ptrace.h>

#ifndef __GLIBC__
typedef int __ptrace_request;
#endif

#define DEBUG_PTRACE_MAXBYTES

// Support ptrace extensions even when compiled without required kernel support
#ifndef PTRACE_GETREGS
#define PTRACE_GETREGS
#endif
#ifndef PTRACE_SETREGS
#define PTRACE_SETREGS
#endif
#ifndef PTRACE_GETFPREGS
#define PTRACE_GETFPREGS
#endif
#ifndef PTRACE_SETFPREGS
#define PTRACE_SETFPREGS
#endif
#ifndef PTRACE_GETREGSET
#define PTRACE_GETREGSET
#endif
#ifndef PTRACE_SETREGSET
#define PTRACE_SETREGSET
#endif
#ifndef PTRACE_GET_THREAD_AREA
#define PTRACE_GET_THREAD_AREA
#endif
#ifndef PTRACE_ARCH_PRCTL
#define PTRACE_ARCH_PRCTL
#endif
#ifndef ARCH_GET_FS
#define ARCH_SET_GS
#define ARCH_SET_FS
#define ARCH_GET_FS
#define ARCH_GET_GS
#endif
#ifndef PTRACE_PEEKMTETAGS
#define PTRACE_PEEKMTETAGS
#endif
#ifndef PTRACE_POKEMTETAGS
#define PTRACE_POKEMTETAGS
#endif

#endif // liblldb_Host_linux_Ptrace_h_