Re: [RFC] GDB patches for hw watchpoints - revised

Daniel Jacobowitz
2006-01-24T03:43:10Z

On Tue, Jan 24, 2006 at 11:40:16AM +0800, Wu Zhou wrote:
> p630 is one kind of POWER4 based pSeriese server. It is currently the only
> available ppc machine I can get. :-)
>
> In fact, I am not sure before if the ppc arch has nonsteppable watchpoints
> or not. But testing on my p630 box, it did had nonsteppable ones. Now
> that an architecture either have or doesn't have nonsteppable watchpoints,
> can we get from this test a result that ppc architecture has nonsteppable
> watchpoints?
>
> If so, maybe I can just remove the stupid conditional statement below.
> (my original intention is to verify that v->mach equals bfd_mach_ppc_630 :-)

Well, it'd be nice to have some architectural reference for this. But
it's probably a safe bet to assume that this is generally true for all
PowerPC targets, so let's just assume it.
> Function to_region_ok_for_hw_watchpoint is not in the current target
> vector (I means struct target_ops). Maybe we can add it into
> target_ops? There are a few other archs also use this. But they had to
> include it in nm-xxx-yyy.h. If not, the only method I can think of is
> also include its definition in nm-ppc64-linux.h. So what about the
> following patch section?
>
> int (*to_region_size_ok_for_hw_watchpoint) (int);
> + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR *, int);
> void (*to_terminal_init) (void);

I would recommend replacing to_region_size_ok_for_hw_watchpoint
with to_region_ok_for_hw_watchpoint. You'll have to update the
callers, including the non-multi-arch ones, to ignore the first
argument; shouldn't be hard?

--
Daniel Jacobowitz
CodeSourcery