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 for gdb5.0; enable hardware watchpoints on UnixWare


> From: "John Hughes" <john@Calva.COM>
> Date: Tue, 31 Oct 2000 15:30:23 +0100
>  
> > I _will_ try to make the generic code general enough to be easily
> > usable by all targets which already have watchpoint support.
> 
> What will you need?  A macro to get the debug registers for a pid
> and one to put 'em back?

No, I think that's too tailored to some targets and won't work for
some of the others.  I think we need functions to pass the debug
registers between GDB and the system-dependent interface between the
debugger and the debuggee.  For example, i386v-nat.c uses ptrace, but
go32-nat.c doesn't.  (In fact, if you look at go32-nat.c, you probably
won't understand how the heck do the debug register wind up in the
debuggee, because the code to do that is not in GDB's sources, it's in
a special library supplied with DJGPP.)

> > >   1. Why not zap the waddr arg to go32_..._watchpoint?  It's not used.
> > 
> > It might be there because GDB needs that argument for some other
> > (non-x86) target. 
> 
> It isn't.

Yes, you are right.  waddr is a left-over from i386v-nat.c, which is
where the go32-nat.c code originated.  Thanks for pointing this out.

> > >   2. In go32_insert_aligned_watchpoint...
> > 
> > I think you are looking at an old version of go32-nat.c.
> 
> My comments refer to the version labeled '1.6' in the cvsweb.  Is there
> a later one I could look at?

That's the latest version.  Hmm...  Oh, I see what happened: you were
talking about go32_insert_aligned_watchpoint, whereas I was looking at
go32_remove_aligned_watchpoint (because you said that it has the same
problems).  Sorry about that misunderstanding.

Yeah, okay, I think you are right, and the code could be made
simpler.  Thanks for pointing that out.  (That code was written by
several people over several years, and it shows.)

> > While I generalize the code, I will bring it up to date with the letter
> > of Intel's manuals.
> 
> So you're going to have your own defines for DR_... and not use the
> system ones?  I guess that was why your code didn't match up to what
> I find in sys/debugreg.h on my system.

I was unaware of sys/debugreg.h until now.  Is it present on all Unix
x86-based systems?  If not, we will need some configury magic to
handle this.

DJGPP certainly doesn't have sys/debugreg.h, and I don't know how
about Cygwin.

What do people think about relative merits of using sys/debugreg.h vs
having the definitions inside GDB (or both)?

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