* procfs.c (proc_wait): Call print_sys_errmsg() if we get an
[deliverable/binutils-gdb.git] / gdb / remote-nindy.c
index af19fd484f9a0769b807f4d172a1860b0293e7c7..1e38f3d3bd412f4117582a6fddc53f8358a9890a 100644 (file)
@@ -1,5 +1,5 @@
 /* Memory-access and commands for remote NINDY process, for GDB.
-   Copyright (C) 1990-1991 Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
    Contributed by Intel Corporation.  Modified from remote.c by Chris Benenati.
 
 GDB is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -95,13 +95,11 @@ NINDY ROM monitor at the other end of the line.
  *
  ******************************************************************************/
 
-#include <stdio.h>
+#include "defs.h"
 #include <signal.h>
 #include <sys/types.h>
 #include <setjmp.h>
 
-#include "defs.h"
-#include "param.h"
 #include "frame.h"
 #include "inferior.h"
 #include "target.h"
@@ -124,14 +122,12 @@ extern char *getenv();
 extern char *mktemp();
 
 extern char *coffstrip();
-extern void add_syms_addr_command ();
-extern value call_function_by_hand ();
 extern void generic_mourn_inferior ();
 
 extern struct target_ops nindy_ops;
 extern jmp_buf to_top_level;
 extern FILE *instream;
-extern struct ext_format ext_format_i960[];    /* i960-tdep.c */
+extern struct ext_format ext_format_i960;      /* i960-tdep.c */
 
 extern char ninStopWhy ();
 
@@ -220,6 +216,8 @@ nindy_open (name, from_tty)
   if (!name)
     error_no_arg ("serial port device name");
 
+  target_preopen (from_tty);
+  
   nindy_close (0);
 
        have_regs = regs_changed = 0;
@@ -302,7 +300,7 @@ nindy_load( filename, from_tty )
 
   tmpfile = coffstrip(scratch_pathname);
   if ( tmpfile ){
-         old_chain = make_cleanup(unlink,tmpfile);
+         old_chain = make_cleanup (unlink,tmpfile);
          immediate_quit++;
          ninDownload( tmpfile, !from_tty );
 /* FIXME, don't we want this merged in here? */
@@ -472,7 +470,7 @@ struct nindy_regs {
   char fp_as_double[4 * 8];
 };
 
-static int
+static void
 nindy_fetch_registers(regno)
      int regno;
 {
@@ -494,21 +492,21 @@ nindy_fetch_registers(regno)
                         &nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
                         &inv);
     /* dub now in host byte order */
-    double_to_ieee_extended (ext_format_i960, &dub,
+    double_to_ieee_extended (&ext_format_i960, &dub,
                             &registers[REGISTER_BYTE (regnum)]);
   }
 
   registers_fetched ();
-  return 0;
 }
 
 static void
 nindy_prepare_to_store()
 {
-  nindy_fetch_registers(-1);
+  /* Fetch all regs if they aren't already here.  */
+  read_register_bytes (0, NULL, REGISTER_BYTES);
 }
 
-static int
+static void
 nindy_store_registers(regno)
      int regno;
 {
@@ -523,7 +521,7 @@ nindy_store_registers(regno)
   bcopy (&registers[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw,         1*4);
   /* Float regs.  Only works on IEEE_FLOAT hosts.  */
   for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++) {
-    ieee_extended_to_double (ext_format_i960,
+    ieee_extended_to_double (&ext_format_i960,
                             &registers[REGISTER_BYTE (regnum)], &dub);
     /* dub now in host byte order */
     /* FIXME-someday, the arguments to unpack_double are backward.
@@ -538,7 +536,6 @@ nindy_store_registers(regno)
   immediate_quit++;
   ninRegsPut( (char *) &nindy_regs );
   immediate_quit--;
-  return 0;
 }
 
 /* Read a word from remote address ADDR and return it.
@@ -571,11 +568,12 @@ nindy_store_word (addr, word)
    FIXME, rewrite this to not use the word-oriented routines.  */
 
 int
-nindy_xfer_inferior_memory(memaddr, myaddr, len, write)
+nindy_xfer_inferior_memory(memaddr, myaddr, len, write, target)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
      int write;
+     struct target_ops *target;                        /* ignored */
 {
   register int i;
   /* Round starting address down to longword boundary.  */
@@ -827,10 +825,6 @@ nindy_create_inferior (execfile, args, env)
 
   clear_proceed_status ();
 
-#if defined (START_INFERIOR_HOOK)
-  START_INFERIOR_HOOK ();
-#endif
-
   /* Tell wait_for_inferior that we've started a new process.  */
   init_wait_for_inferior ();
 
@@ -841,8 +835,6 @@ nindy_create_inferior (execfile, args, env)
   /* Install inferior's terminal modes.  */
   target_terminal_inferior ();
 
-  /* remote_start(args); */
-  /* trap_expected = 0; */
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
   proceed ((CORE_ADDR)entry_pt, -1, 0);                /* Let 'er rip... */
 }
@@ -932,6 +924,11 @@ nindy_before_main_loop ()
 
 struct target_ops nindy_ops = {
        "nindy", "Remote serial target in i960 NINDY-specific protocol",
+       "Use a remote i960 system running NINDY connected by a serial line.\n\
+Specify the name of the device the serial line is connected to.\n\
+The speed (baud rate), whether to use the old NINDY protocol,\n\
+and whether to send a break on startup, are controlled by options\n\
+specified when you started GDB.",
        nindy_open, nindy_close,
        0, nindy_detach, nindy_resume, nindy_wait,
        nindy_fetch_registers, nindy_store_registers,
@@ -940,13 +937,13 @@ struct target_ops nindy_ops = {
        0, 0, /* insert_breakpoint, remove_breakpoint, */
        0, 0, 0, 0, 0,  /* Terminal crud */
        nindy_kill,
-       nindy_load, add_syms_addr_command,
-       call_function_by_hand,
+       nindy_load,
        0, /* lookup_symbol */
        nindy_create_inferior,
        nindy_mourn_inferior,
        process_stratum, 0, /* next */
        1, 1, 1, 1, 1,  /* all mem, mem, stack, regs, exec */
+       0, 0,                   /* Section pointers */
        OPS_MAGIC,              /* Always the last thing */
 };
 
This page took 0.025017 seconds and 4 git commands to generate.