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: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat 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: Wed, 30 Dec 2009 01:22:12 -0200
- Subject: Re: [PATCH 2/4] Hardware accelerated watchpoint conditions
- References: <200912232231.01798.bauerman@br.ibm.com> <20091224184056.GA8545@host0.dyn.jankratochvil.net>
On Thu 24 Dec 2009 16:40:56 Jan Kratochvil wrote:
> > --- 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).
Indeed, that worked too and looks cleaner. I'll post this fix as a separate
patch, since it is a bug that affects GDB's counting of hardware watchpoint
resources regardless of the features we are introducing here.
Thanks!
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center