gdbserver/linux-low: turn 'regs_info' into a method
[deliverable/binutils-gdb.git] / gdbserver / linux-tic6x-low.cc
index ca7c983a8ac2f2a8a668e3d246a636db852591f0..1f8d2f6451e31d8444bb6e9c4642bb7ddf69a6f7 100644 (file)
 
 #include <asm/ptrace.h>
 
+/* Linux target op definitions for the TI C6x architecture.  */
+
+class tic6x_target : public linux_process_target
+{
+public:
+
+  const regs_info *get_regs_info () override;
+
+protected:
+
+  void low_arch_setup () override;
+};
+
+/* 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;
@@ -314,8 +331,8 @@ static struct regset_info tic6x_regsets[] = {
   NULL_REGSET
 };
 
-static void
-tic6x_arch_setup (void)
+void
+tic6x_target::low_arch_setup ()
 {
   register unsigned int csr asm ("B2");
   unsigned int cpuid;
@@ -372,22 +389,20 @@ static struct regsets_info tic6x_regsets_info =
     NULL, /* disabled_regsets */
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &tic6x_usrregs_info,
     &tic6x_regsets_info
   };
 
-static const struct regs_info *
-tic6x_regs_info (void)
+const regs_info *
+tic6x_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  tic6x_arch_setup,
-  tic6x_regs_info,
   tic6x_cannot_fetch_register,
   tic6x_cannot_store_register,
   NULL, /* fetch_register */
@@ -439,6 +454,10 @@ tic6x_tdesc_test ()
 }
 #endif
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_tic6x_target;
+
 void
 initialize_low_arch (void)
 {
This page took 0.049568 seconds and 4 git commands to generate.