/* Native-dependent code for GNU/Linux AArch64.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.
memset (®s, 0, sizeof (regs));
iov.iov_base = ®s;
- iov.iov_len = sizeof (regs);
count = watchpoint ? aarch64_num_wp_regs : aarch64_num_bp_regs;
addr = watchpoint ? state->dr_addr_wp : state->dr_addr_bp;
ctrl = watchpoint ? state->dr_ctrl_wp : state->dr_ctrl_bp;
+ if (count == 0)
+ return;
+ iov.iov_len = (offsetof (struct user_hwdebug_state, dbg_regs[count - 1])
+ + sizeof (regs.dbg_regs [count - 1]));
for (i = 0; i < count; i++)
{
}
}
-static void (*super_post_startup_inferior) (ptid_t ptid);
+static void (*super_post_startup_inferior) (struct target_ops *self,
+ ptid_t ptid);
/* Implement the "to_post_startup_inferior" target_ops method. */
static void
-aarch64_linux_child_post_startup_inferior (ptid_t ptid)
+aarch64_linux_child_post_startup_inferior (struct target_ops *self,
+ ptid_t ptid)
{
aarch64_forget_process (ptid_get_pid (ptid));
aarch64_linux_get_debug_reg_capacity ();
- super_post_startup_inferior (ptid);
+ super_post_startup_inferior (self, ptid);
}
/* Implement the "to_read_description" target_ops method. */
sharing implemented via reference counts. */
static int
-aarch64_linux_can_use_hw_breakpoint (int type, int cnt, int othertype)
+aarch64_linux_can_use_hw_breakpoint (struct target_ops *self,
+ int type, int cnt, int othertype)
{
return 1;
}
Return 0 on success, -1 on failure. */
static int
-aarch64_linux_insert_hw_breakpoint (struct gdbarch *gdbarch,
+aarch64_linux_insert_hw_breakpoint (struct target_ops *self,
+ struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
int ret;
Return 0 on success, -1 on failure. */
static int
-aarch64_linux_remove_hw_breakpoint (struct gdbarch *gdbarch,
+aarch64_linux_remove_hw_breakpoint (struct target_ops *self,
+ struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
int ret;
of the type TYPE. Return 0 on success, -1 on failure. */
static int
-aarch64_linux_insert_watchpoint (CORE_ADDR addr, int len, int type,
+aarch64_linux_insert_watchpoint (struct target_ops *self,
+ CORE_ADDR addr, int len, int type,
struct expression *cond)
{
int ret;
type TYPE. Return 0 on success, -1 on failure. */
static int
-aarch64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type,
+aarch64_linux_remove_watchpoint (struct target_ops *self,
+ CORE_ADDR addr, int len, int type,
struct expression *cond)
{
int ret;
/* Implement the "to_region_ok_for_hw_watchpoint" target_ops method. */
static int
-aarch64_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+ CORE_ADDR addr, int len)
{
CORE_ADDR aligned_addr;
/* Implement the "to_stopped_by_watchpoint" target_ops method. */
static int
-aarch64_linux_stopped_by_watchpoint (void)
+aarch64_linux_stopped_by_watchpoint (struct target_ops *ops)
{
CORE_ADDR addr;
- return aarch64_linux_stopped_data_address (¤t_target, &addr);
+ return aarch64_linux_stopped_data_address (ops, &addr);
}
/* Implement the "to_watchpoint_addr_within_range" target_ops method. */