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: [PATCH]: Make Linux use the new unified x86 watchpoint support


>>>>> Eli Zaretskii writes:

> On Tue, 27 Mar 2001, Mark Kettenis wrote:

>> Except that the implementation of hardware breakpoints/watchpoints in 
>> core GDB is really shoddy.

> True.  It clearly shows that it was originally written for a very special 
> platform (Sparclet, I think) and was designed accordingly.  Certain 
> aspects of how breakpoint.c handles watchpoints cannot be understood 
> without having this in mind.  For example, why on Earth are 
> software watchpoints and hardware watchpoints handled differently from 
> read and access watchpoints? why are hardware breakpoints treated like 
> normal breakpoints instead of being akin to watchpoints? etc., etc.

Not just shoddy, but plain broken for a number of targets.

When a read wathcpoint is triggered, the target stops and informs gdb.
In breakpoint.c, gdb sees that there are read or access watchpoints set
and that the data address reported by the target matches. This causes
watchpoint_check() to be called. The problem is that watchpoint_check()
will try to  read from the watched data area to see if it changed, but
this is done before gdb has removed watchpoints from the target. This
causes the target to respond with an error when gdb tries to access the
watched area.

--Mark


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