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: [RFA]: New function to supply only one x87 register


   Date: Fri, 9 Feb 2001 09:59:15 -0500 (EST)
   From: Eli Zaretskii <eliz@delorie.com>

   > From: Mark Kettenis <kettenis@wins.uva.nl>
   > Date: 09 Feb 2001 14:47:25 +0100

   I don't know enough about GDB's register cache to feel safe with such
   assumptions.  What I'm trying to do is be consistent with the
   documented API.  Since target.h's `to_fetch_registers' method says
   "fetch register REGNO, or all regs if regno == -1", I'm trying to do
   just that and nothing else.

   Isn't it dangerous to have functions in the infrastructure with
   built-in implicit assumptions that are not documented anywhere, and
   only hold because the current application-level code does what it
   does?

Of course it is, but in this particular case it is wide-spread.  All
systems with a SVR4-like /proc file system do this, as well as most
systems that have a ptrace request that fetches a whole bunch of
registers in one go.  By supplying all those registers at once, the
cache becomes some sort of read-ahead cache.  This makes sense since
GDB hardly ever needs only one register, and pre-fetching those saves
a few system calls.  This probably doesn't matter much on go32, but I
think you should do it anyway, at least for the FPU.

We probably should document this somewhere.

Mark


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