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: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB


>>PPS: I am currently writing hardware watchpoint support for Cygwin via Page
>>protections,
>>it basically works except that I get troubles when the page protection is
>>triggered inside a system DLL code.
>
>Couldn't you kludge this by not allowing hardware points on sections of code
>in a system DLL as determined by whether the DLL path includes the windows
>system directory?  I do something similar for the cygwin DLL.

  The problem is that if a page protection error happens in normal code,
and that the address is not a watchpoint, the page protection is 
removed, a single step is made and the page protection is turned on again.

  If the same happens inside a system call 
(I suspect any DLL loaded a address above 0x8000000)
then single step setting by changing the trace bit does not work !
Setting a breakpoint inside system DLL probably also will not work
(I must confess that I didn't even try!)
So, I simply try to go up the stack and I palce a breakpoint at the first 
return address that is in normal code. 
This will miss any further watchpoint at the same page... but nothing is
never perfect :(
Furthermore, for the moment, my code fails if a second page protection
fault is
triggered before reaching the breakpoint set.

>Hardware watchpoints would be much appreciated.
>
>Actually, someone else working on the win32-nat.c stuff is much appreciated!

   I was tired of not being able to watch variables with win32 GDB !!



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]