Index: regcache.c =================================================================== RCS file: /cvs/src/src/gdb/regcache.c,v retrieving revision 1.34 diff -p -r1.34 regcache.c *** regcache.c 6 Apr 2002 00:02:50 -0000 1.34 --- regcache.c 16 May 2002 15:31:56 -0000 *************** read_register_bytes (int in_start, char *** 228,233 **** --- 228,248 ---- int regnum; char *reg_buf = alloca (MAX_REGISTER_RAW_SIZE); + if (gdbarch_register_read_p (current_gdbarch) + && in_start == 0 && in_len == REGISTER_BYTES) /* OK Use. */ + { + /* We assume that if the target has set register_read_p() then + all the pseuos will be correctly mapped onto raw registers. + Therefore, the regcache describes only the registers in the + range [0..NUM_REGS) and the code for reading the entire + regset becomes much simpler. */ + + for (regnum = 0; regnum < NUM_REGS; regnum++) + regcache_read (regnum, in_buf + REGISTER_BYTE (regnum)); + + return; + } + /* See if we are trying to read bytes from out-of-date registers. If so, update just those registers. */ *************** write_register_bytes (int myregstart, ch *** 397,402 **** --- 412,432 ---- int regnum; target_prepare_to_store (); + + if (gdbarch_register_write_p (current_gdbarch) + && myregstart == 0 && inlen == REGISTER_BYTES) /* OK Use. */ + { + /* We assume that if the target has set register_write_p() then + all the pseuos will be correctly mapped onto raw registers. + Therefore, the regcache describes only the registers in the + range [0..NUM_REGS) and the code for restoring things becomes + much simpler. */ + + for (regnum = 0; regnum < NUM_REGS; regnum++) + regcache_write (regnum, myaddr + REGISTER_BYTE (regnum)); + + return; + } /* Scan through the registers updating any that are covered by the range myregstart<=>myregend using write_register_gen, which does