gdbserver/linux-low: start turning linux target ops into methods
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:23 +0000 (15:11 +0200)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:23 +0000 (15:11 +0200)
This is the beginning of a series of patches that convert the linux
low targets into classes derived from linux_process_target.  At the
end of the series we obtain a class hierarchy that looks like this:

process_stratum_target
^
|
|-- linux_process_target
    ^
    |
    |-- x86_target (defined in linux-x86-low)
    |-- aarch64_target (defined in linux-aarch64-low)
    |-- ppc_target (defined in linux-ppc-low)
    |-- ...

In several cases, linux_process_target simply forwards a target op
request to a corresponding linux_target_ops function.  For these
cases, the definition in linux_process_target will be removed and the
definition will be left to the deriving linux low target class; using
inheritance provides a nice and natural, object-oriented
simplification in these cases.

The series converts linux_target_ops into protected methods of
linux_process_target one by one.  Throughout the series, based on the
needs, static functions defined in linux-low.cc are converted to
private methods of linux_process_target as well.  This is done either
as separate patches or as integrated into a patch that convert a
particular linux_target_op into a method.

The series ends with the patch titled "gdbserver/linux-low: delete
'linux_target_ops' and 'the_low_target'".

Built and regression-tested on x86_64-linux.  The following linux low
targets have been built (but not tested) via cross-compilation:
aarch64, arm, m68k, mips, ppc, riscv, s390, sh, sparc.  The other
targets (bfin, cris, crisv32, ia64, m32r, nios2, tic6x, tile, xtensa)
were neither built nor tested.

gdbserver/ChangeLog:
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.

22 files changed:
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc
gdbserver/linux-arm-low.cc
gdbserver/linux-bfin-low.cc
gdbserver/linux-cris-low.cc
gdbserver/linux-crisv32-low.cc
gdbserver/linux-ia64-low.cc
gdbserver/linux-low.cc
gdbserver/linux-low.h
gdbserver/linux-m32r-low.cc
gdbserver/linux-m68k-low.cc
gdbserver/linux-mips-low.cc
gdbserver/linux-nios2-low.cc
gdbserver/linux-ppc-low.cc
gdbserver/linux-riscv-low.cc
gdbserver/linux-s390-low.cc
gdbserver/linux-sh-low.cc
gdbserver/linux-sparc-low.cc
gdbserver/linux-tic6x-low.cc
gdbserver/linux-tile-low.cc
gdbserver/linux-x86-low.cc
gdbserver/linux-xtensa-low.cc

index 6b789265f8bb10e693b7d0bc3d687022eb4b8429..b55589fcde94749a25145791072800e0b1ce7abb 100644 (file)
@@ -1,3 +1,67 @@
+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
index 6ce5452945e2b184b92851bb581fa54e3504e8c8..102b61ef9cb1f39f7a74a12a7ad4af83be7d27e1 100644 (file)
 #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
@@ -3088,6 +3100,10 @@ struct linux_target_ops the_low_target =
   aarch64_get_syscall_trapinfo,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_aarch64_target;
+
 void
 initialize_low_arch (void)
 {
index f60543eae94790c7b1fb3bb5e7b270c729dfe163..7ecedb8f6efae5d4ae4265bc404d6c039cc02115 100644 (file)
 #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
 {
@@ -1044,6 +1056,10 @@ struct linux_target_ops the_low_target = {
   arm_get_syscall_trapinfo,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_arm_target;
+
 void
 initialize_low_arch (void)
 {
index 5bfc8868bd9ab0b0aae34d4e55eb172b9a9f0149..c8c238abca75e169f4a9bc40a27c554a9cc9b6be 100644 (file)
 #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;
@@ -151,6 +163,9 @@ struct linux_target_ops the_low_target = {
   bfin_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_bfin_target;
 
 void
 initialize_low_arch (void)
index 81d84a1b5c8f56302fa93007dabd746f5ce46442..d2735b4f4597e606eee5aef98e8443cfcdfb4b3e 100644 (file)
 #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;
@@ -125,6 +137,10 @@ struct linux_target_ops the_low_target = {
   cris_breakpoint_at,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_cris_target;
+
 void
 initialize_low_arch (void)
 {
index 06135efcfa276d0e46f51961ae2ebdd6abacabcf..346e2a4219e2725a79b747bd3c97ab990c1b76d3 100644 (file)
 #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;
@@ -431,6 +443,10 @@ struct linux_target_ops the_low_target = {
   cris_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_crisv32_target;
+
 void
 initialize_low_arch (void)
 {
index 2399e58b36671d6e4a7bdba53f8e38cfb0b2be6c..169a567d67b5216ceef4a14787056e2f56650f68 100644 (file)
 #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;
@@ -353,6 +365,10 @@ struct linux_target_ops the_low_target = {
   ia64_fetch_register,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_ia64_target;
+
 void
 initialize_low_arch (void)
 {
index e748bfc9c6da503e8ad1182e799c017c7411a25c..d399ea5c3d8985d0fe47059313f1ac6e0b5c07fb 100644 (file)
@@ -7444,10 +7444,6 @@ linux_get_hwcap2 (int wordsize)
   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)
@@ -7465,7 +7461,7 @@ initialize_low (void)
   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 ();
index bc7abce2ac6802d983f4d6f306245a4d909af994..0af3c3cc387858b23a5d65315fe58ebc87b33728 100644 (file)
@@ -563,8 +563,13 @@ private:
 
   /* 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)
 
index 74e0f3f74c6b1575303d105c5d2aa9556c446b28..3921d450e0b7fd42c7b956a81837185f99ce8387 100644 (file)
 #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;
@@ -150,6 +162,10 @@ struct linux_target_ops the_low_target = {
   m32r_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_m32r_target;
+
 void
 initialize_low_arch (void)
 {
index 246b295a8754902e11944ba48ef98cf2022b4e70..21bd5334a2b85554a64a7af23b52e5bbbbc7816d 100644 (file)
 #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;
@@ -245,6 +257,10 @@ struct linux_target_ops the_low_target = {
   m68k_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_m68k_target;
+
 void
 initialize_low_arch (void)
 {
index 3caab02e5038e30a582e7b0911309a5bf37ac759..debe115ea77dde5ba4bf3168b524c1bab22afd51 100644 (file)
 #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;
@@ -965,6 +977,10 @@ struct linux_target_ops the_low_target = {
   mips_linux_prepare_to_resume
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_mips_target;
+
 void
 initialize_low_arch (void)
 {
index a8bb87a390efc1e9e242458401791f470205ab9b..09f8778f293dea693641d1dc776ddaeb32f35094 100644 (file)
 #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
@@ -250,6 +262,10 @@ struct linux_target_ops the_low_target =
   nios2_breakpoint_at,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_nios2_target;
+
 void
 initialize_low_arch (void)
 {
index f3837e4796048e86965518dbe5de4f1643db4fb4..a0f1ba09936358f0caa620ed268160a3245cc53b 100644 (file)
 #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;
@@ -3410,6 +3422,10 @@ struct linux_target_ops the_low_target = {
   ppc_get_ipa_tdesc_idx,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_ppc_target;
+
 void
 initialize_low_arch (void)
 {
index 07ae6174ee38f3ee039d6402517f3c5a98dfe683..04f3a99f46fdd3c9175227cb9e835a6465f081d4 100644 (file)
 # 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
@@ -270,6 +282,10 @@ struct linux_target_ops the_low_target =
   riscv_breakpoint_at,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_riscv_target;
+
 /* Initialize the RISC-V/Linux target.  */
 
 void
index f3d6f093099b12c6cc3687a5910e7c9bda8662b6..17aa9d0231e7e62d22a40e1b0552b66aade44c4a 100644 (file)
 
 #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,
 
@@ -2830,6 +2842,10 @@ struct linux_target_ops the_low_target = {
   s390_get_ipa_tdesc_idx,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_s390_target;
+
 void
 initialize_low_arch (void)
 {
index f55402c3d41bb2c4529f1e7108a19572f56d09b2..ab82ee37b2cdd08704b9ec86aeacb8ec54980fd5 100644 (file)
 #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;
@@ -180,6 +192,10 @@ struct linux_target_ops the_low_target = {
   sh_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_sh_target;
+
 void
 initialize_low_arch (void)
 {
index e6cb43209af4fd7cae0db880ca6407534e48fc98..cc4f551123b2cf4831e94aa97cd800eafd0f18bd 100644 (file)
 #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
@@ -316,6 +328,10 @@ struct linux_target_ops the_low_target = {
   NULL, NULL
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_sparc_target;
+
 void
 initialize_low_arch (void)
 {
index ca7c983a8ac2f2a8a668e3d246a636db852591f0..4c621c04982ba5fdc7d6bd109d7497e5b0ba7b34 100644 (file)
 
 #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;
@@ -439,6 +451,10 @@ tic6x_tdesc_test ()
 }
 #endif
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_tic6x_target;
+
 void
 initialize_low_arch (void)
 {
index 1fe77a3fa5744cb08ce93b149d56f6a060811e42..807a8976fd77b7cb47ba816f58d0ebe7be3bc2b6 100644 (file)
 #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;
@@ -212,6 +224,10 @@ struct linux_target_ops the_low_target =
   tile_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_tile_target;
+
 void
 initialize_low_arch (void)
 {
index 96818b85a867e3004c1d7c73bd49d8fc7010ca7e..dbfcd255325607531ce825897678167bd632e89f 100644 (file)
@@ -92,6 +92,20 @@ static const char *xmltarget_amd64_linux_no_xml = "@<target>\
 #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
@@ -2901,6 +2915,10 @@ struct linux_target_ops the_low_target =
   x86_get_ipa_tdesc_idx,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_x86_target;
+
 void
 initialize_low_arch (void)
 {
index 510c9bd8879f782264621338391f2cbd880cd029..32146822d4f555f34d5e790b3c966fe00be42dfc 100644 (file)
 #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;
@@ -304,6 +316,9 @@ struct linux_target_ops the_low_target = {
   xtensa_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_xtensa_target;
 
 void
 initialize_low_arch (void)
This page took 0.044503 seconds and 4 git commands to generate.