aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/aarch64-linux-hw-point.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
index 1a5fa6a..dcbfa98 100644
--- a/gdb/nat/aarch64-linux-hw-point.c
+++ b/gdb/nat/aarch64-linux-hw-point.c
@@ -561,8 +561,8 @@ aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
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]));
+ iov.iov_len = (offsetof (struct user_hwdebug_state, dbg_regs)
+ + count * sizeof (regs.dbg_regs[0]));
for (i = 0; i < count; i++)
{