diff options
author | Jason Molenda <jsm@bugshack.cygnus.com> | 1999-07-07 20:19:36 +0000 |
---|---|---|
committer | Jason Molenda <jsm@bugshack.cygnus.com> | 1999-07-07 20:19:36 +0000 |
commit | a87029ef15e59af2cc0b27cb4024b0db313fa88e (patch) | |
tree | a5cc2d6f8ebdbbd957642e72e0e88cc5fe5cd2e1 /gdb/gdbserver/low-sparc.c | |
parent | 528824cc847e5a13831dd41e5aacb34679143c94 (diff) | |
download | gdb-a87029ef15e59af2cc0b27cb4024b0db313fa88e.tar.gz |
import gdb-1999-07-07 post reformat
Diffstat (limited to 'gdb/gdbserver/low-sparc.c')
-rw-r--r-- | gdb/gdbserver/low-sparc.c | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/gdb/gdbserver/low-sparc.c b/gdb/gdbserver/low-sparc.c index ddffaec5927..9dd70a25079 100644 --- a/gdb/gdbserver/low-sparc.c +++ b/gdb/gdbserver/low-sparc.c @@ -1,21 +1,22 @@ /* Low level interface to ptrace, for the remote server for GDB. Copyright (C) 1986, 1987, 1993 Free Software Foundation, Inc. -This file is part of GDB. + This file is part of GDB. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include "defs.h" #include <sys/wait.h> @@ -95,7 +96,7 @@ kill_inferior () return; ptrace (8, inferior_pid, 0, 0); wait (0); - /*************inferior_died ();****VK**************/ +/*************inferior_died ();****VK**************/ } /* Return nonzero if the given thread is still alive. */ @@ -172,32 +173,32 @@ fetch_inferior_registers (ignored) to the stack pointer. */ if (ptrace (PTRACE_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers, 0)) - perror("ptrace_getregs"); - + (PTRACE_ARG3_TYPE) & inferior_registers, 0)) + perror ("ptrace_getregs"); + registers[REGISTER_BYTE (0)] = 0; memcpy (®isters[REGISTER_BYTE (1)], &inferior_registers.r_g1, 15 * REGISTER_RAW_SIZE (G0_REGNUM)); - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; - *(int *)®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y; + *(int *) ®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; + *(int *) ®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; + *(int *) ®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; + *(int *) ®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y; /* Floating point registers */ if (ptrace (PTRACE_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, + (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0)) - perror("ptrace_getfpregs"); + perror ("ptrace_getfpregs"); memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, sizeof inferior_fp_registers.fpu_fr); /* These regs are saved on the stack by the kernel. Only read them all (16 ptrace calls!) if we really need them. */ - read_inferior_memory (*(CORE_ADDR*)®isters[REGISTER_BYTE (SP_REGNUM)], + read_inferior_memory (*(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)], ®isters[REGISTER_BYTE (L0_REGNUM)], - 16*REGISTER_RAW_SIZE (L0_REGNUM)); + 16 * REGISTER_RAW_SIZE (L0_REGNUM)); } /* Store our register values back into the inferior. @@ -210,33 +211,33 @@ store_inferior_registers (ignored) { struct regs inferior_registers; struct fp_status inferior_fp_registers; - CORE_ADDR sp = *(CORE_ADDR *)®isters[REGISTER_BYTE (SP_REGNUM)]; + CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)]; write_inferior_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)], - 16*REGISTER_RAW_SIZE (L0_REGNUM)); + 16 * REGISTER_RAW_SIZE (L0_REGNUM)); memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)], 15 * REGISTER_RAW_SIZE (G1_REGNUM)); inferior_registers.r_ps = - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; + *(int *) ®isters[REGISTER_BYTE (PS_REGNUM)]; inferior_registers.r_pc = - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; + *(int *) ®isters[REGISTER_BYTE (PC_REGNUM)]; inferior_registers.r_npc = - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)]; + *(int *) ®isters[REGISTER_BYTE (NPC_REGNUM)]; inferior_registers.r_y = - *(int *)®isters[REGISTER_BYTE (Y_REGNUM)]; + *(int *) ®isters[REGISTER_BYTE (Y_REGNUM)]; if (ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers, 0)) - perror("ptrace_setregs"); + (PTRACE_ARG3_TYPE) & inferior_registers, 0)) + perror ("ptrace_setregs"); memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], sizeof inferior_fp_registers.fpu_fr); if (ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0)) - perror("ptrace_setfpregs"); + (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0)) + perror ("ptrace_setfpregs"); } /* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory |