This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Problems with hardware watchpoint on ia32.
On Wed, Mar 08, 2000 at 05:08:17AM -0500, Eli Zaretskii wrote:
>
> > Starting program: /home/hjl/bugs/gdb/hw/y
> > warning: Could not insert hardware watchpoint 1.
> > warning: Could not insert hardware watchpoint 3.
> > ptrace: Unknown error 4294967295.
> > Cannot insert breakpoints.
> > The same program may be running in another process.
> > (gdb)
> >
> > ia32 only has 4 hardware debug registers. But gdb shouldn't crash.
>
> I don't see any crashes in the above script. GDB simply didn't start
> the process. It is arguable whether it should instead proceed after
> inserting only those watchpoints it can, but I agree that it should at
> least be a user option.
I said it crushed because I spent 5 hours in gdb and were very close
to the problem, all of a sudden, I couldn't continue to debug in gdb
no matter what I did. To me, it has the same effect as crush.
>
> > Even worse, after deleted one hardware watchpoint, gdb still refused
> > to work.
>
> It works for me, but I have patches to do that, which I'm trying for 6
> months to get accepted :-(.
Should we at least review it?
>
> Those patches also correct numerous other problems with watchpoints on
> x86, which you didn't mention. For example, try setting several
> watchpoints (of different types) on the same variable, and see the
> mess. Another problem which I corrected is that you cannot watch
> struct members, array elements, and bit fields with hardware-assisted
> watchpoints.
I believe it is fixed in the currnt gdb.
>
> > (gdb) watch a1
> > Watchpoint 1: a1
> > (gdb) watch a2
> > Watchpoint 2: a2
> > (gdb)
> >
> > gdb won't set hardware watchpoints on long long nor double.
>
> You could look at go32-nat.c, it supports watching any region up to 16
> bytes large. (I'm at a loss how come DJGPP needed to invent this: I'd
> expect any x86 platform to have this already, since watchpoints are
> such an indispensable tool in some circumstances.)
>
Maybe we should have an i386hw-nat.c used by all ia32 platforms.
H.J.