This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/3] Demote to sw watchpoint only in update_watchpoint
- From: Pedro Alves <pedro at codesourcery dot com>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, gdb-patches at sourceware dot org, uweigand at de dot ibm dot com
- Date: Thu, 5 May 2011 09:15:18 +0100
- Subject: Re: [RFA 2/3] Demote to sw watchpoint only in update_watchpoint
- References: <201104291726.p3THQVaC029608@d06av02.portsmouth.uk.ibm.com> <83d3jz4110.fsf@gnu.org> <1304547648.19357.230.camel@hactar>
On Wednesday 04 May 2011 23:20:48, Thiago Jung Bauermann wrote:
> Pedro's suggestion:
>
> 1. The inferior is stopped and software bp_locations (both breakpoints
> and watchpoints) are removed. Hardware ones stay in place.
> 2. The user asks for a new watchpoint.
> 3. GDB evaluates the expression and creates the bp_locations.
> 4. GDB tries to insert the bp_locations as hw watches. If that fails,
> then converts to sw and registers the watchpoint for insertion.
> 5. The user asks the inferior to be continued.
> 6. GDB inserts sw breakpoints and watchpoints and resumes the inferior.
Either that or try keep hardware breakpoints and watchpoints uninserted,
and insert them just before 4. This variant is a bit safer in case GDB crashes,
but is a bit less efficient in case there are many watchpoints. But then
again we already remove/insert them all at each step, so that is kind of moot.
I've no real preference on which. This is a minor detail in the grand scheme
from my perspective.
--
Pedro Alves