diff options
author | Yufeng Zhang <yufeng.zhang@arm.com> | 2013-12-18 16:47:33 +0000 |
---|---|---|
committer | Yufeng Zhang <yufeng.zhang@arm.com> | 2013-12-18 16:47:33 +0000 |
commit | f45c82da381e0ce5ce51b7fb24d0d28611d266b8 (patch) | |
tree | a6541435d68ac229c38116ac03aa59f6747ed8a2 /gdb/aarch64-linux-nat.c | |
parent | 7174e19ff2ec10026c18e8582331d88e1c6242b2 (diff) | |
download | gdb-f45c82da381e0ce5ce51b7fb24d0d28611d266b8.zip gdb-f45c82da381e0ce5ce51b7fb24d0d28611d266b8.tar.gz gdb-f45c82da381e0ce5ce51b7fb24d0d28611d266b8.tar.bz2 |
gdb/
* aarch64-linux-nat.c (aarch64_linux_set_debug_regs): Set
iov.iov_len with the real length in use.
gdb/gdbserver/
* linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
iov.iov_len with the real length in use.
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r-- | gdb/aarch64-linux-nat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 256725b..7d76833 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -314,10 +314,13 @@ aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, 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++) { |