This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Support for HWbreak/watchpoint accross fork/vfork on arm-native
- From: Omair Javaid <omair dot javaid at linaro dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Fri, 14 Feb 2014 05:06:30 +0500
- Subject: Re: [PATCH] Support for HWbreak/watchpoint accross fork/vfork on arm-native
- Authentication-results: sourceware.org; auth=none
- References: <1391119790-6580-1-git-send-email-omair dot javaid at linaro dot org> <52EAD0DC dot 506 at linaro dot org> <52F57EA2 dot 20908 at codesourcery dot com> <52FB95D3 dot 5000207 at linaro dot org> <52FD117B dot 8060401 at redhat dot com>
On 13/02/2014 23:39, Pedro Alves wrote:
+static int
+update_registers_callback (struct lwp_info *lwp, void *arg)
+{
+ struct update_registers_data *data = (struct update_registers_data *) arg;
+
+ /* Force iterate_over_lwps to return matched lwp_info*. */
+ if (arg == NULL)
+ return 1;
+
You don't seem to have addressed my comment here? It was:
"I don't understand this. It seems nothing passes a NULL arg."
I was using iterate_over_lwps to return matching lwp_info struct and
that happens only when if update_registers_callback returns 1.
Its not being used anywhere now and can be removed.
if (watchpoint)
{
count = arm_linux_get_hw_watchpoint_count ();
- bpts = t->wpts;
- dir = -1;
+ bpts = arm_linux_get_debug_reg_state (pid)->wpts;
+ if (count > MAX_WPTS)
+ warning (_("arm-linux-gdb supports %d hardware watchpoints but target \
+ supports %d"), MAX_WPTS, count);
Like in the Aarch64 port, add a 'count = MAX_WPTS' as well, otherwise
GDB would access the arrays out of bounds when that happens.
OK will update and repost.
}
else
{
count = arm_linux_get_hw_breakpoint_count ();
- bpts = t->bpts;
- dir = 1;
+ bpts = arm_linux_get_debug_reg_state (pid)->bpts;
+ if (count > MAX_BPTS)
+ warning (_("arm-linux-gdb supports %d hardware breakpoints but target \
+ supports %d"), MAX_BPTS, count);
Likewise.
OK will update and repost.
}
for (i = 0; i < count; ++i)
if (!arm_hwbp_control_is_enabled (bpts[i].control))