/* 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
*
******************************************************************************/
-#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"
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 ();
if (!name)
error_no_arg ("serial port device name");
+ target_preopen (from_tty);
+
nindy_close (0);
have_regs = regs_changed = 0;
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? */
char fp_as_double[4 * 8];
};
-static int
+static void
nindy_fetch_registers(regno)
int 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,
®isters[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;
{
bcopy (®isters[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,
®isters[REGISTER_BYTE (regnum)], &dub);
/* dub now in host byte order */
/* FIXME-someday, the arguments to unpack_double are backward.
immediate_quit++;
ninRegsPut( (char *) &nindy_regs );
immediate_quit--;
- return 0;
}
/* Read a word from remote address ADDR and return it.
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. */
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 ();
/* 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... */
}
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,
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 */
};