This is the mail archive of the gdb@sourceware.cygnus.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: ST(i) and MMj



> > Grep the sources for NUM_REGS, and look for loops that traverse the
> > register set.  Prove to yourself that none of these loops will break
> > if register X aliases register Y.  Persuade yourself that nobody in
> > the future, innocent of the x86's sins, will write such a loop.
> > 
> > I tried, but I couldn't manage it.  :)
> 
> I agree with Jim.  The way GDB currently resolves register names/numbers
> ``freaks me out''.

I don't know, it might be that I'm missing some crucial aspect of
this, but I did grep the sources for NUM_REGS, and didn't see anything
that cannot be taken care of by a combination of two simple tricks:

  * Make macros like REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE,
    etc. behave as if the MMX registers, when stored in memory, have
    zero length;

  * Change functions that read and write registers from/to memory to
    handle the MMX registers specially by looking at the appropriate
    ST(i) register instead.

Both of these aspects are either target-specific or rely heavily on
target-specific subroutines, so it shouldn't be too hard to do it
without affecting other platforms.

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