This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/4] Hardware accelerated watchpoint conditions
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: gdb-patches at sourceware dot org, Luis Machado <luisgpm at linux dot vnet dot ibm dot com>, Matt Tyrlik <tyrlik at us dot ibm dot com>
- Date: Thu, 24 Dec 2009 19:40:56 +0100
- Subject: Re: [PATCH 2/4] Hardware accelerated watchpoint conditions
- References: <200912232231.01798.bauerman@br.ibm.com>
> --- gdb.orig/gdb/breakpoint.c 2009-12-23 15:14:03.000000000 -0200
> +++ gdb/gdb/breakpoint.c 2009-12-23 17:07:34.000000000 -0200
> @@ -1151,6 +1151,13 @@ update_watchpoint (struct breakpoint *b,
> + enum enable_state e;
> +
> + /* We have to temporary disable this watchpoint, otherwise
> + we will count it twice (once as being inserted, and once
> + as a watchpoint that we want to insert). */
> + e = b->enable_state;
> + b->enable_state = bp_disabled;
>
> i = hw_watchpoint_used_count (bp_hardware_watchpoint,
> &other_type_used);
> @@ -1167,6 +1174,8 @@ update_watchpoint (struct breakpoint *b,
> else
> b->type = bp_hardware_watchpoint;
> }
> + /* Restoring the original state. */
> + b->enable_state = e;
> }
>
> frame_pspace = get_frame_program_space (get_selected_frame (NULL));
Isn't it enough to just reset it before calling hw_watchpoint_used_count by:
b->type = bp_watchpoint;
(It is safer wrt hypothetical error() in the meantime.)
Had such local patch for ppc (this is a code by me but it was a regression, it
was broken before and my fix was just incomplete).
Regards,
Jan