const regs_info *get_regs_info () override;
+ int breakpoint_kind_from_pc (CORE_ADDR *pcptr) override;
+
+ const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
protected:
void low_arch_setup () override;
bool low_cannot_store_register (int regno) override;
bool low_fetch_register (regcache *regcache, int regno) override;
+
+ bool low_supports_breakpoints () override;
+
+ CORE_ADDR low_get_pc (regcache *regcache) override;
+
+ void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
};
/* The singleton target ops object. */
return true;
}
-/* Implementation of linux_target_ops method "get_pc". */
+bool
+riscv_target::low_supports_breakpoints ()
+{
+ return true;
+}
+
+/* Implementation of linux target ops method "low_get_pc". */
-static CORE_ADDR
-riscv_get_pc (struct regcache *regcache)
+CORE_ADDR
+riscv_target::low_get_pc (regcache *regcache)
{
elf_gregset_t regset;
return linux_get_pc_32bit (regcache);
}
-/* Implementation of linux_target_ops method "set_pc". */
+/* Implementation of linux target ops method "low_set_pc". */
-static void
-riscv_set_pc (struct regcache *regcache, CORE_ADDR newpc)
+void
+riscv_target::low_set_pc (regcache *regcache, CORE_ADDR newpc)
{
elf_gregset_t regset;
static const uint16_t riscv_ibreakpoint[] = { 0x0073, 0x0010 };
static const uint16_t riscv_cbreakpoint = 0x9002;
-/* Implementation of linux_target_ops method "breakpoint_kind_from_pc". */
+/* Implementation of target ops method "breakpoint_kind_from_pc". */
-static int
-riscv_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+int
+riscv_target::breakpoint_kind_from_pc (CORE_ADDR *pcptr)
{
union
{
return sizeof (riscv_cbreakpoint);
}
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind". */
+/* Implementation of target ops method "sw_breakpoint_from_kind". */
-static const gdb_byte *
-riscv_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+riscv_target::sw_breakpoint_from_kind (int kind, int *size)
{
*size = kind;
switch (kind)
/* RISC-V/Linux target operations. */
struct linux_target_ops the_low_target =
{
- riscv_get_pc,
- riscv_set_pc,
- riscv_breakpoint_kind_from_pc,
- riscv_sw_breakpoint_from_kind,
NULL, /* get_next_pcs */
0, /* decr_pc_after_break */
riscv_breakpoint_at,