#define PTRACE_GET_THREAD_AREA 25
#endif
+/* Linux target op definitions for the NIOS II architecture. */
+
+class nios2_target : public linux_process_target
+{
+public:
+
+ const regs_info *get_regs_info () override;
+
+protected:
+
+ void low_arch_setup () override;
+
+ bool low_cannot_fetch_register (int regno) override;
+
+ bool low_cannot_store_register (int regno) override;
+};
+
+/* 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
0
};
-/* Implement the arch_setup linux_target_ops method. */
+/* Implement the low_arch_setup linux target ops method. */
-static void
-nios2_arch_setup (void)
+void
+nios2_target::low_arch_setup ()
{
current_process ()->tdesc = tdesc_nios2_linux;
}
-/* Implement the cannot_fetch_register linux_target_ops method. */
+/* Implement the low_cannot_fetch_register linux target ops method. */
-static int
-nios2_cannot_fetch_register (int regno)
+bool
+nios2_target::low_cannot_fetch_register (int regno)
{
- if (nios2_regmap[regno] == -1)
- return 1;
-
- return 0;
+ return (nios2_regmap[regno] == -1);
}
-/* Implement the cannot_store_register linux_target_ops method. */
+/* Implement the low_cannot_store_register linux target ops method. */
-static int
-nios2_cannot_store_register (int regno)
+bool
+nios2_target::low_cannot_store_register (int regno)
{
- if (nios2_regmap[regno] == -1)
- return 1;
-
- return 0;
+ return (nios2_regmap[regno] == -1);
}
/* Breakpoint support. Also see comments on nios2_breakpoint_from_pc
nios2_regmap,
};
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
{
NULL, /* regset_bitmap */
&nios2_usrregs_info,
&nios2_regsets_info
};
-static const struct regs_info *
-nios2_regs_info (void)
+const regs_info *
+nios2_target::get_regs_info ()
{
- return ®s_info;
+ return &myregs_info;
}
struct linux_target_ops the_low_target =
{
- nios2_arch_setup,
- nios2_regs_info,
- nios2_cannot_fetch_register,
- nios2_cannot_store_register,
NULL,
linux_get_pc_32bit,
linux_set_pc_32bit,
nios2_breakpoint_at,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_nios2_target;
+
void
initialize_low_arch (void)
{