You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/file.h>
-#include <sys/stat.h>
+#include "gdb_stat.h"
#include "symtab.h"
#include "setjmp.h"
ptrace (6, inferior_pid,
(PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register(regno));
else
- printf ("Bad register number for store_inferior routine\n");
+ printf_unfiltered ("Bad register number for store_inferior routine\n");
}
else
{
case 28:
case 29:
case 30:
- case 31: return (ustart + ((int) &u.pt_r0 - (int) &u) + sizeof(REGISTER_TYPE) * regnum);
+ case 31:
+ return (ustart + ((int) &u.pt_r0 - (int) &u) + REGISTER_SIZE * regnum);
case PSR_REGNUM: return (ustart + ((int) &u.pt_psr - (int) &u));
case FPSR_REGNUM: return (ustart + ((int) &u.pt_fpsr - (int) &u));
case FPCR_REGNUM: return (ustart + ((int) &u.pt_fpcr - (int) &u));
case SXIP_REGNUM: return (ustart + SXIP_OFFSET);
case SNIP_REGNUM: return (ustart + SNIP_OFFSET);
case SFIP_REGNUM: return (ustart + SFIP_OFFSET);
- default: return (blockend + sizeof (REGISTER_TYPE) * regnum);
+ default:
+ if (regnum < NUM_REGS)
+ /* The register is one of those which is not defined...
+ give it zero */
+ return (ustart + ((int) &u.pt_r0 - (int) &u));
+ else
+ return (blockend + REGISTER_SIZE * regnum);
}
}