const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+ bool supports_z_point_type (char z_type) override;
+
protected:
void low_arch_setup () override;
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;
+
+ int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int size, raw_breakpoint *bp) override;
+
+ bool low_stopped_by_watchpoint () override;
+
+ CORE_ADDR low_stopped_data_address () override;
+
+ void low_collect_ptrace_register (regcache *regcache, int regno,
+ char *buf) override;
+
+ void low_supply_ptrace_register (regcache *regcache, int regno,
+ const char *buf) override;
+
+ arch_process_info *low_new_process () override;
+
+ void low_delete_process (arch_process_info *info) override;
+
+ void low_new_thread (lwp_info *) override;
+
+ void low_delete_thread (arch_lwp_info *) override;
+
+ void low_new_fork (process_info *parent, process_info *child) override;
};
/* The singleton target ops object. */
return (const gdb_byte *) &mips_breakpoint;
}
-static int
-mips_breakpoint_at (CORE_ADDR where)
+bool
+mips_target::low_breakpoint_at (CORE_ADDR where)
{
unsigned int insn;
- the_target->read_memory (where, (unsigned char *) &insn, 4);
+ read_memory (where, (unsigned char *) &insn, 4);
if (insn == mips_breakpoint)
- return 1;
+ return true;
/* If necessary, recognize more trap instructions here. GDB only uses the
one. */
- return 0;
+ return false;
}
/* Mark the watch registers of lwp, represented by ENTRY, as changed. */
linux_stop_lwp (lwp);
}
-/* This is the implementation of linux_target_ops method
- new_process. */
+/* This is the implementation of linux target ops method
+ low_new_process. */
-static struct arch_process_info *
-mips_linux_new_process (void)
+arch_process_info *
+mips_target::low_new_process ()
{
struct arch_process_info *info = XCNEW (struct arch_process_info);
return info;
}
-/* This is the implementation of linux_target_ops method
- delete_process. */
+/* This is the implementation of linux target ops method
+ low_delete_process. */
-static void
-mips_linux_delete_process (struct arch_process_info *info)
+void
+mips_target::low_delete_process (arch_process_info *info)
{
xfree (info);
}
-/* This is the implementation of linux_target_ops method new_thread.
+/* This is the implementation of linux target ops method low_new_thread.
Mark the watch registers as changed, so the threads' copies will
be updated. */
-static void
-mips_linux_new_thread (struct lwp_info *lwp)
+void
+mips_target::low_new_thread (lwp_info *lwp)
{
struct arch_lwp_info *info = XCNEW (struct arch_lwp_info);
/* Function to call when a thread is being deleted. */
-static void
-mips_linux_delete_thread (struct arch_lwp_info *arch_lwp)
+void
+mips_target::low_delete_thread (arch_lwp_info *arch_lwp)
{
xfree (arch_lwp);
}
/* Hook to call when a new fork is attached. */
-static void
-mips_linux_new_fork (struct process_info *parent,
- struct process_info *child)
+void
+mips_target::low_new_fork (process_info *parent,
+ process_info *child)
{
struct arch_process_info *parent_private;
struct arch_process_info *child_private;
}
}
-static int
-mips_supports_z_point_type (char z_type)
+bool
+mips_target::supports_z_point_type (char z_type)
{
switch (z_type)
{
case Z_PACKET_WRITE_WP:
case Z_PACKET_READ_WP:
case Z_PACKET_ACCESS_WP:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}
-/* This is the implementation of linux_target_ops method
- insert_point. */
+/* This is the implementation of linux target ops method
+ low_insert_point. */
-static int
-mips_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+mips_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
struct arch_process_info *priv = proc->priv->arch_private;
return 0;
}
-/* This is the implementation of linux_target_ops method
- remove_point. */
+/* This is the implementation of linux target ops method
+ low_remove_point. */
-static int
-mips_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int len, struct raw_breakpoint *bp)
+int
+mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
+ int len, raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
struct arch_process_info *priv = proc->priv->arch_private;
return 0;
}
-/* This is the implementation of linux_target_ops method
- stopped_by_watchpoint. The watchhi R and W bits indicate
+/* This is the implementation of linux target ops method
+ low_stopped_by_watchpoint. The watchhi R and W bits indicate
the watch register triggered. */
-static int
-mips_stopped_by_watchpoint (void)
+bool
+mips_target::low_stopped_by_watchpoint ()
{
struct process_info *proc = current_process ();
struct arch_process_info *priv = proc->priv->arch_private;
for (n = 0; n < MAX_DEBUG_REGISTER && n < num_valid; n++)
if (mips_linux_watch_get_watchhi (&priv->watch_readback, n)
& (R_MASK | W_MASK))
- return 1;
+ return true;
- return 0;
+ return false;
}
-/* This is the implementation of linux_target_ops method
- stopped_data_address. */
+/* This is the implementation of linux target ops method
+ low_stopped_data_address. */
-static CORE_ADDR
-mips_stopped_data_address (void)
+CORE_ADDR
+mips_target::low_stopped_data_address ()
{
struct process_info *proc = current_process ();
struct arch_process_info *priv = proc->priv->arch_private;
/* Take care of 32-bit registers with 64-bit ptrace, POKEUSER side. */
-static void
-mips_collect_ptrace_register (struct regcache *regcache,
- int regno, char *buf)
+void
+mips_target::low_collect_ptrace_register (regcache *regcache, int regno,
+ char *buf)
{
int use_64bit = sizeof (PTRACE_XFER_TYPE) == 8;
/* Take care of 32-bit registers with 64-bit ptrace, PEEKUSER side. */
-static void
-mips_supply_ptrace_register (struct regcache *regcache,
- int regno, const char *buf)
+void
+mips_target::low_supply_ptrace_register (regcache *regcache, int regno,
+ const char *buf)
{
int use_64bit = sizeof (PTRACE_XFER_TYPE) == 8;
}
struct linux_target_ops the_low_target = {
- 0,
- mips_breakpoint_at,
- mips_supports_z_point_type,
- mips_insert_point,
- mips_remove_point,
- mips_stopped_by_watchpoint,
- mips_stopped_data_address,
- mips_collect_ptrace_register,
- mips_supply_ptrace_register,
- NULL, /* siginfo_fixup */
- mips_linux_new_process,
- mips_linux_delete_process,
- mips_linux_new_thread,
- mips_linux_delete_thread,
- mips_linux_new_fork,
mips_linux_prepare_to_resume
};