/* GNU/Linux/RISC-V specific low level interface, for the remote server
for GDB.
- Copyright (C) 2020 Free Software Foundation, Inc.
+ Copyright (C) 2020-2021 Free Software Foundation, Inc.
This file is part of GDB.
CORE_ADDR low_get_pc (regcache *regcache) override;
void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+ bool low_breakpoint_at (CORE_ADDR pc) override;
};
/* The singleton target ops object. */
const riscv_gdbarch_features features
= riscv_linux_read_features (lwpid_of (current_thread));
- target_desc *tdesc = riscv_create_target_description (features);
+ target_desc_up tdesc = riscv_create_target_description (features);
if (!tdesc->expedite_regs)
- init_target_desc (tdesc, expedite_regs);
- current_process ()->tdesc = tdesc;
+ init_target_desc (tdesc.get (), expedite_regs);
+ current_process ()->tdesc = tdesc.release ();
}
/* Collect GPRs from REGCACHE into BUF. */
}
}
-/* Implementation of linux_target_ops method "breakpoint_at". */
+/* Implementation of linux target ops method "low_breakpoint_at". */
-static int
-riscv_breakpoint_at (CORE_ADDR pc)
+bool
+riscv_target::low_breakpoint_at (CORE_ADDR pc)
{
union
{
&& target_read_memory (pc + sizeof (buf.insn), buf.bytes,
sizeof (buf.insn)) == 0
&& buf.insn == riscv_ibreakpoint[1])))
- return 1;
+ return true;
else
- return 0;
+ return false;
}
-/* RISC-V/Linux target operations. */
-struct linux_target_ops the_low_target =
-{
- 0, /* decr_pc_after_break */
- riscv_breakpoint_at,
-};
-
/* The linux target ops object. */
linux_process_target *the_linux_target = &the_riscv_target;