Update FSF address.
[deliverable/binutils-gdb.git] / gdb / sun386-nat.c
index f843eae9558ecaa9983d5b72d808db193730af0b..d4edd3c58f6b7c6a621e5099d8738432e2897475 100644 (file)
@@ -17,7 +17,7 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if defined (GDB_TARGET_IS_SUN386)
 
@@ -37,7 +37,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <machine/reg.h>
 
 #include <sys/file.h>
-#include <sys/stat.h>
+#include "gdb_stat.h"
 #include <sys/core.h>
 
 \f
@@ -77,7 +77,7 @@ core_file_command (filename, from_tty)
       make_cleanup (free, filename);
       
       if (have_inferior_p ())
-       error ("To look at a core file, you must kill the inferior with \"kill\".");
+       error ("To look at a core file, you must kill the program with \"kill\".");
       corechan = open (filename, O_RDONLY, 0);
       if (corechan < 0)
        perror_with_name (filename);
@@ -101,26 +101,26 @@ core_file_command (filename, from_tty)
        data_offset = sizeof corestr;
        stack_offset = sizeof corestr + corestr.c_dsize;
 
-       bcopy (&corestr.c_regs, registers, sizeof corestr.c_regs);
+       memcpy (registers, &corestr.c_regs, sizeof corestr.c_regs);
 
-       bcopy (corestr.c_fpu.f_fpstatus.f_st,
-              &registers[REGISTER_BYTE (FP0_REGNUM)],
+       memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+              corestr.c_fpu.f_fpstatus.f_st,
               sizeof corestr.c_fpu.f_fpstatus.f_st);
-       bcopy (&corestr.c_fpu.f_fpstatus.f_ctrl,
-              &registers[REGISTER_BYTE (FPC_REGNUM)],
+       memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+              &corestr.c_fpu.f_fpstatus.f_ctrl,
               sizeof corestr.c_fpu.f_fpstatus -
               sizeof corestr.c_fpu.f_fpstatus.f_st);
 
        /* the struct aouthdr of sun coff is not the struct exec stored
           in the core file. */
-       bcopy (&corestr.c_aouthdr, &core_aouthdr, sizeof (struct exec));
+       memcpy (&core_aouthdr, &corestr.c_aouthdr, sizeof (struct exec));
 #ifndef COFF_ENCAPSULATE
        core_aouthdr.magic = corestr.c_aouthdr.a_info;
        core_aouthdr.vstamp = /*SUNVERSION*/ 31252;
 #endif
-       printf ("Core file is from \"%s\".\n", corestr.c_cmdname);
+       printf_unfiltered ("Core file is from \"%s\".\n", corestr.c_cmdname);
        if (corestr.c_signo > 0)
-         printf ("Program terminated with signal %d, %s.\n",
+         printf_unfiltered ("Program terminated with signal %d, %s.\n",
                  corestr.c_signo, safe_strsignal (corestr.c_signo));
       }
       if (filename[0] == '/')
@@ -130,14 +130,13 @@ core_file_command (filename, from_tty)
          corefile = concat (current_directory, "/", filename, NULL);
        }
 
-      set_current_frame ( create_new_frame (read_register (FP_REGNUM),
-                                           read_pc ()));
+      flush_cached_frames ();
       select_frame (get_current_frame (), 0);
 
       validate_files ();
     }
   else if (from_tty)
-    printf ("No core file now.\n");
+    printf_unfiltered ("No core file now.\n");
 }
 
 i387_to_double (from, to)
@@ -216,12 +215,12 @@ fetch_inferior_registers (regno)
   ptrace (PTRACE_GETFPREGS, inferior_pid,
          (PTRACE_ARG3_TYPE) &inferior_fp_registers);
 
-  bcopy (&inferior_registers, registers, sizeof inferior_registers);
+  memcpy (registers, &inferior_registers, sizeof inferior_registers);
 
-  bcopy (inferior_fp_registers.f_st,&registers[REGISTER_BYTE (FP0_REGNUM)],
+  memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],inferior_fp_registers.f_st,
         sizeof inferior_fp_registers.f_st);
-  bcopy (&inferior_fp_registers.f_ctrl,
-        &registers[REGISTER_BYTE (FPC_REGNUM)],
+  memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+        &inferior_fp_registers.f_ctrl,
         sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
 }
 
@@ -237,12 +236,13 @@ store_inferior_registers (regno)
   struct fp_state inferior_fp_registers;
   extern char registers[];
 
-  bcopy (registers, &inferior_registers, 20 * 4);
+  memcpy (&inferior_registers, registers, 20 * 4);
 
-  bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],inferior_fp_registers.f_st,
+  memcpy (inferior_fp_registers.f_st,
+        &registers[REGISTER_BYTE (FP0_REGNUM)],
         sizeof inferior_fp_registers.f_st);
-  bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
-        &inferior_fp_registers.f_ctrl,
+  memcpy (&inferior_fp_registers.f_ctrl,
+        &registers[REGISTER_BYTE (FPC_REGNUM)],
         sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
   
 #ifdef PTRACE_FP_BUG
This page took 0.026963 seconds and 4 git commands to generate.