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]

Re: Runtiming hw watchpoints; Was: Split up Z packet enable/disable cmd


Eli Zaretskii wrote:
> 
> > Date: Thu, 03 Aug 2000 19:06:12 +0000
> > From: Fernando Nasser <fnasser@cygnus.com>
> >
> > Here is the change (note that the number of hw breakpoints has been included):
> >
> >   if (mem_cnt != 0)
> >     {
> > +     j = hw_watchpoint_used_count ();
> 
> I'm guessing you meant hw_breakpoint_used_count here.
>

Yes, it is.
Sorry, I didn't have the right branch checked out here so I recomposed it by heart.
 
> >       i = hw_watchpoint_used_count (bp_type, &other_type_used);
> >       target_resources_ok =
> > !       TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_type, j, i + mem_cnt,
> >                                             other_type_used);
> 
> The problem here is that the mere _count_ of the used up break- and
> watch-points is not enough to return an accurate answer to the
> question asked by TARGET_CAN_USE_HARDWARE_WATCHPOINT.  At least in the
> DJGPP case (and I believe for every other x86 target, too), I need to
> know the addresses and the size of watched regions of all watchpoints,
> and also the addresses of all hardware-assisted breakpoints.  If
> TARGET_CAN_USE_HARDWARE_WATCHPOINT will get that info, it could be
> implemented so as to return a meaningful result.

That is taken care of in breakpoints.c also.  The function can_use_hardware_watchpoint()
checks how many hardware registers will be necessary for implementing a watchpoint.
It may need fix or parametrization, but it is in there.

You see, nobody even know that these things are there because the macros/functions to 
do the actual check for most targets did not get implemented.  But someone
did a reasonable job in breakpoint.c to provide the data.

The other issue, mix of different types, is addressed by the other_type_used.
I think we may need more than that in the future but it seems enough for the
current targets.





-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299

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