+2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ * linux-low.h (the_linux_target): New extern declaration.
+ * linux-low.cc (initialize_low): Use 'the_linux_target' to set
+ 'the_target'.
+ (the_linux_target): Remove.
+ * linux-x86-low.cc (class x86_target): New class.
+ (the_x86_target): New static object.
+ (the_linux_target): Define as pointer to the_x86_target.
+ * linux-aarch64-low.cc (class aarch64_target): New class.
+ (the_aarch64_target): New static object.
+ (the_linux_target): Define as pointer to the_aarch64_target.
+ * linux-arm-low.cc (class arm_target): New class.
+ (the_arm_target): New static object.
+ (the_linux_target): Define as pointer to the_arm_target.
+ * linux-bfin-low.cc (class bfin_target): New class.
+ (the_bfin_target): New static object.
+ (the_linux_target): Define as pointer to the_bfin_target.
+ * linux-cris-low.cc (class cris_target): New class.
+ (the_cris_target): New static object.
+ (the_linux_target): Define as pointer to the_cris_target.
+ * linux-crisv32-low.cc (class crisv32_target): New class.
+ (the_crisv32_target): New static object.
+ (the_linux_target): Define as pointer to the_crisv32_target.
+ * linux-ia64-low.cc (class ia64_target): New class.
+ (the_ia64_target): New static object.
+ (the_linux_target): Define as pointer to the_ia64_target.
+ * linux-m32r-low.cc (class m32r_target): New class.
+ (the_m32r_target): New static object.
+ (the_linux_target): Define as pointer to the_m32r_target.
+ * linux-m68k-low.cc (class m68k_target): New class.
+ (the_m68k_target): New static object.
+ (the_linux_target): Define as pointer to the_m68k_target.
+ * linux-mips-low.cc (class mips_target): New class.
+ (the_mips_target): New static object.
+ (the_linux_target): Define as pointer to the_mips_target.
+ * linux-nios2-low.cc (class nios2_target): New class.
+ (the_nios2_target): New static object.
+ (the_linux_target): Define as pointer to the_nios2_target.
+ * linux-ppc-low.cc (class ppc_target): New class.
+ (the_ppc_target): New static object.
+ (the_linux_target): Define as pointer to the_ppc_target.
+ * linux-riscv-low.cc (class riscv_target): New class.
+ (the_riscv_target): New static object.
+ (the_linux_target): Define as pointer to the_riscv_target.
+ * linux-s390-low.cc (class s390_target): New class.
+ (the_s390_target): New static object.
+ (the_linux_target): Define as pointer to the_s390_target.
+ * linux-sh-low.cc (class sh_target): New class.
+ (the_sh_target): New static object.
+ (the_linux_target): Define as pointer to the_sh_target.
+ * linux-sparc-low.cc (class sparc_target): New class.
+ (the_sparc_target): New static object.
+ (the_linux_target): Define as pointer to the_sparc_target.
+ * linux-tic6x-low.cc (class tic6x_target): New class.
+ (the_tic6x_target): New static object.
+ (the_linux_target): Define as pointer to the_tic6x_target.
+ * linux-tile-low.cc (class tile_target): New class.
+ (the_tile_target): New static object.
+ (the_linux_target): Define as pointer to the_tile_target.
+ * linux-xtensa-low.cc (class xtensa_target): New class.
+ (the_xtensa_target): New static object.
+ (the_linux_target): Define as pointer to the_xtensa_target.
+
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn some static functions in linux-low.cc into private methods of
#include <sys/reg.h>
#endif
+/* Linux target op definitions for the AArch64 architecture. */
+
+class aarch64_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static aarch64_target the_aarch64_target;
+
/* Per-process arch-specific data we want to keep. */
struct arch_process_info
aarch64_get_syscall_trapinfo,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_aarch64_target;
+
void
initialize_low_arch (void)
{
#define PTRACE_SETHBPREGS 30
#endif
+/* Linux target op definitions for the ARM architecture. */
+
+class arm_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static arm_target the_arm_target;
+
/* Information describing the hardware breakpoint capabilities. */
static struct
{
arm_get_syscall_trapinfo,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_arm_target;
+
void
initialize_low_arch (void)
{
#include "linux-low.h"
#include <asm/ptrace.h>
+/* Linux target op definitions for the BFIN architecture. */
+
+class bfin_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static bfin_target the_bfin_target;
+
/* Defined in auto-generated file reg-bfin.c. */
void init_registers_bfin (void);
extern const struct target_desc *tdesc_bfin;
bfin_supports_hardware_single_step,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_bfin_target;
void
initialize_low_arch (void)
#include "linux-low.h"
#include "nat/gdb_ptrace.h"
+/* Linux target op definitions for the CRIS architecture. */
+
+class cris_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static cris_target the_cris_target;
+
/* Defined in auto-generated file reg-cris.c. */
void init_registers_cris (void);
extern const struct target_desc *tdesc_cris;
cris_breakpoint_at,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_cris_target;
+
void
initialize_low_arch (void)
{
#include "linux-low.h"
#include "nat/gdb_ptrace.h"
+/* Linux target op definitions for the CRIS architecture. */
+
+class crisv32_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static crisv32_target the_crisv32_target;
+
/* Defined in auto-generated file reg-crisv32.c. */
void init_registers_crisv32 (void);
extern const struct target_desc *tdesc_crisv32;
cris_supports_hardware_single_step,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_crisv32_target;
+
void
initialize_low_arch (void)
{
#include <sys/reg.h>
#endif
+/* Linux target op definitions for the IA64 architecture. */
+
+class ia64_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static ia64_target the_ia64_target;
+
/* Defined in auto-generated file reg-ia64.c. */
void init_registers_ia64 (void);
extern const struct target_desc *tdesc_ia64;
ia64_fetch_register,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_ia64_target;
+
void
initialize_low_arch (void)
{
return hwcap2;
}
-/* The linux target ops object. */
-
-static linux_process_target the_linux_target;
-
#ifdef HAVE_LINUX_REGSETS
void
initialize_regsets_info (struct regsets_info *info)
struct sigaction sigchld_action;
memset (&sigchld_action, 0, sizeof (sigchld_action));
- set_target_ops (&the_linux_target);
+ set_target_ops (the_linux_target);
linux_ptrace_init_warnings ();
linux_proc_init_warnings ();
/* Move THREAD out of the jump pad. */
void move_out_of_jump_pad (thread_info *thread);
+
+protected:
+ /* The architecture-specific "low" methods are listed below. */
};
+extern linux_process_target *the_linux_target;
+
#define get_thread_lwp(thr) ((struct lwp_info *) (thread_target_data (thr)))
#define get_lwp_thread(lwp) ((lwp)->thread)
#include <sys/reg.h>
#endif
+/* Linux target op definitions for the m32r architecture. */
+
+class m32r_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static m32r_target the_m32r_target;
+
/* Defined in auto-generated file reg-m32r.c. */
void init_registers_m32r (void);
extern const struct target_desc *tdesc_m32r;
m32r_supports_hardware_single_step,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_m32r_target;
+
void
initialize_low_arch (void)
{
#include "server.h"
#include "linux-low.h"
+/* Linux target op definitions for the m68k architecture. */
+
+class m68k_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static m68k_target the_m68k_target;
+
/* Defined in auto-generated file reg-m68k.c. */
void init_registers_m68k (void);
extern const struct target_desc *tdesc_m68k;
m68k_supports_hardware_single_step,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_m68k_target;
+
void
initialize_low_arch (void)
{
#include "nat/mips-linux-watch.h"
#include "gdb_proc_service.h"
+/* Linux target op definitions for the MIPS architecture. */
+
+class mips_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static mips_target the_mips_target;
+
/* Defined in auto-generated file mips-linux.c. */
void init_registers_mips_linux (void);
extern const struct target_desc *tdesc_mips_linux;
mips_linux_prepare_to_resume
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_mips_target;
+
void
initialize_low_arch (void)
{
#define PTRACE_GET_THREAD_AREA 25
#endif
+/* Linux target op definitions for the NIOS II architecture. */
+
+class nios2_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static nios2_target the_nios2_target;
+
/* The following definition must agree with the number of registers
defined in "struct user_regs" in GLIBC
(sysdeps/unix/sysv/linux/nios2/sys/user.h), and also with
nios2_breakpoint_at,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_nios2_target;
+
void
initialize_low_arch (void)
{
#define PPC_LI(insn) (PPC_SEXT (PPC_FIELD (insn, 6, 24), 24) << 2)
#define PPC_BD(insn) (PPC_SEXT (PPC_FIELD (insn, 16, 14), 14) << 2)
+/* Linux target op definitions for the PowerPC architecture. */
+
+class ppc_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static ppc_target the_ppc_target;
+
/* Holds the AT_HWCAP auxv entry. */
static unsigned long ppc_hwcap;
ppc_get_ipa_tdesc_idx,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_ppc_target;
+
void
initialize_low_arch (void)
{
# define NFPREG 33
#endif
+/* Linux target op definitions for the RISC-V architecture. */
+
+class riscv_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static riscv_target the_riscv_target;
+
/* Implementation of linux_target_ops method "arch_setup". */
static void
riscv_breakpoint_at,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_riscv_target;
+
/* Initialize the RISC-V/Linux target. */
void
#define s390_num_regs 52
+/* Linux target op definitions for the S/390 architecture. */
+
+class s390_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static s390_target the_s390_target;
+
static int s390_regmap[] = {
PT_PSWMASK, PT_PSWADDR,
s390_get_ipa_tdesc_idx,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_s390_target;
+
void
initialize_low_arch (void)
{
#include "server.h"
#include "linux-low.h"
+/* Linux target op definitions for the SH architecture. */
+
+class sh_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static sh_target the_sh_target;
+
/* Defined in auto-generated file reg-sh.c. */
void init_registers_sh (void);
extern const struct target_desc *tdesc_sh;
sh_supports_hardware_single_step,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_sh_target;
+
void
initialize_low_arch (void)
{
#define sparc_num_regs \
(SPARC_R_REGS_NUM + SPARC_F_REGS_NUM + SPARC_CONTROL_REGS_NUM)
+/* Linux target op definitions for the SPARC architecture. */
+
+class sparc_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static sparc_target the_sparc_target;
+
/* Each offset is multiplied by 8, because of the register size.
These offsets apply to the buffer sent/filled by ptrace.
Additionally, the array elements order corresponds to the .dat file, and the
NULL, NULL
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_sparc_target;
+
void
initialize_low_arch (void)
{
#include <asm/ptrace.h>
+/* Linux target op definitions for the TI C6x architecture. */
+
+class tic6x_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static tic6x_target the_tic6x_target;
+
/* Defined in auto-generated file tic6x-c64xp-linux.c. */
void init_registers_tic6x_c64xp_linux (void);
extern const struct target_desc *tdesc_tic6x_c64xp_linux;
}
#endif
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_tic6x_target;
+
void
initialize_low_arch (void)
{
#include <arch/abi.h>
#include "nat/gdb_ptrace.h"
+/* Linux target op definitions for the TILE-Gx architecture. */
+
+class tile_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static tile_target the_tile_target;
+
/* Defined in auto-generated file reg-tilegx.c. */
void init_registers_tilegx (void);
extern const struct target_desc *tdesc_tilegx;
tile_supports_hardware_single_step,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_tile_target;
+
void
initialize_low_arch (void)
{
#define ARCH_GET_GS 0x1004
#endif
+/* Linux target op definitions for the x86 architecture.
+ This is initialized assuming an amd64 target.
+ 'low_arch_setup' will correct it for i386 or amd64 targets. */
+
+class x86_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static x86_target the_x86_target;
+
/* Per-process arch-specific data we want to keep. */
struct arch_process_info
x86_get_ipa_tdesc_idx,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_x86_target;
+
void
initialize_low_arch (void)
{
#include "server.h"
#include "linux-low.h"
+/* Linux target op definitions for the Xtensa architecture. */
+
+class xtensa_target : public linux_process_target
+{
+public:
+
+};
+
+/* The singleton target ops object. */
+
+static xtensa_target the_xtensa_target;
+
/* Defined in auto-generated file reg-xtensa.c. */
void init_registers_xtensa (void);
extern const struct target_desc *tdesc_xtensa;
xtensa_supports_hardware_single_step,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_xtensa_target;
void
initialize_low_arch (void)