gdbserver/linux-low: turn 'regs_info' into a method
[deliverable/binutils-gdb.git] / gdbserver / linux-riscv-low.cc
index 07ae6174ee38f3ee039d6402517f3c5a98dfe683..092f497b85ab95066650071f59118892833d4f80 100644 (file)
 # define NFPREG 33
 #endif
 
-/* Implementation of linux_target_ops method "arch_setup".  */
+/* Linux target op definitions for the RISC-V architecture.  */
 
-static void
-riscv_arch_setup ()
+class riscv_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 riscv_target the_riscv_target;
+
+/* Implementation of linux target ops method "low_arch_setup".  */
+
+void
+riscv_target::low_arch_setup ()
 {
   static const char *expedite_regs[] = { "sp", "pc", NULL };
 
@@ -145,10 +162,10 @@ static struct regs_info riscv_regs =
     &riscv_regsets_info,
   };
 
-/* Implementation of linux_target_ops method "regs_info".  */
+/* Implementation of linux target ops method "get_regs_info".  */
 
-static const struct regs_info *
-riscv_regs_info ()
+const regs_info *
+riscv_target::get_regs_info ()
 {
   return &riscv_regs;
 }
@@ -256,8 +273,6 @@ riscv_breakpoint_at (CORE_ADDR pc)
 /* RISC-V/Linux target operations.  */
 struct linux_target_ops the_low_target =
 {
-  riscv_arch_setup,
-  riscv_regs_info,
   NULL, /* cannot_fetch_register */
   NULL, /* cannot_store_register */
   riscv_fetch_register,
@@ -270,6 +285,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
This page took 0.024231 seconds and 4 git commands to generate.