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: [RFC/RFA] Add hardware watchpoint support for cygwin target.


At 20:30 28/11/2001 , Christopher Faylor a écrit:
>On Wed, Nov 28, 2001 at 08:13:12PM +0200, Eli Zaretskii wrote:
> >> Date: Wed, 28 Nov 2001 18:44:44 +0100
> >> From: Pierre Muller <muller@cerbere.u-strasbg.fr>
> >> 
> >> But te are some annoying things,
> >> the most annoying is that an exception seems to be generated
> >> on read access of the watched area even if you only set a normal
> >> watchpoint (which should use a write-only debug feature).
> >
> >So you are saying that watch, rwatch, and awatch all yield the same
> >behavior?
> >
> >Are you sure that you pass the watchpoint information correctly to
> >the OS?  For example, is the format of DR7 as the OS wants it
> >identical to what GDB uses?  The layout of bits in dr_control_mirror
> >follows Intel documentation, but the OS might want those bits in a
> >different format (that's what the corresponding DPMI call does, for
> >example).  I don't have Windows docs, so I cannot check this.
> >
> >> > /* Get the value of the DR6 debug status register from the inferior.
> >> >    Here we just return the value stored in D_REGS, as we've got it
> >> >    from the last go32_wait call.  */
> >
> >I believe you didn't really mean ``go32_wait'' here ;-)
>
>I'd like some clarification on this before I can accept the patch.  It
>seems like the described behavior would be annoying indeed.  It would
>be nice to fix this.

  I now think that the thread following this patch clearly shows that
there is no cygwin specific bug related to the handling of 
i386 hardware registers in win32-nat.c.

   There are twhree problems related to watchpoints, but none is cygwin specific.

One is related to the absence of removal of the watchpoints at program
exit or kill, which explains the failures observed for the go32 target.
This bug is almost completely hidden in my patch because of the 
DLL loading that does clean the values of the previous run and 
set the watchpoint begin value correctly.

  The second bug arises on the linux target because of both 
the absence of watchpoint removal at exit and lack of calling i386_cleanup_dregs
which results in the fact that the debug registers are not set correctly
to inferior on the second run with the same watchpoints.
That second bug is also not visible on cygwin target as 
that target does call i386_cleanup_dregs.

  The last problem is the unwanted gdb output, but here again,
this is NOT a cygwin specific bug, as it is also present for linux target.
   Each time a DLL (cygwin target) or a shared lib (linux target) is 
loaded, all breakpoints are re-setted, and the mention function does
generate an output even if the output have been disabled by gdb_stdout and gdb_stderr.
This is probably an UI_OUT specific problem, but as its again not cygwin specific
I don't think that there is any reason to delay approval.




Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


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