#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:
+
+ const regs_info *get_regs_info () override;
+
+protected:
+
+ void low_arch_setup () override;
+};
+
+/* 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;
{
unsigned short insn;
- (*the_target->read_memory) (where, (unsigned char *) &insn,
- cris_breakpoint_len);
+ the_target->read_memory (where, (unsigned char *) &insn,
+ cris_breakpoint_len);
if (insn == cris_breakpoint)
return 1;
return 0;
}
-static void
-cris_arch_setup (void)
+void
+cris_target::low_arch_setup ()
{
current_process ()->tdesc = tdesc_cris;
}
cris_regmap,
};
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
{
NULL, /* regset_bitmap */
&cris_usrregs_info,
};
-static const struct regs_info *
-cris_regs_info (void)
+const regs_info *
+cris_target::get_regs_info ()
{
- return ®s_info;
+ return &myregs_info;
}
struct linux_target_ops the_low_target = {
- cris_arch_setup,
- cris_regs_info,
cris_cannot_fetch_register,
cris_cannot_store_register,
NULL, /* fetch_register */
cris_breakpoint_at,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_cris_target;
+
void
initialize_low_arch (void)
{