This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa:breakpoint] Correctly count watchpoints


> Date: Tue, 01 Oct 2002 01:59:43 -0400
> From: Andrew Cagney <ac131313@redhat.com>
> > 
> > Why two?  Some expressions might need 3 registers.  If you use this 
> > worst-case scenario, GDB will think it cannot watch more than a single 
> > expression, and that some data types, such as double's, and complex 
> > aggregates, such as struct's, cannot be watched at all.  It's hardly a 
> > Good Thing to refuse to set watchpoints based on inaccurate decisions 
> > like this.
> 
> You mentioned two :-)

That was an example.

> Under the current arangement, an architecture has two choices:
> 
> - have target_can_use_hardware_watchpoints() always return true (most 
> targets appear to do this) and then error while trying to insert the 
> watchpoints.  This is what the i386 currently does.
> 
> - have target_can_use...() make use of the counts and return an 
> indication based on that

The reason the first strategy is widely used is that the high-level
code of GDB makes it very hard to do anything intelligent otherwise,
especially since refusing the target_can_use_hardware_watchpoints call
means GDB won't even try to insert that watchpoint.  IIRC, GDB doesn't
even promise to call that function (macro) only once for each
watchpoint.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]