+2002-08-22 Andrew Cagney <cagney@redhat.com>
+
+ * NEWS: Mention that the i960 has been made obsolete.
+ * Makefile.in (SFILES): Delete remote-nrom.c, remote-nindy.c and
+ i960-tdep.c
+ (remote-nrom.o): Obsolete target.
+ (remote-nindy.o, i960-tdep.o): Ditto.
+ * remote-nrom.c: Make file obsolete.
+ * remote-nindy.c, remote-vx960.c: Ditto.
+ * config/i960/vxworks960.mt, config/i960/nindy960.mt: Ditto.
+ * config/i960/mon960.mt, config/i960/tm-i960.h: Ditto.
+ * config/i960/tm-vx960.h, config/i960/tm-nindy960.h: Ditto.
+ * config/i960/tm-mon960.h, i960-tdep.c: Ditto.
+ * configure.tgt: Make i960-*-bout*, i960-nindy-coff*,
+ i960-*-coff*, i960-nindy-elf*, i960-*-elf*, i960-*-nindy* and
+ i960-*-vxworks* obsolete.
+ * MAINTAINERS: Note that the i960 is obsolete.
+
2002-08-21 Corinna Vinschen <vinschen@redhat.com
* aix-thread.c (aix_thread_detach): Disable thread debugging on
i386 --target=i386-elf ,-Werror
Mark Kettenis kettenis@gnu.org
- i960 --target=i960-coff ,-Werror
- Maintenance only
- OBSOLETE candidate, not multi-arch
+ i960 (--target=i960-coff OBSOLETE)
ia64 --target=ia64-linux-gnu ,-Werror
(--target=ia64-elf broken)
memattr.c mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c \
p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c \
macrotab.c macroexp.c macrocmd.c macroscope.c \
- printcmd.c remote.c remote-nrom.c scm-exp.c scm-lang.c \
+ printcmd.c remote.c scm-exp.c scm-lang.c \
scm-valprint.c source.c stabsread.c stack.c symfile.c \
symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \
typeprint.c utils.c valarith.c valops.c valprint.c values.c \
i387-tdep.c \
i386-linux-tdep.c i386-nat.c \
i386gnu-nat.c i386gnu-tdep.c \
- i960-tdep.c \
ia64-linux-nat.c ia64-linux-tdep.c ia64-tdep.c \
infptrace.c inftarg.c irix4-nat.c irix5-nat.c \
lynx-nat.c m3-nat.c \
procfs.c \
remote-array.c remote-e7000.c \
remote-es.c remote-hms.c remote-mips.c \
- remote-nindy.c remote-rdp.c remote-sim.c \
+ remote-rdp.c remote-sim.c \
remote-st.c remote-utils.c dcache.c \
remote-vx.c \
rs6000-nat.c rs6000-tdep.c \
i387-tdep.o: i387-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) $(language_h) $(regcache_h) $(doublest_h) i386-tdep.h
-i960-tdep.o: i960-tdep.c $(defs_h) $(symtab_h) $(value_h) $(frame_h) \
- $(floatformat_h) $(target_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
+# OBSOLETE i960-tdep.o: i960-tdep.c $(defs_h) $(symtab_h) $(value_h) $(frame_h) \
+# OBSOLETE $(floatformat_h) $(target_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(regcache_h)
$(gdbcore_h) $(inferior_h) $(serial_h) $(symfile_h) $(target_h) \
$(regcache_h)
-remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \
- $(defs_h) $(gdbcore_h) $(inferior_h) \
- nindy-share/env.h nindy-share/stop.h $(remote_utils_h) \
- $(symfile_h) $(regcache_h)
+# OBSOLETE remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \
+# OBSOLETE $(defs_h) $(gdbcore_h) $(inferior_h) \
+# OBSOLETE nindy-share/env.h nindy-share/stop.h $(remote_utils_h) \
+# OBSOLETE $(symfile_h) $(regcache_h)
# OBSOLETE remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) \
# OBSOLETE $(command_h) $(monitor_h) $(remote_utils_h) $(symtab_h) $(symfile_h) \
$(gdb_string_h) $(event_loop_h) $(event_top_h) $(remote_h) \
$(inf_loop_h) $(value_h)
-remote-nrom.o: remote-nrom.c $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h)
+# OBSOLETE remote-nrom.o: remote-nrom.c $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \
+# OBSOLETE $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h)
rom68k-rom.o: rom68k-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \
$(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \
HP/Apollo 68k Family m68*-apollo*-sysv*,
m68*-apollo*-bsd*,
m68*-hp-bsd*, m68*-hp-hpux*
+I960 with MON960 i960-*-coff
* OBSOLETE languages
-# Target: Intel 960 rom monitor
-TDEPFILES= i960-tdep.o monitor.o mon960-rom.o ttyflush.o xmodem.o dsrec.o
-TM_FILE= tm-mon960.h
-SIM_OBS = remote-sim.o
-SIM = ../sim/i960/libsim.a
-
+# OBSOLETE # Target: Intel 960 rom monitor
+# OBSOLETE TDEPFILES= i960-tdep.o monitor.o mon960-rom.o ttyflush.o xmodem.o dsrec.o
+# OBSOLETE TM_FILE= tm-mon960.h
+# OBSOLETE SIM_OBS = remote-sim.o
+# OBSOLETE SIM = ../sim/i960/libsim.a
-# Target: Intel 80960, in an embedded system under the NINDY monitor
-TDEPFILES= i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttyflush.o
-TM_FILE= tm-nindy960.h
+# OBSOLETE # Target: Intel 80960, in an embedded system under the NINDY monitor
+# OBSOLETE TDEPFILES= i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttyflush.o
+# OBSOLETE TM_FILE= tm-nindy960.h
-/* Parameters for target machine Intel 960, for GDB, the GNU debugger.
-
- Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free
- Software Foundation, Inc.
-
- Contributed by Intel Corporation.
- 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 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. */
-
-/* Definitions to target GDB to any i960. */
-
-#ifndef I80960
-#define I80960
-#endif
-
-#include "doublest.h"
-
-/* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol
- information. In the i960, parameters can be stored as locals or as
- args, depending on the type of the debug record.
-
- From empirical observation, gcc960 uses N_LSYM to indicate
- arguments passed in registers and then copied immediately
- to the frame, and N_PSYM to indicate arguments passed in a
- g14-relative argument block. */
-
-#define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG)
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance ip across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(ip) (i960_skip_prologue (ip))
-extern CORE_ADDR i960_skip_prologue ();
-
-/* Immediately after a function call, return the saved ip.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function
- executes some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame))
-extern CORE_ADDR saved_pc_after_call ();
-
-/* Stack grows upward */
-
-#define INNER_THAN(lhs,rhs) ((lhs) > (rhs))
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#define REGISTER_SIZE 4
-
-/* Number of machine registers */
-#define NUM_REGS 40
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES { \
- /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
- /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
- /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
- /* 32 */ "pcw", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\
-}
-
-/* Register numbers of various important registers (used to index
- into arrays of register names and register values). */
-
-#define R0_REGNUM 0 /* First local register */
-#define SP_REGNUM 1 /* Contains address of top of stack */
-#define RIP_REGNUM 2 /* Return instruction pointer (local r2) */
-#define R15_REGNUM 15 /* Last local register */
-#define G0_REGNUM 16 /* First global register */
-#define G13_REGNUM 29 /* g13 - holds struct return address */
-#define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */
-#define FP_REGNUM 31 /* Contains address of executing stack frame */
-#define PCW_REGNUM 32 /* process control word */
-#define ACW_REGNUM 33 /* arithmetic control word */
-#define TCW_REGNUM 34 /* trace control word */
-#define IP_REGNUM 35 /* instruction pointer */
-#define FP0_REGNUM 36 /* First floating point register */
-
-/* Some registers have more than one name */
-
-#define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */
-#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES ((36*4) + (4*10))
-
-/* Index within `registers' of the first byte of the space for register N. */
-
-#define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \
- (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) )
-
-/* The i960 has register windows, sort of. */
-
-extern void i960_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval);
-
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
- i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
-
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the i960, all regs are 4 bytes except for floating
- point, which are 10. NINDY only sends us 8 byte values for these,
- which is a pain, but VxWorks handles this correctly, so we must. */
-
-#define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 )
-
-/* Number of bytes of storage in the program's representation for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 )
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 10
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-#include "floatformat.h"
-
-#define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-struct type *i960_register_type (int regnum);
-#define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N)
-\f
-/* Macros for understanding function return values... */
-
-/* Does the specified function use the "struct returning" convention
- or the "value returning" convention? The "value returning" convention
- almost invariably returns the entire value in registers. The
- "struct returning" convention often returns the entire value in
- memory, and passes a pointer (out of or into the function) saying
- where the value (is or should go).
-
- Since this sometimes depends on whether it was compiled with GCC,
- this is also an argument. This is used in call_function to build a
- stack, and in value_being_returned to print return values.
-
- On i960, a structure is returned in registers g0-g3, if it will fit.
- If it's more than 16 bytes long, g13 pointed to it on entry. */
-
-extern use_struct_convention_fn i960_use_struct_convention;
-#define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type)
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. This is only called if USE_STRUCT_CONVENTION for this
- type is 0.
-
- On the i960 we just take as many bytes as we need from G0 through G3. */
-
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_REGNUM), TYPE_LENGTH (TYPE))
-
-/* If USE_STRUCT_CONVENTION produces a 1,
- extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one).
-
- Address of where to put structure was passed in in global
- register g13 on entry. God knows what's in g13 now. The
- (..., 0) below is to make it appear to return a value, though
- actually all it does is call error(). */
-
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (error("Don't know where large structure is returned on i960"), 0)
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format, for "value returning" functions.
-
- For 'return' command: not (yet) implemented for i960. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- error ("Returning values from functions is not implemented in i960 gdb")
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- error ("Returning values from functions is not implemented in i960 gdb")
-\f
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* We cache information about saved registers in the frame structure,
- to save us from having to re-scan function prologues every time
- a register in a non-current frame is accessed. */
-
-#define EXTRA_FRAME_INFO \
- struct frame_saved_regs *fsr; \
- CORE_ADDR arg_pointer;
-
-/* Zero the frame_saved_regs pointer when the frame is initialized,
- so that FRAME_FIND_SAVED_REGS () will know to allocate and
- initialize a frame_saved_regs struct the first time it is called.
- Set the arg_pointer to -1, which is not valid; 0 and other values
- indicate real, cached values. */
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- ((fi)->fsr = 0, (fi)->arg_pointer = -1)
-
-/* On the i960, we get the chain pointer by reading the PFP saved
- on the stack and clearing the status bits. */
-
-#define FRAME_CHAIN(thisframe) \
- (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf)
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type must define FRAME_CHAIN_VALID,
- since it differs between NINDY and VxWorks, the two currently supported
- targets types. We leave it undefined here. */
-
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-
-CORE_ADDR leafproc_return (CORE_ADDR ip);
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (leafproc_return ((FI)->pc) != 0)
-
-/* Note that in the i960 architecture the return pointer is saved in the
- *caller's* stack frame.
-
- Make sure to zero low-order bits because of bug in 960CA A-step part
- (instruction addresses should always be word-aligned anyway). */
-
-#define FRAME_SAVED_PC(frame) \
- ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3)
-
-/* On the i960, FRAME_ARGS_ADDRESS should return the value of
- g14 as passed into the frame, if known. We need a function for this.
- We cache this value in the frame info if we've already looked it up. */
-
-#define FRAME_ARGS_ADDRESS(fi) \
- (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0))
-extern CORE_ADDR frame_args_address (); /* i960-tdep.c */
-
-/* This is the same except it should return 0 when
- it does not really know where the args are, rather than guessing.
- This value is not cached since it is only used infrequently. */
-
-#define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1))
-
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-/* Set NUMARGS to the number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(fi) (-1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Produce the positions of the saved registers in a stack frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
- frame_find_saved_regs (frame_info_addr, &sr)
-extern void frame_find_saved_regs (); /* See i960-tdep.c */
-\f
-/* Things needed for making calls to functions in the inferior process */
-
-/* Push an empty stack frame, to record the current ip, etc.
-
- Not (yet?) implemented for i960. */
-
-#define PUSH_DUMMY_FRAME \
-error("Function calls into the inferior process are not supported on the i960")
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-
-void i960_pop_frame (void);
-#define POP_FRAME \
- i960_pop_frame ()
-
-
-/* This sequence of words is the instructions
-
- callx 0x00000000
- fmark
- */
-
-/* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */
-
- /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
-
-/* Indicate that we don't support calling inferior child functions. */
-
-#undef CALL_DUMMY
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at 'dummyname'.
-
- Ignore arg count on i960. */
-
-/* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */
-
-#undef FIX_CALL_DUMMY
-
-
-/* Interface definitions for kernel debugger KDB */
-/* (Not relevant to i960.) */
+// OBSOLETE /* Parameters for target machine Intel 960, for GDB, the GNU debugger.
+// OBSOLETE
+// OBSOLETE Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free
+// OBSOLETE Software Foundation, Inc.
+// OBSOLETE
+// OBSOLETE Contributed by Intel Corporation.
+// OBSOLETE This file is part of GDB.
+// OBSOLETE
+// OBSOLETE This program is free software; you can redistribute it and/or modify
+// OBSOLETE it under the terms of the GNU General Public License as published by
+// OBSOLETE the Free Software Foundation; either version 2 of the License, or
+// OBSOLETE (at your option) any later version.
+// OBSOLETE
+// OBSOLETE This program is distributed in the hope that it will be useful,
+// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
+// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// OBSOLETE GNU General Public License for more details.
+// OBSOLETE
+// OBSOLETE You should have received a copy of the GNU General Public License
+// OBSOLETE along with this program; if not, write to the Free Software
+// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
+// OBSOLETE Boston, MA 02111-1307, USA. */
+// OBSOLETE
+// OBSOLETE /* Definitions to target GDB to any i960. */
+// OBSOLETE
+// OBSOLETE #ifndef I80960
+// OBSOLETE #define I80960
+// OBSOLETE #endif
+// OBSOLETE
+// OBSOLETE #include "doublest.h"
+// OBSOLETE
+// OBSOLETE /* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol
+// OBSOLETE information. In the i960, parameters can be stored as locals or as
+// OBSOLETE args, depending on the type of the debug record.
+// OBSOLETE
+// OBSOLETE From empirical observation, gcc960 uses N_LSYM to indicate
+// OBSOLETE arguments passed in registers and then copied immediately
+// OBSOLETE to the frame, and N_PSYM to indicate arguments passed in a
+// OBSOLETE g14-relative argument block. */
+// OBSOLETE
+// OBSOLETE #define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG)
+// OBSOLETE
+// OBSOLETE /* Offset from address of function to start of its code.
+// OBSOLETE Zero on most machines. */
+// OBSOLETE
+// OBSOLETE #define FUNCTION_START_OFFSET 0
+// OBSOLETE
+// OBSOLETE /* Advance ip across any function entry prologue instructions
+// OBSOLETE to reach some "real" code. */
+// OBSOLETE
+// OBSOLETE #define SKIP_PROLOGUE(ip) (i960_skip_prologue (ip))
+// OBSOLETE extern CORE_ADDR i960_skip_prologue ();
+// OBSOLETE
+// OBSOLETE /* Immediately after a function call, return the saved ip.
+// OBSOLETE Can't always go through the frames for this because on some machines
+// OBSOLETE the new frame is not set up until the new function
+// OBSOLETE executes some instructions. */
+// OBSOLETE
+// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame))
+// OBSOLETE extern CORE_ADDR saved_pc_after_call ();
+// OBSOLETE
+// OBSOLETE /* Stack grows upward */
+// OBSOLETE
+// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) > (rhs))
+// OBSOLETE
+// OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity
+// OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the
+// OBSOLETE real way to know how big a register is. */
+// OBSOLETE
+// OBSOLETE #define REGISTER_SIZE 4
+// OBSOLETE
+// OBSOLETE /* Number of machine registers */
+// OBSOLETE #define NUM_REGS 40
+// OBSOLETE
+// OBSOLETE /* Initializer for an array of names of registers.
+// OBSOLETE There should be NUM_REGS strings in this initializer. */
+// OBSOLETE
+// OBSOLETE #define REGISTER_NAMES { \
+// OBSOLETE /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
+// OBSOLETE /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
+// OBSOLETE /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
+// OBSOLETE /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
+// OBSOLETE /* 32 */ "pcw", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Register numbers of various important registers (used to index
+// OBSOLETE into arrays of register names and register values). */
+// OBSOLETE
+// OBSOLETE #define R0_REGNUM 0 /* First local register */
+// OBSOLETE #define SP_REGNUM 1 /* Contains address of top of stack */
+// OBSOLETE #define RIP_REGNUM 2 /* Return instruction pointer (local r2) */
+// OBSOLETE #define R15_REGNUM 15 /* Last local register */
+// OBSOLETE #define G0_REGNUM 16 /* First global register */
+// OBSOLETE #define G13_REGNUM 29 /* g13 - holds struct return address */
+// OBSOLETE #define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */
+// OBSOLETE #define FP_REGNUM 31 /* Contains address of executing stack frame */
+// OBSOLETE #define PCW_REGNUM 32 /* process control word */
+// OBSOLETE #define ACW_REGNUM 33 /* arithmetic control word */
+// OBSOLETE #define TCW_REGNUM 34 /* trace control word */
+// OBSOLETE #define IP_REGNUM 35 /* instruction pointer */
+// OBSOLETE #define FP0_REGNUM 36 /* First floating point register */
+// OBSOLETE
+// OBSOLETE /* Some registers have more than one name */
+// OBSOLETE
+// OBSOLETE #define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */
+// OBSOLETE #define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
+// OBSOLETE
+// OBSOLETE /* Total amount of space needed to store our copies of the machine's
+// OBSOLETE register state, the array `registers'. */
+// OBSOLETE #define REGISTER_BYTES ((36*4) + (4*10))
+// OBSOLETE
+// OBSOLETE /* Index within `registers' of the first byte of the space for register N. */
+// OBSOLETE
+// OBSOLETE #define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \
+// OBSOLETE (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) )
+// OBSOLETE
+// OBSOLETE /* The i960 has register windows, sort of. */
+// OBSOLETE
+// OBSOLETE extern void i960_get_saved_register (char *raw_buffer,
+// OBSOLETE int *optimized,
+// OBSOLETE CORE_ADDR *addrp,
+// OBSOLETE struct frame_info *frame,
+// OBSOLETE int regnum,
+// OBSOLETE enum lval_type *lval);
+// OBSOLETE
+// OBSOLETE #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
+// OBSOLETE i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE /* Number of bytes of storage in the actual machine representation
+// OBSOLETE for register N. On the i960, all regs are 4 bytes except for floating
+// OBSOLETE point, which are 10. NINDY only sends us 8 byte values for these,
+// OBSOLETE which is a pain, but VxWorks handles this correctly, so we must. */
+// OBSOLETE
+// OBSOLETE #define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 )
+// OBSOLETE
+// OBSOLETE /* Number of bytes of storage in the program's representation for register N. */
+// OBSOLETE
+// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 )
+// OBSOLETE
+// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */
+// OBSOLETE
+// OBSOLETE #define MAX_REGISTER_RAW_SIZE 10
+// OBSOLETE
+// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */
+// OBSOLETE
+// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8
+// OBSOLETE
+// OBSOLETE #include "floatformat.h"
+// OBSOLETE
+// OBSOLETE #define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext
+// OBSOLETE
+// OBSOLETE /* Return the GDB type object for the "standard" data type
+// OBSOLETE of data in register N. */
+// OBSOLETE
+// OBSOLETE struct type *i960_register_type (int regnum);
+// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N)
+// OBSOLETE \f
+// OBSOLETE /* Macros for understanding function return values... */
+// OBSOLETE
+// OBSOLETE /* Does the specified function use the "struct returning" convention
+// OBSOLETE or the "value returning" convention? The "value returning" convention
+// OBSOLETE almost invariably returns the entire value in registers. The
+// OBSOLETE "struct returning" convention often returns the entire value in
+// OBSOLETE memory, and passes a pointer (out of or into the function) saying
+// OBSOLETE where the value (is or should go).
+// OBSOLETE
+// OBSOLETE Since this sometimes depends on whether it was compiled with GCC,
+// OBSOLETE this is also an argument. This is used in call_function to build a
+// OBSOLETE stack, and in value_being_returned to print return values.
+// OBSOLETE
+// OBSOLETE On i960, a structure is returned in registers g0-g3, if it will fit.
+// OBSOLETE If it's more than 16 bytes long, g13 pointed to it on entry. */
+// OBSOLETE
+// OBSOLETE extern use_struct_convention_fn i960_use_struct_convention;
+// OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type)
+// OBSOLETE
+// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state
+// OBSOLETE a function return value of type TYPE, and copy that, in virtual format,
+// OBSOLETE into VALBUF. This is only called if USE_STRUCT_CONVENTION for this
+// OBSOLETE type is 0.
+// OBSOLETE
+// OBSOLETE On the i960 we just take as many bytes as we need from G0 through G3. */
+// OBSOLETE
+// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+// OBSOLETE memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_REGNUM), TYPE_LENGTH (TYPE))
+// OBSOLETE
+// OBSOLETE /* If USE_STRUCT_CONVENTION produces a 1,
+// OBSOLETE extract from an array REGBUF containing the (raw) register state
+// OBSOLETE the address in which a function should return its structure value,
+// OBSOLETE as a CORE_ADDR (or an expression that can be used as one).
+// OBSOLETE
+// OBSOLETE Address of where to put structure was passed in in global
+// OBSOLETE register g13 on entry. God knows what's in g13 now. The
+// OBSOLETE (..., 0) below is to make it appear to return a value, though
+// OBSOLETE actually all it does is call error(). */
+// OBSOLETE
+// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+// OBSOLETE (error("Don't know where large structure is returned on i960"), 0)
+// OBSOLETE
+// OBSOLETE /* Write into appropriate registers a function return value
+// OBSOLETE of type TYPE, given in virtual format, for "value returning" functions.
+// OBSOLETE
+// OBSOLETE For 'return' command: not (yet) implemented for i960. */
+// OBSOLETE
+// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \
+// OBSOLETE error ("Returning values from functions is not implemented in i960 gdb")
+// OBSOLETE
+// OBSOLETE /* Store the address of the place in which to copy the structure the
+// OBSOLETE subroutine will return. This is called from call_function. */
+// OBSOLETE
+// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \
+// OBSOLETE error ("Returning values from functions is not implemented in i960 gdb")
+// OBSOLETE \f
+// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame
+// OBSOLETE (its caller). */
+// OBSOLETE
+// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address
+// OBSOLETE and produces the frame's chain-pointer.
+// OBSOLETE
+// OBSOLETE However, if FRAME_CHAIN_VALID returns zero,
+// OBSOLETE it means the given frame is the outermost one and has no caller. */
+// OBSOLETE
+// OBSOLETE /* We cache information about saved registers in the frame structure,
+// OBSOLETE to save us from having to re-scan function prologues every time
+// OBSOLETE a register in a non-current frame is accessed. */
+// OBSOLETE
+// OBSOLETE #define EXTRA_FRAME_INFO \
+// OBSOLETE struct frame_saved_regs *fsr; \
+// OBSOLETE CORE_ADDR arg_pointer;
+// OBSOLETE
+// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized,
+// OBSOLETE so that FRAME_FIND_SAVED_REGS () will know to allocate and
+// OBSOLETE initialize a frame_saved_regs struct the first time it is called.
+// OBSOLETE Set the arg_pointer to -1, which is not valid; 0 and other values
+// OBSOLETE indicate real, cached values. */
+// OBSOLETE
+// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
+// OBSOLETE ((fi)->fsr = 0, (fi)->arg_pointer = -1)
+// OBSOLETE
+// OBSOLETE /* On the i960, we get the chain pointer by reading the PFP saved
+// OBSOLETE on the stack and clearing the status bits. */
+// OBSOLETE
+// OBSOLETE #define FRAME_CHAIN(thisframe) \
+// OBSOLETE (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf)
+// OBSOLETE
+// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
+// OBSOLETE and has no caller.
+// OBSOLETE
+// OBSOLETE On the i960, each various target system type must define FRAME_CHAIN_VALID,
+// OBSOLETE since it differs between NINDY and VxWorks, the two currently supported
+// OBSOLETE targets types. We leave it undefined here. */
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE /* A macro that tells us whether the function invocation represented
+// OBSOLETE by FI does not have a frame on the stack associated with it. If it
+// OBSOLETE does not, FRAMELESS is set to 1, else 0. */
+// OBSOLETE
+// OBSOLETE CORE_ADDR leafproc_return (CORE_ADDR ip);
+// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \
+// OBSOLETE (leafproc_return ((FI)->pc) != 0)
+// OBSOLETE
+// OBSOLETE /* Note that in the i960 architecture the return pointer is saved in the
+// OBSOLETE *caller's* stack frame.
+// OBSOLETE
+// OBSOLETE Make sure to zero low-order bits because of bug in 960CA A-step part
+// OBSOLETE (instruction addresses should always be word-aligned anyway). */
+// OBSOLETE
+// OBSOLETE #define FRAME_SAVED_PC(frame) \
+// OBSOLETE ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3)
+// OBSOLETE
+// OBSOLETE /* On the i960, FRAME_ARGS_ADDRESS should return the value of
+// OBSOLETE g14 as passed into the frame, if known. We need a function for this.
+// OBSOLETE We cache this value in the frame info if we've already looked it up. */
+// OBSOLETE
+// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \
+// OBSOLETE (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0))
+// OBSOLETE extern CORE_ADDR frame_args_address (); /* i960-tdep.c */
+// OBSOLETE
+// OBSOLETE /* This is the same except it should return 0 when
+// OBSOLETE it does not really know where the args are, rather than guessing.
+// OBSOLETE This value is not cached since it is only used infrequently. */
+// OBSOLETE
+// OBSOLETE #define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1))
+// OBSOLETE
+// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
+// OBSOLETE
+// OBSOLETE /* Set NUMARGS to the number of args passed to a frame.
+// OBSOLETE Can return -1, meaning no way to tell. */
+// OBSOLETE
+// OBSOLETE #define FRAME_NUM_ARGS(fi) (-1)
+// OBSOLETE
+// OBSOLETE /* Return number of bytes at start of arglist that are not really args. */
+// OBSOLETE
+// OBSOLETE #define FRAME_ARGS_SKIP 0
+// OBSOLETE
+// OBSOLETE /* Produce the positions of the saved registers in a stack frame. */
+// OBSOLETE
+// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
+// OBSOLETE frame_find_saved_regs (frame_info_addr, &sr)
+// OBSOLETE extern void frame_find_saved_regs (); /* See i960-tdep.c */
+// OBSOLETE \f
+// OBSOLETE /* Things needed for making calls to functions in the inferior process */
+// OBSOLETE
+// OBSOLETE /* Push an empty stack frame, to record the current ip, etc.
+// OBSOLETE
+// OBSOLETE Not (yet?) implemented for i960. */
+// OBSOLETE
+// OBSOLETE #define PUSH_DUMMY_FRAME \
+// OBSOLETE error("Function calls into the inferior process are not supported on the i960")
+// OBSOLETE
+// OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. */
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE void i960_pop_frame (void);
+// OBSOLETE #define POP_FRAME \
+// OBSOLETE i960_pop_frame ()
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE /* This sequence of words is the instructions
+// OBSOLETE
+// OBSOLETE callx 0x00000000
+// OBSOLETE fmark
+// OBSOLETE */
+// OBSOLETE
+// OBSOLETE /* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */
+// OBSOLETE
+// OBSOLETE /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
+// OBSOLETE
+// OBSOLETE /* Indicate that we don't support calling inferior child functions. */
+// OBSOLETE
+// OBSOLETE #undef CALL_DUMMY
+// OBSOLETE
+// OBSOLETE /* Insert the specified number of args and function address
+// OBSOLETE into a call sequence of the above form stored at 'dummyname'.
+// OBSOLETE
+// OBSOLETE Ignore arg count on i960. */
+// OBSOLETE
+// OBSOLETE /* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */
+// OBSOLETE
+// OBSOLETE #undef FIX_CALL_DUMMY
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE /* Interface definitions for kernel debugger KDB */
+// OBSOLETE /* (Not relevant to i960.) */
-/* Parameters for Intel 960 running MON960 monitor, for GDB, the GNU debugger.
- Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc.
- Contributed by Intel Corporation and Cygnus Support.
-
- 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 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. */
-
-/*****************************************************************************
- * Definitions to target GDB to an i960 debugged over a serial line.
- ******************************************************************************/
-
-#include "i960/tm-i960.h"
-
-/* forward declarations */
-struct frame_info;
-
-/* redefined from tm-i960.h */
-/* Number of machine registers */
-#undef NUM_REGS
-#define NUM_REGS 40
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-#undef REGISTER_NAMES
-#define REGISTER_NAMES { \
- /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
- /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
- /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
- /* 32 */ "pc", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\
-}
-
-/* Override the standard gdb prompt when compiled for this target. */
-
-#define DEFAULT_PROMPT "(gdb960) "
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type defines FRAME_CHAIN_VALID,
- since it differs between Nindy, Mon960 and VxWorks, the currently supported
- target types. */
-
-extern int mon960_frame_chain_valid (CORE_ADDR, struct frame_info *);
-#define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe)
-
-/* Sequence of bytes for breakpoint instruction */
-
-#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
-
-/* Amount ip must be decremented by after a breakpoint.
- * This is often the number of bytes in BREAKPOINT but not always.
- */
-
-#define DECR_PC_AFTER_BREAK 4
+// OBSOLETE /* Parameters for Intel 960 running MON960 monitor, for GDB, the GNU debugger.
+// OBSOLETE Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc.
+// OBSOLETE Contributed by Intel Corporation and Cygnus Support.
+// OBSOLETE
+// OBSOLETE This file is part of GDB.
+// OBSOLETE
+// OBSOLETE This program is free software; you can redistribute it and/or modify
+// OBSOLETE it under the terms of the GNU General Public License as published by
+// OBSOLETE the Free Software Foundation; either version 2 of the License, or
+// OBSOLETE (at your option) any later version.
+// OBSOLETE
+// OBSOLETE This program is distributed in the hope that it will be useful,
+// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
+// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// OBSOLETE GNU General Public License for more details.
+// OBSOLETE
+// OBSOLETE You should have received a copy of the GNU General Public License
+// OBSOLETE along with this program; if not, write to the Free Software
+// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
+// OBSOLETE Boston, MA 02111-1307, USA. */
+// OBSOLETE
+// OBSOLETE /*****************************************************************************
+// OBSOLETE * Definitions to target GDB to an i960 debugged over a serial line.
+// OBSOLETE ******************************************************************************/
+// OBSOLETE
+// OBSOLETE #include "i960/tm-i960.h"
+// OBSOLETE
+// OBSOLETE /* forward declarations */
+// OBSOLETE struct frame_info;
+// OBSOLETE
+// OBSOLETE /* redefined from tm-i960.h */
+// OBSOLETE /* Number of machine registers */
+// OBSOLETE #undef NUM_REGS
+// OBSOLETE #define NUM_REGS 40
+// OBSOLETE
+// OBSOLETE /* Initializer for an array of names of registers.
+// OBSOLETE There should be NUM_REGS strings in this initializer. */
+// OBSOLETE #undef REGISTER_NAMES
+// OBSOLETE #define REGISTER_NAMES { \
+// OBSOLETE /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
+// OBSOLETE /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
+// OBSOLETE /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
+// OBSOLETE /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
+// OBSOLETE /* 32 */ "pc", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Override the standard gdb prompt when compiled for this target. */
+// OBSOLETE
+// OBSOLETE #define DEFAULT_PROMPT "(gdb960) "
+// OBSOLETE
+// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
+// OBSOLETE and has no caller.
+// OBSOLETE
+// OBSOLETE On the i960, each various target system type defines FRAME_CHAIN_VALID,
+// OBSOLETE since it differs between Nindy, Mon960 and VxWorks, the currently supported
+// OBSOLETE target types. */
+// OBSOLETE
+// OBSOLETE extern int mon960_frame_chain_valid (CORE_ADDR, struct frame_info *);
+// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe)
+// OBSOLETE
+// OBSOLETE /* Sequence of bytes for breakpoint instruction */
+// OBSOLETE
+// OBSOLETE #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
+// OBSOLETE
+// OBSOLETE /* Amount ip must be decremented by after a breakpoint.
+// OBSOLETE * This is often the number of bytes in BREAKPOINT but not always.
+// OBSOLETE */
+// OBSOLETE
+// OBSOLETE #define DECR_PC_AFTER_BREAK 4
-/* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger.
- Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc.
- Contributed by Intel Corporation and Cygnus Support.
-
- 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 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. */
-
-/*****************************************************************************
- * Definitions to target GDB to an i960 debugged over a serial line.
- ******************************************************************************/
-
-#include "i960/tm-i960.h"
-
-/* forward declarations */
-struct frame_info;
-
-/* Override the standard gdb prompt when compiled for this target. */
-
-#define DEFAULT_PROMPT "(gdb960) "
-
-/* Additional command line options accepted by nindy gdb's, for handling
- the remote-nindy.c interface. These should really be target-specific
- rather than architecture-specific. */
-
-extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */
-extern int nindy_initial_brk; /* Send a BREAK to reset board first */
-extern char *nindy_ttyname; /* Name of serial port to talk to nindy */
-
-#define ADDITIONAL_OPTIONS \
- {"O", no_argument, &nindy_old_protocol, 1}, \
- {"brk", no_argument, &nindy_initial_brk, 1}, \
- {"ser", required_argument, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */
-
-#define ADDITIONAL_OPTION_CASES \
- case 1004: /* -ser option: remote nindy auto-start */ \
- nindy_ttyname = optarg; \
- break;
-
-#define ADDITIONAL_OPTION_HELP \
- "\
- -O Use old protocol to talk to a Nindy target\n\
- -brk Send a break to a Nindy target to reset it.\n\
- -ser SERIAL Open remote Nindy session to SERIAL port.\n\
-"
-
-/* If specified on the command line, open tty for talking to nindy,
- and download the executable file if one was specified. */
-
-extern void nindy_open (char *name, int from_tty);
-#define ADDITIONAL_OPTION_HANDLER \
- if (nindy_ttyname != NULL) \
- { \
- if (catch_command_errors (nindy_open, nindy_ttyname, \
- !batch, RETURN_MASK_ALL)) \
- { \
- if (execarg != NULL) \
- catch_command_errors (target_load, execarg, !batch, \
- RETURN_MASK_ALL); \
- } \
- }
-
-/* If configured for i960 target, we take control before main loop
- and demand that we configure for a nindy target. */
-
-#define BEFORE_MAIN_LOOP_HOOK \
- nindy_before_main_loop();
-
-extern void
- nindy_before_main_loop (); /* In remote-nindy.c */
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type defines FRAME_CHAIN_VALID,
- since it differs between NINDY and VxWorks, the two currently supported
- targets types. */
-
-extern int nindy_frame_chain_valid (CORE_ADDR, struct frame_info *);
-#define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe)
-
-extern int
- nindy_frame_chain_valid (); /* See nindy-tdep.c */
-
-/* Sequence of bytes for breakpoint instruction */
-
-#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
-
-/* Amount ip must be decremented by after a breakpoint.
- * This is often the number of bytes in BREAKPOINT but not always.
- */
-
-#define DECR_PC_AFTER_BREAK 0
+// OBSOLETE /* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger.
+// OBSOLETE Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc.
+// OBSOLETE Contributed by Intel Corporation and Cygnus Support.
+// OBSOLETE
+// OBSOLETE This file is part of GDB.
+// OBSOLETE
+// OBSOLETE This program is free software; you can redistribute it and/or modify
+// OBSOLETE it under the terms of the GNU General Public License as published by
+// OBSOLETE the Free Software Foundation; either version 2 of the License, or
+// OBSOLETE (at your option) any later version.
+// OBSOLETE
+// OBSOLETE This program is distributed in the hope that it will be useful,
+// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
+// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// OBSOLETE GNU General Public License for more details.
+// OBSOLETE
+// OBSOLETE You should have received a copy of the GNU General Public License
+// OBSOLETE along with this program; if not, write to the Free Software
+// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
+// OBSOLETE Boston, MA 02111-1307, USA. */
+// OBSOLETE
+// OBSOLETE /*****************************************************************************
+// OBSOLETE * Definitions to target GDB to an i960 debugged over a serial line.
+// OBSOLETE ******************************************************************************/
+// OBSOLETE
+// OBSOLETE #include "i960/tm-i960.h"
+// OBSOLETE
+// OBSOLETE /* forward declarations */
+// OBSOLETE struct frame_info;
+// OBSOLETE
+// OBSOLETE /* Override the standard gdb prompt when compiled for this target. */
+// OBSOLETE
+// OBSOLETE #define DEFAULT_PROMPT "(gdb960) "
+// OBSOLETE
+// OBSOLETE /* Additional command line options accepted by nindy gdb's, for handling
+// OBSOLETE the remote-nindy.c interface. These should really be target-specific
+// OBSOLETE rather than architecture-specific. */
+// OBSOLETE
+// OBSOLETE extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */
+// OBSOLETE extern int nindy_initial_brk; /* Send a BREAK to reset board first */
+// OBSOLETE extern char *nindy_ttyname; /* Name of serial port to talk to nindy */
+// OBSOLETE
+// OBSOLETE #define ADDITIONAL_OPTIONS \
+// OBSOLETE {"O", no_argument, &nindy_old_protocol, 1}, \
+// OBSOLETE {"brk", no_argument, &nindy_initial_brk, 1}, \
+// OBSOLETE {"ser", required_argument, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */
+// OBSOLETE
+// OBSOLETE #define ADDITIONAL_OPTION_CASES \
+// OBSOLETE case 1004: /* -ser option: remote nindy auto-start */ \
+// OBSOLETE nindy_ttyname = optarg; \
+// OBSOLETE break;
+// OBSOLETE
+// OBSOLETE #define ADDITIONAL_OPTION_HELP \
+// OBSOLETE "\
+// OBSOLETE -O Use old protocol to talk to a Nindy target\n\
+// OBSOLETE -brk Send a break to a Nindy target to reset it.\n\
+// OBSOLETE -ser SERIAL Open remote Nindy session to SERIAL port.\n\
+// OBSOLETE "
+// OBSOLETE
+// OBSOLETE /* If specified on the command line, open tty for talking to nindy,
+// OBSOLETE and download the executable file if one was specified. */
+// OBSOLETE
+// OBSOLETE extern void nindy_open (char *name, int from_tty);
+// OBSOLETE #define ADDITIONAL_OPTION_HANDLER \
+// OBSOLETE if (nindy_ttyname != NULL) \
+// OBSOLETE { \
+// OBSOLETE if (catch_command_errors (nindy_open, nindy_ttyname, \
+// OBSOLETE !batch, RETURN_MASK_ALL)) \
+// OBSOLETE { \
+// OBSOLETE if (execarg != NULL) \
+// OBSOLETE catch_command_errors (target_load, execarg, !batch, \
+// OBSOLETE RETURN_MASK_ALL); \
+// OBSOLETE } \
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* If configured for i960 target, we take control before main loop
+// OBSOLETE and demand that we configure for a nindy target. */
+// OBSOLETE
+// OBSOLETE #define BEFORE_MAIN_LOOP_HOOK \
+// OBSOLETE nindy_before_main_loop();
+// OBSOLETE
+// OBSOLETE extern void
+// OBSOLETE nindy_before_main_loop (); /* In remote-nindy.c */
+// OBSOLETE
+// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
+// OBSOLETE and has no caller.
+// OBSOLETE
+// OBSOLETE On the i960, each various target system type defines FRAME_CHAIN_VALID,
+// OBSOLETE since it differs between NINDY and VxWorks, the two currently supported
+// OBSOLETE targets types. */
+// OBSOLETE
+// OBSOLETE extern int nindy_frame_chain_valid (CORE_ADDR, struct frame_info *);
+// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe)
+// OBSOLETE
+// OBSOLETE extern int
+// OBSOLETE nindy_frame_chain_valid (); /* See nindy-tdep.c */
+// OBSOLETE
+// OBSOLETE /* Sequence of bytes for breakpoint instruction */
+// OBSOLETE
+// OBSOLETE #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
+// OBSOLETE
+// OBSOLETE /* Amount ip must be decremented by after a breakpoint.
+// OBSOLETE * This is often the number of bytes in BREAKPOINT but not always.
+// OBSOLETE */
+// OBSOLETE
+// OBSOLETE #define DECR_PC_AFTER_BREAK 0
-/* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998, 1999
- Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
- 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 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. */
-
-#include "i960/tm-i960.h"
-#include "config/tm-vxworks.h"
-
-/* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has
- the real value. */
-#undef PC_REGNUM
-#define PC_REGNUM RIP_REGNUM
-
-/* We have more complex, useful breakpoints on the target.
- Amount ip must be decremented by after a breakpoint. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
-
-/* Breakpoint patching is handled at the target end in VxWorks. */
-/* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */
-
-/* Number of registers in a ptrace_getregs call. */
-
-#define VX_NUM_REGS (16 + 16 + 3)
-
-/* Number of registers in a ptrace_getfpregs call. */
-
- /* @@ Can't use this -- the rdb library for the 960 target
- doesn't support setting or retrieving FP regs. KR */
-
-/* #define VX_SIZE_FPREGS (REGISTER_RAW_SIZE (FP0_REGNUM) * 4) */
+// OBSOLETE /* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger.
+// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998, 1999
+// OBSOLETE Free Software Foundation, Inc.
+// OBSOLETE Contributed by Cygnus Support.
+// OBSOLETE
+// OBSOLETE This file is part of GDB.
+// OBSOLETE
+// OBSOLETE This program is free software; you can redistribute it and/or modify
+// OBSOLETE it under the terms of the GNU General Public License as published by
+// OBSOLETE the Free Software Foundation; either version 2 of the License, or
+// OBSOLETE (at your option) any later version.
+// OBSOLETE
+// OBSOLETE This program is distributed in the hope that it will be useful,
+// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
+// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// OBSOLETE GNU General Public License for more details.
+// OBSOLETE
+// OBSOLETE You should have received a copy of the GNU General Public License
+// OBSOLETE along with this program; if not, write to the Free Software
+// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
+// OBSOLETE Boston, MA 02111-1307, USA. */
+// OBSOLETE
+// OBSOLETE #include "i960/tm-i960.h"
+// OBSOLETE #include "config/tm-vxworks.h"
+// OBSOLETE
+// OBSOLETE /* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has
+// OBSOLETE the real value. */
+// OBSOLETE #undef PC_REGNUM
+// OBSOLETE #define PC_REGNUM RIP_REGNUM
+// OBSOLETE
+// OBSOLETE /* We have more complex, useful breakpoints on the target.
+// OBSOLETE Amount ip must be decremented by after a breakpoint. */
+// OBSOLETE
+// OBSOLETE #define DECR_PC_AFTER_BREAK 0
+// OBSOLETE
+// OBSOLETE /* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
+// OBSOLETE
+// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
+// OBSOLETE
+// OBSOLETE /* Breakpoint patching is handled at the target end in VxWorks. */
+// OBSOLETE /* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */
+// OBSOLETE
+// OBSOLETE /* Number of registers in a ptrace_getregs call. */
+// OBSOLETE
+// OBSOLETE #define VX_NUM_REGS (16 + 16 + 3)
+// OBSOLETE
+// OBSOLETE /* Number of registers in a ptrace_getfpregs call. */
+// OBSOLETE
+// OBSOLETE /* @@ Can't use this -- the rdb library for the 960 target
+// OBSOLETE doesn't support setting or retrieving FP regs. KR */
+// OBSOLETE
+// OBSOLETE /* #define VX_SIZE_FPREGS (REGISTER_RAW_SIZE (FP0_REGNUM) * 4) */
-# Target: VxWorks running on an Intel 960
-TDEPFILES= i960-tdep.o remote-vx.o remote-vx960.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
-TM_FILE= tm-vx960.h
-
-# Define this for the vx-share routines, which don't see param.h.
-MT_CFLAGS= -DI80960
+# OBSOLETE # Target: VxWorks running on an Intel 960
+# OBSOLETE TDEPFILES= i960-tdep.o remote-vx.o remote-vx960.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
+# OBSOLETE TM_FILE= tm-vx960.h
+# OBSOLETE
+# OBSOLETE # Define this for the vx-share routines, which don't see param.h.
+# OBSOLETE MT_CFLAGS= -DI80960
i[3456]86-*-vxworks*) gdb_target=vxworks ;;
i[3456]86-*-*) gdb_target=embed ;;
-i960-*-bout*) gdb_target=vxworks960 ;;
-i960-nindy-coff*) gdb_target=nindy960 ;;
-i960-*-coff*) gdb_target=mon960 ;;
-i960-nindy-elf*) gdb_target=nindy960 ;;
-i960-*-elf*) gdb_target=mon960 ;;
-i960-*-nindy*) gdb_target=nindy960 ;;
-i960-*-vxworks*) gdb_target=vxworks960 ;;
+# OBSOLETE i960-*-bout*) gdb_target=vxworks960 ;;
+# OBSOLETE i960-nindy-coff*) gdb_target=nindy960 ;;
+# OBSOLETE i960-*-coff*) gdb_target=mon960 ;;
+# OBSOLETE i960-nindy-elf*) gdb_target=nindy960 ;;
+# OBSOLETE i960-*-elf*) gdb_target=mon960 ;;
+# OBSOLETE i960-*-nindy*) gdb_target=nindy960 ;;
+# OBSOLETE i960-*-vxworks*) gdb_target=vxworks960 ;;
ia64-*-aix*) gdb_target=aix ;;
ia64-*-linux*) gdb_target=linux
-/* Target-machine dependent code for the Intel 960
-
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2001, 2002 Free Software Foundation, Inc.
-
- Contributed by Intel Corporation.
- examine_prologue and other parts contributed by Wind River Systems.
-
- 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 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. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "value.h"
-#include "frame.h"
-#include "floatformat.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "gdb_string.h"
-
-static CORE_ADDR next_insn (CORE_ADDR memaddr,
- unsigned int *pword1, unsigned int *pword2);
-
-struct type *
-i960_register_type (int regnum)
-{
- if (regnum < FP0_REGNUM)
- return builtin_type_int32;
- else
- return builtin_type_i960_ext;
-}
-
-
-/* Does the specified function use the "struct returning" convention
- or the "value returning" convention? The "value returning" convention
- almost invariably returns the entire value in registers. The
- "struct returning" convention often returns the entire value in
- memory, and passes a pointer (out of or into the function) saying
- where the value (is or should go).
-
- Since this sometimes depends on whether it was compiled with GCC,
- this is also an argument. This is used in call_function to build a
- stack, and in value_being_returned to print return values.
-
- On i960, a structure is returned in registers g0-g3, if it will fit.
- If it's more than 16 bytes long, g13 pointed to it on entry. */
-
-int
-i960_use_struct_convention (int gcc_p, struct type *type)
-{
- return (TYPE_LENGTH (type) > 16);
-}
-
-/* gdb960 is always running on a non-960 host. Check its characteristics.
- This routine must be called as part of gdb initialization. */
-
-static void
-check_host (void)
-{
- int i;
-
- static struct typestruct
- {
- int hostsize; /* Size of type on host */
- int i960size; /* Size of type on i960 */
- char *typename; /* Name of type, for error msg */
- }
- types[] =
- {
- {
- sizeof (short), 2, "short"
- }
- ,
- {
- sizeof (int), 4, "int"
- }
- ,
- {
- sizeof (long), 4, "long"
- }
- ,
- {
- sizeof (float), 4, "float"
- }
- ,
- {
- sizeof (double), 8, "double"
- }
- ,
- {
- sizeof (char *), 4, "pointer"
- }
- ,
- };
-#define TYPELEN (sizeof(types) / sizeof(struct typestruct))
-
- /* Make sure that host type sizes are same as i960
- */
- for (i = 0; i < TYPELEN; i++)
- {
- if (types[i].hostsize != types[i].i960size)
- {
- printf_unfiltered ("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n",
- types[i].typename, types[i].i960size);
- }
-
- }
-}
-\f
-/* Is this register part of the register window system? A yes answer
- implies that 1) The name of this register will not be the same in
- other frames, and 2) This register is automatically "saved" upon
- subroutine calls and thus there is no need to search more than one
- stack frame for it.
-
- On the i960, in fact, the name of this register in another frame is
- "mud" -- there is no overlap between the windows. Each window is
- simply saved into the stack (true for our purposes, after having been
- flushed; normally they reside on-chip and are restored from on-chip
- without ever going to memory). */
-
-static int
-register_in_window_p (int regnum)
-{
- return regnum <= R15_REGNUM;
-}
-
-/* i960_find_saved_register ()
-
- Return the address in which frame FRAME's value of register REGNUM
- has been saved in memory. Or return zero if it has not been saved.
- If REGNUM specifies the SP, the value we return is actually the SP
- value, not an address where it was saved. */
-
-static CORE_ADDR
-i960_find_saved_register (struct frame_info *frame, int regnum)
-{
- register struct frame_info *frame1 = NULL;
- register CORE_ADDR addr = 0;
-
- if (frame == NULL) /* No regs saved if want current frame */
- return 0;
-
- /* We assume that a register in a register window will only be saved
- in one place (since the name changes and/or disappears as you go
- towards inner frames), so we only call get_frame_saved_regs on
- the current frame. This is directly in contradiction to the
- usage below, which assumes that registers used in a frame must be
- saved in a lower (more interior) frame. This change is a result
- of working on a register window machine; get_frame_saved_regs
- always returns the registers saved within a frame, within the
- context (register namespace) of that frame. */
-
- /* However, note that we don't want this to return anything if
- nothing is saved (if there's a frame inside of this one). Also,
- callers to this routine asking for the stack pointer want the
- stack pointer saved for *this* frame; this is returned from the
- next frame. */
-
- if (register_in_window_p (regnum))
- {
- frame1 = get_next_frame (frame);
- if (!frame1)
- return 0; /* Registers of this frame are active. */
-
- /* Get the SP from the next frame in; it will be this
- current frame. */
- if (regnum != SP_REGNUM)
- frame1 = frame;
-
- FRAME_INIT_SAVED_REGS (frame1);
- return frame1->saved_regs[regnum]; /* ... which might be zero */
- }
-
- /* Note that this next routine assumes that registers used in
- frame x will be saved only in the frame that x calls and
- frames interior to it. This is not true on the sparc, but the
- above macro takes care of it, so we should be all right. */
- while (1)
- {
- QUIT;
- frame1 = get_next_frame (frame);
- if (frame1 == 0)
- break;
- frame = frame1;
- FRAME_INIT_SAVED_REGS (frame1);
- if (frame1->saved_regs[regnum])
- addr = frame1->saved_regs[regnum];
- }
-
- return addr;
-}
-
-/* i960_get_saved_register ()
-
- Find register number REGNUM relative to FRAME and put its (raw,
- target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the
- variable was optimized out (and thus can't be fetched). Set *LVAL
- to lval_memory, lval_register, or not_lval, depending on whether
- the value was fetched from memory, from a register, or in a strange
- and non-modifiable way (e.g. a frame pointer which was calculated
- rather than fetched). Set *ADDRP to the address, either in memory
- on as a REGISTER_BYTE offset into the registers array.
-
- Note that this implementation never sets *LVAL to not_lval. But it
- can be replaced by defining GET_SAVED_REGISTER and supplying your
- own.
-
- The argument RAW_BUFFER must point to aligned memory. */
-
-void
-i960_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval)
-{
- CORE_ADDR addr;
-
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = i960_find_saved_register (frame, regnum);
- if (addr != 0)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- /* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- (LONGEST) addr);
- }
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
- else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
-}
-\f
-/* Examine an i960 function prologue, recording the addresses at which
- registers are saved explicitly by the prologue code, and returning
- the address of the first instruction after the prologue (but not
- after the instruction at address LIMIT, as explained below).
-
- LIMIT places an upper bound on addresses of the instructions to be
- examined. If the prologue code scan reaches LIMIT, the scan is
- aborted and LIMIT is returned. This is used, when examining the
- prologue for the current frame, to keep examine_prologue () from
- claiming that a given register has been saved when in fact the
- instruction that saves it has not yet been executed. LIMIT is used
- at other times to stop the scan when we hit code after the true
- function prologue (e.g. for the first source line) which might
- otherwise be mistaken for function prologue.
-
- The format of the function prologue matched by this routine is
- derived from examination of the source to gcc960 1.21, particularly
- the routine i960_function_prologue (). A "regular expression" for
- the function prologue is given below:
-
- (lda LRn, g14
- mov g14, g[0-7]
- (mov 0, g14) | (lda 0, g14))?
-
- (mov[qtl]? g[0-15], r[4-15])*
- ((addo [1-31], sp, sp) | (lda n(sp), sp))?
- (st[qtl]? g[0-15], n(fp))*
-
- (cmpobne 0, g14, LFn
- mov sp, g14
- lda 0x30(sp), sp
- LFn: stq g0, (g14)
- stq g4, 0x10(g14)
- stq g8, 0x20(g14))?
-
- (st g14, n(fp))?
- (mov g13,r[4-15])?
- */
-
-/* Macros for extracting fields from i960 instructions. */
-
-#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
-#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
-
-#define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5)
-#define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5)
-#define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
-#define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
-#define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12)
-
-/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
- is not the address of a valid instruction, the address of the next
- instruction beyond ADDR otherwise. *PWORD1 receives the first word
- of the instruction, and (for two-word instructions), *PWORD2 receives
- the second. */
-
-#define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \
- (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0)
-
-static CORE_ADDR
-examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
- CORE_ADDR frame_addr, struct frame_saved_regs *fsr)
-{
- register CORE_ADDR next_ip;
- register int src, dst;
- register unsigned int *pcode;
- unsigned int insn1, insn2;
- int size;
- int within_leaf_prologue;
- CORE_ADDR save_addr;
- static unsigned int varargs_prologue_code[] =
- {
- 0x3507a00c, /* cmpobne 0x0, g14, LFn */
- 0x5cf01601, /* mov sp, g14 */
- 0x8c086030, /* lda 0x30(sp), sp */
- 0xb2879000, /* LFn: stq g0, (g14) */
- 0xb2a7a010, /* stq g4, 0x10(g14) */
- 0xb2c7a020 /* stq g8, 0x20(g14) */
- };
-
- /* Accept a leaf procedure prologue code fragment if present.
- Note that ip might point to either the leaf or non-leaf
- entry point; we look for the non-leaf entry point first: */
-
- within_leaf_prologue = 0;
- if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2))
- && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */
- || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */
- {
- within_leaf_prologue = 1;
- next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2);
- }
-
- /* Now look for the prologue code at a leaf entry point: */
-
- if (next_ip
- && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
- && REG_SRCDST (insn1) <= G0_REGNUM + 7)
- {
- within_leaf_prologue = 1;
- if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2))
- && (insn1 == 0x8cf00000 /* lda 0, g14 */
- || insn1 == 0x5cf01e00)) /* mov 0, g14 */
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- within_leaf_prologue = 0;
- }
- }
-
- /* If something that looks like the beginning of a leaf prologue
- has been seen, but the remainder of the prologue is missing, bail.
- We don't know what we've got. */
-
- if (within_leaf_prologue)
- return (ip);
-
- /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4.
- This may cause us to mistake the moving of a register
- parameter to a local register for the saving of a callee-saved
- register, but that can't be helped, since with the
- "-fcall-saved" flag, any register can be made callee-saved. */
-
- while (next_ip
- && (insn1 & 0xfc802fb0) == 0x5c000610
- && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
- {
- src = REG_SRC1 (insn1);
- size = EXTRACT_FIELD (insn1, 24, 2) + 1;
- save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
- while (size--)
- {
- fsr->regs[src++] = save_addr;
- save_addr += 4;
- }
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */
-
- if (next_ip &&
- ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */
- || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */
- || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept zero or more instances of "st[qtl]? gx, n(fp)".
- This may cause us to mistake the copying of a register
- parameter to the frame for the saving of a callee-saved
- register, but that can't be helped, since with the
- "-fcall-saved" flag, any register can be made callee-saved.
- We can, however, refuse to accept a save of register g14,
- since that is matched explicitly below. */
-
- while (next_ip &&
- ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */
- || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */
- || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */
- || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */
- && ((src = MEM_SRCDST (insn1)) != G14_REGNUM))
- {
- save_addr = frame_addr + ((insn1 & BITMASK (12, 1))
- ? insn2 : MEMA_OFFSET (insn1));
- size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3)
- : ((insn1 & BITMASK (27, 1)) ? 2 : 1);
- while (size--)
- {
- fsr->regs[src++] = save_addr;
- save_addr += 4;
- }
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept the varargs prologue code if present. */
-
- size = sizeof (varargs_prologue_code) / sizeof (int);
- pcode = varargs_prologue_code;
- while (size-- && next_ip && *pcode++ == insn1)
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "st g14, n(fp)". */
-
- if (next_ip &&
- ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */
- || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */
- {
- fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1))
- ? insn2 : MEMA_OFFSET (insn1));
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept zero or one instance of "mov g13, ry", where y >= 4.
- This is saving the address where a struct should be returned. */
-
- if (next_ip
- && (insn1 & 0xff802fbf) == 0x5c00061d
- && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
- {
- save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
- fsr->regs[G0_REGNUM + 13] = save_addr;
- ip = next_ip;
-#if 0 /* We'll need this once there is a subsequent instruction examined. */
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
-#endif
- }
-
- return (ip);
-}
-
-/* Given an ip value corresponding to the start of a function,
- return the ip of the first instruction after the function
- prologue. */
-
-CORE_ADDR
-i960_skip_prologue (CORE_ADDR ip)
-{
- struct frame_saved_regs saved_regs_dummy;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- sal = find_pc_line (ip, 0);
- limit = (sal.end) ? sal.end : 0xffffffff;
-
- return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy));
-}
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame.
-
- We cache the result of doing this in the frame_obstack, since it is
- fairly expensive. */
-
-void
-frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
-{
- register CORE_ADDR next_addr;
- register CORE_ADDR *saved_regs;
- register int regnum;
- register struct frame_saved_regs *cache_fsr;
- CORE_ADDR ip;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- if (!fi->fsr)
- {
- cache_fsr = (struct frame_saved_regs *)
- frame_obstack_alloc (sizeof (struct frame_saved_regs));
- memset (cache_fsr, '\0', sizeof (struct frame_saved_regs));
- fi->fsr = cache_fsr;
-
- /* Find the start and end of the function prologue. If the PC
- is in the function prologue, we only consider the part that
- has executed already. */
-
- ip = get_pc_function_start (fi->pc);
- sal = find_pc_line (ip, 0);
- limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc;
-
- examine_prologue (ip, limit, fi->frame, cache_fsr);
-
- /* Record the addresses at which the local registers are saved.
- Strictly speaking, we should only do this for non-leaf procedures,
- but no one will ever look at these values if it is a leaf procedure,
- since local registers are always caller-saved. */
-
- next_addr = (CORE_ADDR) fi->frame;
- saved_regs = cache_fsr->regs;
- for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++)
- {
- *saved_regs++ = next_addr;
- next_addr += 4;
- }
-
- cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM];
- }
-
- *fsr = *fi->fsr;
-
- /* Fetch the value of the sp from memory every time, since it
- is conceivable that it has changed since the cache was flushed.
- This unfortunately undoes much of the savings from caching the
- saved register values. I suggest adding an argument to
- get_frame_saved_regs () specifying the register number we're
- interested in (or -1 for all registers). This would be passed
- through to FRAME_FIND_SAVED_REGS (), permitting more efficient
- computation of saved register addresses (e.g., on the i960,
- we don't have to examine the prologue to find local registers).
- -- markf@wrs.com
- FIXME, we don't need to refetch this, since the cache is cleared
- every time the child process is restarted. If GDB itself
- modifies SP, it has to clear the cache by hand (does it?). -gnu */
-
- fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4);
-}
-
-/* Return the address of the argument block for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_args_address (struct frame_info *fi, int must_be_correct)
-{
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- /* If g14 was saved in the frame by the function prologue code, return
- the saved value. If the frame is current and we are being sloppy,
- return the value of g14. Otherwise, return zero. */
-
- get_frame_saved_regs (fi, &fsr);
- if (fsr.regs[G14_REGNUM])
- ap = read_memory_integer (fsr.regs[G14_REGNUM], 4);
- else
- {
- if (must_be_correct)
- return 0; /* Don't cache this result */
- if (get_next_frame (fi))
- ap = 0;
- else
- ap = read_register (G14_REGNUM);
- if (ap == 0)
- ap = fi->frame;
- }
- fi->arg_pointer = ap; /* Cache it for next time */
- return ap;
-}
-
-/* Return the address of the return struct for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_struct_result_address (struct frame_info *fi)
-{
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- /* If the frame is non-current, check to see if g14 was saved in the
- frame by the function prologue code; return the saved value if so,
- zero otherwise. If the frame is current, return the value of g14.
-
- FIXME, shouldn't this use the saved value as long as we are past
- the function prologue, and only use the current value if we have
- no saved value and are at TOS? -- gnu@cygnus.com */
-
- if (get_next_frame (fi))
- {
- get_frame_saved_regs (fi, &fsr);
- if (fsr.regs[G13_REGNUM])
- ap = read_memory_integer (fsr.regs[G13_REGNUM], 4);
- else
- ap = 0;
- }
- else
- ap = read_register (G13_REGNUM);
-
- return ap;
-}
-
-/* Return address to which the currently executing leafproc will return,
- or 0 if IP, the value of the instruction pointer from the currently
- executing function, is not in a leafproc (or if we can't tell if it
- is).
-
- Do this by finding the starting address of the routine in which IP lies.
- If the instruction there is "mov g14, gx" (where x is in [0,7]), this
- is a leafproc and the return address is in register gx. Well, this is
- true unless the return address points at a RET instruction in the current
- procedure, which indicates that we have a 'dual entry' routine that
- has been entered through the CALL entry point. */
-
-CORE_ADDR
-leafproc_return (CORE_ADDR ip)
-{
- register struct minimal_symbol *msymbol;
- char *p;
- int dst;
- unsigned int insn1, insn2;
- CORE_ADDR return_addr;
-
- if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL)
- {
- if ((p = strchr (SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf"))
- {
- if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2)
- && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
- && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7)
- {
- /* Get the return address. If the "mov g14, gx"
- instruction hasn't been executed yet, read
- the return address from g14; otherwise, read it
- from the register into which g14 was moved. */
-
- return_addr =
- read_register ((ip == SYMBOL_VALUE_ADDRESS (msymbol))
- ? G14_REGNUM : dst);
-
- /* We know we are in a leaf procedure, but we don't know
- whether the caller actually did a "bal" to the ".lf"
- entry point, or a normal "call" to the non-leaf entry
- point one instruction before. In the latter case, the
- return address will be the address of a "ret"
- instruction within the procedure itself. We test for
- this below. */
-
- if (!next_insn (return_addr, &insn1, &insn2)
- || (insn1 & 0xff000000) != 0xa000000 /* ret */
- || lookup_minimal_symbol_by_pc (return_addr) != msymbol)
- return (return_addr);
- }
- }
- }
-
- return (0);
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions.
- On the i960, the frame *is* set up immediately after the call,
- unless the function is a leaf procedure. */
-
-CORE_ADDR
-saved_pc_after_call (struct frame_info *frame)
-{
- CORE_ADDR saved_pc;
-
- saved_pc = leafproc_return (get_frame_pc (frame));
- if (!saved_pc)
- saved_pc = FRAME_SAVED_PC (frame);
-
- return saved_pc;
-}
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-void
-i960_pop_frame (void)
-{
- register struct frame_info *current_fi, *prev_fi;
- register int i;
- CORE_ADDR save_addr;
- CORE_ADDR leaf_return_addr;
- struct frame_saved_regs fsr;
- char local_regs_buf[16 * 4];
-
- current_fi = get_current_frame ();
-
- /* First, undo what the hardware does when we return.
- If this is a non-leaf procedure, restore local registers from
- the save area in the calling frame. Otherwise, load the return
- address obtained from leafproc_return () into the rip. */
-
- leaf_return_addr = leafproc_return (current_fi->pc);
- if (!leaf_return_addr)
- {
- /* Non-leaf procedure. Restore local registers, incl IP. */
- prev_fi = get_prev_frame (current_fi);
- read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf));
- write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf,
- sizeof (local_regs_buf));
-
- /* Restore frame pointer. */
- write_register (FP_REGNUM, prev_fi->frame);
- }
- else
- {
- /* Leaf procedure. Just restore the return address into the IP. */
- write_register (RIP_REGNUM, leaf_return_addr);
- }
-
- /* Now restore any global regs that the current function had saved. */
- get_frame_saved_regs (current_fi, &fsr);
- for (i = G0_REGNUM; i < G14_REGNUM; i++)
- {
- save_addr = fsr.regs[i];
- if (save_addr != 0)
- write_register (i, read_memory_integer (save_addr, 4));
- }
-
- /* Flush the frame cache, create a frame for the new innermost frame,
- and make it the current frame. */
-
- flush_cached_frames ();
-}
-
-/* Given a 960 stop code (fault or trace), return the signal which
- corresponds. */
-
-enum target_signal
-i960_fault_to_signal (int fault)
-{
- switch (fault)
- {
- case 0:
- return TARGET_SIGNAL_BUS; /* parallel fault */
- case 1:
- return TARGET_SIGNAL_UNKNOWN;
- case 2:
- return TARGET_SIGNAL_ILL; /* operation fault */
- case 3:
- return TARGET_SIGNAL_FPE; /* arithmetic fault */
- case 4:
- return TARGET_SIGNAL_FPE; /* floating point fault */
-
- /* constraint fault. This appears not to distinguish between
- a range constraint fault (which should be SIGFPE) and a privileged
- fault (which should be SIGILL). */
- case 5:
- return TARGET_SIGNAL_ILL;
-
- case 6:
- return TARGET_SIGNAL_SEGV; /* virtual memory fault */
-
- /* protection fault. This is for an out-of-range argument to
- "calls". I guess it also could be SIGILL. */
- case 7:
- return TARGET_SIGNAL_SEGV;
-
- case 8:
- return TARGET_SIGNAL_BUS; /* machine fault */
- case 9:
- return TARGET_SIGNAL_BUS; /* structural fault */
- case 0xa:
- return TARGET_SIGNAL_ILL; /* type fault */
- case 0xb:
- return TARGET_SIGNAL_UNKNOWN; /* reserved fault */
- case 0xc:
- return TARGET_SIGNAL_BUS; /* process fault */
- case 0xd:
- return TARGET_SIGNAL_SEGV; /* descriptor fault */
- case 0xe:
- return TARGET_SIGNAL_BUS; /* event fault */
- case 0xf:
- return TARGET_SIGNAL_UNKNOWN; /* reserved fault */
- case 0x10:
- return TARGET_SIGNAL_TRAP; /* single-step trace */
- case 0x11:
- return TARGET_SIGNAL_TRAP; /* branch trace */
- case 0x12:
- return TARGET_SIGNAL_TRAP; /* call trace */
- case 0x13:
- return TARGET_SIGNAL_TRAP; /* return trace */
- case 0x14:
- return TARGET_SIGNAL_TRAP; /* pre-return trace */
- case 0x15:
- return TARGET_SIGNAL_TRAP; /* supervisor call trace */
- case 0x16:
- return TARGET_SIGNAL_TRAP; /* breakpoint trace */
- default:
- return TARGET_SIGNAL_UNKNOWN;
- }
-}
-
-/****************************************/
-/* MEM format */
-/****************************************/
-
-struct tabent
-{
- char *name;
- char numops;
-};
-
-/* Return instruction length, either 4 or 8. When NOPRINT is non-zero
- (TRUE), don't output any text. (Actually, as implemented, if NOPRINT
- is 0, abort() is called.) */
-
-static int
-mem (unsigned long memaddr, unsigned long word1, unsigned long word2,
- int noprint)
-{
- int i, j;
- int len;
- int mode;
- int offset;
- const char *reg1, *reg2, *reg3;
-
- /* This lookup table is too sparse to make it worth typing in, but not
- * so large as to make a sparse array necessary. We allocate the
- * table at runtime, initialize all entries to empty, and copy the
- * real ones in from an initialization table.
- *
- * NOTE: In this table, the meaning of 'numops' is:
- * 1: single operand
- * 2: 2 operands, load instruction
- * -2: 2 operands, store instruction
- */
- static struct tabent *mem_tab = NULL;
-/* Opcodes of 0x8X, 9X, aX, bX, and cX must be in the table. */
-#define MEM_MIN 0x80
-#define MEM_MAX 0xcf
-#define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent))
-
- static struct
- {
- int opcode;
- char *name;
- char numops;
- }
- mem_init[] =
- {
- 0x80, "ldob", 2,
- 0x82, "stob", -2,
- 0x84, "bx", 1,
- 0x85, "balx", 2,
- 0x86, "callx", 1,
- 0x88, "ldos", 2,
- 0x8a, "stos", -2,
- 0x8c, "lda", 2,
- 0x90, "ld", 2,
- 0x92, "st", -2,
- 0x98, "ldl", 2,
- 0x9a, "stl", -2,
- 0xa0, "ldt", 2,
- 0xa2, "stt", -2,
- 0xb0, "ldq", 2,
- 0xb2, "stq", -2,
- 0xc0, "ldib", 2,
- 0xc2, "stib", -2,
- 0xc8, "ldis", 2,
- 0xca, "stis", -2,
- 0, NULL, 0
- };
-
- if (mem_tab == NULL)
- {
- mem_tab = (struct tabent *) xmalloc (MEM_SIZ);
- memset (mem_tab, '\0', MEM_SIZ);
- for (i = 0; mem_init[i].opcode != 0; i++)
- {
- j = mem_init[i].opcode - MEM_MIN;
- mem_tab[j].name = mem_init[i].name;
- mem_tab[j].numops = mem_init[i].numops;
- }
- }
-
- i = ((word1 >> 24) & 0xff) - MEM_MIN;
- mode = (word1 >> 10) & 0xf;
-
- if ((mem_tab[i].name != NULL) /* Valid instruction */
- && ((mode == 5) || (mode >= 12)))
- { /* With 32-bit displacement */
- len = 8;
- }
- else
- {
- len = 4;
- }
-
- if (noprint)
- {
- return len;
- }
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
-}
-
-/* Read the i960 instruction at 'memaddr' and return the address of
- the next instruction after that, or 0 if 'memaddr' is not the
- address of a valid instruction. The first word of the instruction
- is stored at 'pword1', and the second word, if any, is stored at
- 'pword2'. */
-
-static CORE_ADDR
-next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2)
-{
- int len;
- char buf[8];
-
- /* Read the two (potential) words of the instruction at once,
- to eliminate the overhead of two calls to read_memory ().
- FIXME: Loses if the first one is readable but the second is not
- (e.g. last word of the segment). */
-
- read_memory (memaddr, buf, 8);
- *pword1 = extract_unsigned_integer (buf, 4);
- *pword2 = extract_unsigned_integer (buf + 4, 4);
-
- /* Divide instruction set into classes based on high 4 bits of opcode */
-
- switch ((*pword1 >> 28) & 0xf)
- {
- case 0x0:
- case 0x1: /* ctrl */
-
- case 0x2:
- case 0x3: /* cobr */
-
- case 0x5:
- case 0x6:
- case 0x7: /* reg */
- len = 4;
- break;
-
- case 0x8:
- case 0x9:
- case 0xa:
- case 0xb:
- case 0xc:
- len = mem (memaddr, *pword1, *pword2, 1);
- break;
-
- default: /* invalid instruction */
- len = 0;
- break;
- }
-
- if (len)
- return memaddr + len;
- else
- return 0;
-}
-
-/* 'start_frame' is a variable in the MON960 runtime startup routine
- that contains the frame pointer of the 'start' routine (the routine
- that calls 'main'). By reading its contents out of remote memory,
- we can tell where the frame chain ends: backtraces should halt before
- they display this frame. */
-
-int
-mon960_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe)
-{
- struct symbol *sym;
- struct minimal_symbol *msymbol;
-
- /* crtmon960.o is an assembler module that is assumed to be linked
- * first in an i80960 executable. It contains the true entry point;
- * it performs startup up initialization and then calls 'main'.
- *
- * 'sf' is the name of a variable in crtmon960.o that is set
- * during startup to the address of the first frame.
- *
- * 'a' is the address of that variable in 80960 memory.
- */
- static char sf[] = "start_frame";
- CORE_ADDR a;
-
-
- chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers
- contain return status info in them. */
- if (chain == 0)
- {
- return 0;
- }
-
- sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL);
- if (sym != 0)
- {
- a = SYMBOL_VALUE (sym);
- }
- else
- {
- msymbol = lookup_minimal_symbol (sf, NULL, NULL);
- if (msymbol == NULL)
- return 0;
- a = SYMBOL_VALUE_ADDRESS (msymbol);
- }
-
- return (chain != read_memory_integer (a, 4));
-}
-
-
-void
-_initialize_i960_tdep (void)
-{
- check_host ();
-
- tm_print_insn = print_insn_i960;
-}
+// OBSOLETE /* Target-machine dependent code for the Intel 960
+// OBSOLETE
+// OBSOLETE Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+// OBSOLETE 2001, 2002 Free Software Foundation, Inc.
+// OBSOLETE
+// OBSOLETE Contributed by Intel Corporation.
+// OBSOLETE examine_prologue and other parts contributed by Wind River Systems.
+// OBSOLETE
+// OBSOLETE This file is part of GDB.
+// OBSOLETE
+// OBSOLETE This program is free software; you can redistribute it and/or modify
+// OBSOLETE it under the terms of the GNU General Public License as published by
+// OBSOLETE the Free Software Foundation; either version 2 of the License, or
+// OBSOLETE (at your option) any later version.
+// OBSOLETE
+// OBSOLETE This program is distributed in the hope that it will be useful,
+// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
+// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// OBSOLETE GNU General Public License for more details.
+// OBSOLETE
+// OBSOLETE You should have received a copy of the GNU General Public License
+// OBSOLETE along with this program; if not, write to the Free Software
+// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
+// OBSOLETE Boston, MA 02111-1307, USA. */
+// OBSOLETE
+// OBSOLETE #include "defs.h"
+// OBSOLETE #include "symtab.h"
+// OBSOLETE #include "value.h"
+// OBSOLETE #include "frame.h"
+// OBSOLETE #include "floatformat.h"
+// OBSOLETE #include "target.h"
+// OBSOLETE #include "gdbcore.h"
+// OBSOLETE #include "inferior.h"
+// OBSOLETE #include "regcache.h"
+// OBSOLETE #include "gdb_string.h"
+// OBSOLETE
+// OBSOLETE static CORE_ADDR next_insn (CORE_ADDR memaddr,
+// OBSOLETE unsigned int *pword1, unsigned int *pword2);
+// OBSOLETE
+// OBSOLETE struct type *
+// OBSOLETE i960_register_type (int regnum)
+// OBSOLETE {
+// OBSOLETE if (regnum < FP0_REGNUM)
+// OBSOLETE return builtin_type_int32;
+// OBSOLETE else
+// OBSOLETE return builtin_type_i960_ext;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE /* Does the specified function use the "struct returning" convention
+// OBSOLETE or the "value returning" convention? The "value returning" convention
+// OBSOLETE almost invariably returns the entire value in registers. The
+// OBSOLETE "struct returning" convention often returns the entire value in
+// OBSOLETE memory, and passes a pointer (out of or into the function) saying
+// OBSOLETE where the value (is or should go).
+// OBSOLETE
+// OBSOLETE Since this sometimes depends on whether it was compiled with GCC,
+// OBSOLETE this is also an argument. This is used in call_function to build a
+// OBSOLETE stack, and in value_being_returned to print return values.
+// OBSOLETE
+// OBSOLETE On i960, a structure is returned in registers g0-g3, if it will fit.
+// OBSOLETE If it's more than 16 bytes long, g13 pointed to it on entry. */
+// OBSOLETE
+// OBSOLETE int
+// OBSOLETE i960_use_struct_convention (int gcc_p, struct type *type)
+// OBSOLETE {
+// OBSOLETE return (TYPE_LENGTH (type) > 16);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* gdb960 is always running on a non-960 host. Check its characteristics.
+// OBSOLETE This routine must be called as part of gdb initialization. */
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE check_host (void)
+// OBSOLETE {
+// OBSOLETE int i;
+// OBSOLETE
+// OBSOLETE static struct typestruct
+// OBSOLETE {
+// OBSOLETE int hostsize; /* Size of type on host */
+// OBSOLETE int i960size; /* Size of type on i960 */
+// OBSOLETE char *typename; /* Name of type, for error msg */
+// OBSOLETE }
+// OBSOLETE types[] =
+// OBSOLETE {
+// OBSOLETE {
+// OBSOLETE sizeof (short), 2, "short"
+// OBSOLETE }
+// OBSOLETE ,
+// OBSOLETE {
+// OBSOLETE sizeof (int), 4, "int"
+// OBSOLETE }
+// OBSOLETE ,
+// OBSOLETE {
+// OBSOLETE sizeof (long), 4, "long"
+// OBSOLETE }
+// OBSOLETE ,
+// OBSOLETE {
+// OBSOLETE sizeof (float), 4, "float"
+// OBSOLETE }
+// OBSOLETE ,
+// OBSOLETE {
+// OBSOLETE sizeof (double), 8, "double"
+// OBSOLETE }
+// OBSOLETE ,
+// OBSOLETE {
+// OBSOLETE sizeof (char *), 4, "pointer"
+// OBSOLETE }
+// OBSOLETE ,
+// OBSOLETE };
+// OBSOLETE #define TYPELEN (sizeof(types) / sizeof(struct typestruct))
+// OBSOLETE
+// OBSOLETE /* Make sure that host type sizes are same as i960
+// OBSOLETE */
+// OBSOLETE for (i = 0; i < TYPELEN; i++)
+// OBSOLETE {
+// OBSOLETE if (types[i].hostsize != types[i].i960size)
+// OBSOLETE {
+// OBSOLETE printf_unfiltered ("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n",
+// OBSOLETE types[i].typename, types[i].i960size);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE /* Is this register part of the register window system? A yes answer
+// OBSOLETE implies that 1) The name of this register will not be the same in
+// OBSOLETE other frames, and 2) This register is automatically "saved" upon
+// OBSOLETE subroutine calls and thus there is no need to search more than one
+// OBSOLETE stack frame for it.
+// OBSOLETE
+// OBSOLETE On the i960, in fact, the name of this register in another frame is
+// OBSOLETE "mud" -- there is no overlap between the windows. Each window is
+// OBSOLETE simply saved into the stack (true for our purposes, after having been
+// OBSOLETE flushed; normally they reside on-chip and are restored from on-chip
+// OBSOLETE without ever going to memory). */
+// OBSOLETE
+// OBSOLETE static int
+// OBSOLETE register_in_window_p (int regnum)
+// OBSOLETE {
+// OBSOLETE return regnum <= R15_REGNUM;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* i960_find_saved_register ()
+// OBSOLETE
+// OBSOLETE Return the address in which frame FRAME's value of register REGNUM
+// OBSOLETE has been saved in memory. Or return zero if it has not been saved.
+// OBSOLETE If REGNUM specifies the SP, the value we return is actually the SP
+// OBSOLETE value, not an address where it was saved. */
+// OBSOLETE
+// OBSOLETE static CORE_ADDR
+// OBSOLETE i960_find_saved_register (struct frame_info *frame, int regnum)
+// OBSOLETE {
+// OBSOLETE register struct frame_info *frame1 = NULL;
+// OBSOLETE register CORE_ADDR addr = 0;
+// OBSOLETE
+// OBSOLETE if (frame == NULL) /* No regs saved if want current frame */
+// OBSOLETE return 0;
+// OBSOLETE
+// OBSOLETE /* We assume that a register in a register window will only be saved
+// OBSOLETE in one place (since the name changes and/or disappears as you go
+// OBSOLETE towards inner frames), so we only call get_frame_saved_regs on
+// OBSOLETE the current frame. This is directly in contradiction to the
+// OBSOLETE usage below, which assumes that registers used in a frame must be
+// OBSOLETE saved in a lower (more interior) frame. This change is a result
+// OBSOLETE of working on a register window machine; get_frame_saved_regs
+// OBSOLETE always returns the registers saved within a frame, within the
+// OBSOLETE context (register namespace) of that frame. */
+// OBSOLETE
+// OBSOLETE /* However, note that we don't want this to return anything if
+// OBSOLETE nothing is saved (if there's a frame inside of this one). Also,
+// OBSOLETE callers to this routine asking for the stack pointer want the
+// OBSOLETE stack pointer saved for *this* frame; this is returned from the
+// OBSOLETE next frame. */
+// OBSOLETE
+// OBSOLETE if (register_in_window_p (regnum))
+// OBSOLETE {
+// OBSOLETE frame1 = get_next_frame (frame);
+// OBSOLETE if (!frame1)
+// OBSOLETE return 0; /* Registers of this frame are active. */
+// OBSOLETE
+// OBSOLETE /* Get the SP from the next frame in; it will be this
+// OBSOLETE current frame. */
+// OBSOLETE if (regnum != SP_REGNUM)
+// OBSOLETE frame1 = frame;
+// OBSOLETE
+// OBSOLETE FRAME_INIT_SAVED_REGS (frame1);
+// OBSOLETE return frame1->saved_regs[regnum]; /* ... which might be zero */
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Note that this next routine assumes that registers used in
+// OBSOLETE frame x will be saved only in the frame that x calls and
+// OBSOLETE frames interior to it. This is not true on the sparc, but the
+// OBSOLETE above macro takes care of it, so we should be all right. */
+// OBSOLETE while (1)
+// OBSOLETE {
+// OBSOLETE QUIT;
+// OBSOLETE frame1 = get_next_frame (frame);
+// OBSOLETE if (frame1 == 0)
+// OBSOLETE break;
+// OBSOLETE frame = frame1;
+// OBSOLETE FRAME_INIT_SAVED_REGS (frame1);
+// OBSOLETE if (frame1->saved_regs[regnum])
+// OBSOLETE addr = frame1->saved_regs[regnum];
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE return addr;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* i960_get_saved_register ()
+// OBSOLETE
+// OBSOLETE Find register number REGNUM relative to FRAME and put its (raw,
+// OBSOLETE target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the
+// OBSOLETE variable was optimized out (and thus can't be fetched). Set *LVAL
+// OBSOLETE to lval_memory, lval_register, or not_lval, depending on whether
+// OBSOLETE the value was fetched from memory, from a register, or in a strange
+// OBSOLETE and non-modifiable way (e.g. a frame pointer which was calculated
+// OBSOLETE rather than fetched). Set *ADDRP to the address, either in memory
+// OBSOLETE on as a REGISTER_BYTE offset into the registers array.
+// OBSOLETE
+// OBSOLETE Note that this implementation never sets *LVAL to not_lval. But it
+// OBSOLETE can be replaced by defining GET_SAVED_REGISTER and supplying your
+// OBSOLETE own.
+// OBSOLETE
+// OBSOLETE The argument RAW_BUFFER must point to aligned memory. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE i960_get_saved_register (char *raw_buffer,
+// OBSOLETE int *optimized,
+// OBSOLETE CORE_ADDR *addrp,
+// OBSOLETE struct frame_info *frame,
+// OBSOLETE int regnum,
+// OBSOLETE enum lval_type *lval)
+// OBSOLETE {
+// OBSOLETE CORE_ADDR addr;
+// OBSOLETE
+// OBSOLETE if (!target_has_registers)
+// OBSOLETE error ("No registers.");
+// OBSOLETE
+// OBSOLETE /* Normal systems don't optimize out things with register numbers. */
+// OBSOLETE if (optimized != NULL)
+// OBSOLETE *optimized = 0;
+// OBSOLETE addr = i960_find_saved_register (frame, regnum);
+// OBSOLETE if (addr != 0)
+// OBSOLETE {
+// OBSOLETE if (lval != NULL)
+// OBSOLETE *lval = lval_memory;
+// OBSOLETE if (regnum == SP_REGNUM)
+// OBSOLETE {
+// OBSOLETE if (raw_buffer != NULL)
+// OBSOLETE {
+// OBSOLETE /* Put it back in target format. */
+// OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+// OBSOLETE (LONGEST) addr);
+// OBSOLETE }
+// OBSOLETE if (addrp != NULL)
+// OBSOLETE *addrp = 0;
+// OBSOLETE return;
+// OBSOLETE }
+// OBSOLETE if (raw_buffer != NULL)
+// OBSOLETE target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE if (lval != NULL)
+// OBSOLETE *lval = lval_register;
+// OBSOLETE addr = REGISTER_BYTE (regnum);
+// OBSOLETE if (raw_buffer != NULL)
+// OBSOLETE read_register_gen (regnum, raw_buffer);
+// OBSOLETE }
+// OBSOLETE if (addrp != NULL)
+// OBSOLETE *addrp = addr;
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE /* Examine an i960 function prologue, recording the addresses at which
+// OBSOLETE registers are saved explicitly by the prologue code, and returning
+// OBSOLETE the address of the first instruction after the prologue (but not
+// OBSOLETE after the instruction at address LIMIT, as explained below).
+// OBSOLETE
+// OBSOLETE LIMIT places an upper bound on addresses of the instructions to be
+// OBSOLETE examined. If the prologue code scan reaches LIMIT, the scan is
+// OBSOLETE aborted and LIMIT is returned. This is used, when examining the
+// OBSOLETE prologue for the current frame, to keep examine_prologue () from
+// OBSOLETE claiming that a given register has been saved when in fact the
+// OBSOLETE instruction that saves it has not yet been executed. LIMIT is used
+// OBSOLETE at other times to stop the scan when we hit code after the true
+// OBSOLETE function prologue (e.g. for the first source line) which might
+// OBSOLETE otherwise be mistaken for function prologue.
+// OBSOLETE
+// OBSOLETE The format of the function prologue matched by this routine is
+// OBSOLETE derived from examination of the source to gcc960 1.21, particularly
+// OBSOLETE the routine i960_function_prologue (). A "regular expression" for
+// OBSOLETE the function prologue is given below:
+// OBSOLETE
+// OBSOLETE (lda LRn, g14
+// OBSOLETE mov g14, g[0-7]
+// OBSOLETE (mov 0, g14) | (lda 0, g14))?
+// OBSOLETE
+// OBSOLETE (mov[qtl]? g[0-15], r[4-15])*
+// OBSOLETE ((addo [1-31], sp, sp) | (lda n(sp), sp))?
+// OBSOLETE (st[qtl]? g[0-15], n(fp))*
+// OBSOLETE
+// OBSOLETE (cmpobne 0, g14, LFn
+// OBSOLETE mov sp, g14
+// OBSOLETE lda 0x30(sp), sp
+// OBSOLETE LFn: stq g0, (g14)
+// OBSOLETE stq g4, 0x10(g14)
+// OBSOLETE stq g8, 0x20(g14))?
+// OBSOLETE
+// OBSOLETE (st g14, n(fp))?
+// OBSOLETE (mov g13,r[4-15])?
+// OBSOLETE */
+// OBSOLETE
+// OBSOLETE /* Macros for extracting fields from i960 instructions. */
+// OBSOLETE
+// OBSOLETE #define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
+// OBSOLETE #define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
+// OBSOLETE
+// OBSOLETE #define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5)
+// OBSOLETE #define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5)
+// OBSOLETE #define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
+// OBSOLETE #define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
+// OBSOLETE #define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12)
+// OBSOLETE
+// OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
+// OBSOLETE is not the address of a valid instruction, the address of the next
+// OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word
+// OBSOLETE of the instruction, and (for two-word instructions), *PWORD2 receives
+// OBSOLETE the second. */
+// OBSOLETE
+// OBSOLETE #define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \
+// OBSOLETE (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0)
+// OBSOLETE
+// OBSOLETE static CORE_ADDR
+// OBSOLETE examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
+// OBSOLETE CORE_ADDR frame_addr, struct frame_saved_regs *fsr)
+// OBSOLETE {
+// OBSOLETE register CORE_ADDR next_ip;
+// OBSOLETE register int src, dst;
+// OBSOLETE register unsigned int *pcode;
+// OBSOLETE unsigned int insn1, insn2;
+// OBSOLETE int size;
+// OBSOLETE int within_leaf_prologue;
+// OBSOLETE CORE_ADDR save_addr;
+// OBSOLETE static unsigned int varargs_prologue_code[] =
+// OBSOLETE {
+// OBSOLETE 0x3507a00c, /* cmpobne 0x0, g14, LFn */
+// OBSOLETE 0x5cf01601, /* mov sp, g14 */
+// OBSOLETE 0x8c086030, /* lda 0x30(sp), sp */
+// OBSOLETE 0xb2879000, /* LFn: stq g0, (g14) */
+// OBSOLETE 0xb2a7a010, /* stq g4, 0x10(g14) */
+// OBSOLETE 0xb2c7a020 /* stq g8, 0x20(g14) */
+// OBSOLETE };
+// OBSOLETE
+// OBSOLETE /* Accept a leaf procedure prologue code fragment if present.
+// OBSOLETE Note that ip might point to either the leaf or non-leaf
+// OBSOLETE entry point; we look for the non-leaf entry point first: */
+// OBSOLETE
+// OBSOLETE within_leaf_prologue = 0;
+// OBSOLETE if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2))
+// OBSOLETE && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */
+// OBSOLETE || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */
+// OBSOLETE {
+// OBSOLETE within_leaf_prologue = 1;
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Now look for the prologue code at a leaf entry point: */
+// OBSOLETE
+// OBSOLETE if (next_ip
+// OBSOLETE && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
+// OBSOLETE && REG_SRCDST (insn1) <= G0_REGNUM + 7)
+// OBSOLETE {
+// OBSOLETE within_leaf_prologue = 1;
+// OBSOLETE if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2))
+// OBSOLETE && (insn1 == 0x8cf00000 /* lda 0, g14 */
+// OBSOLETE || insn1 == 0x5cf01e00)) /* mov 0, g14 */
+// OBSOLETE {
+// OBSOLETE ip = next_ip;
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+// OBSOLETE within_leaf_prologue = 0;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* If something that looks like the beginning of a leaf prologue
+// OBSOLETE has been seen, but the remainder of the prologue is missing, bail.
+// OBSOLETE We don't know what we've got. */
+// OBSOLETE
+// OBSOLETE if (within_leaf_prologue)
+// OBSOLETE return (ip);
+// OBSOLETE
+// OBSOLETE /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4.
+// OBSOLETE This may cause us to mistake the moving of a register
+// OBSOLETE parameter to a local register for the saving of a callee-saved
+// OBSOLETE register, but that can't be helped, since with the
+// OBSOLETE "-fcall-saved" flag, any register can be made callee-saved. */
+// OBSOLETE
+// OBSOLETE while (next_ip
+// OBSOLETE && (insn1 & 0xfc802fb0) == 0x5c000610
+// OBSOLETE && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
+// OBSOLETE {
+// OBSOLETE src = REG_SRC1 (insn1);
+// OBSOLETE size = EXTRACT_FIELD (insn1, 24, 2) + 1;
+// OBSOLETE save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
+// OBSOLETE while (size--)
+// OBSOLETE {
+// OBSOLETE fsr->regs[src++] = save_addr;
+// OBSOLETE save_addr += 4;
+// OBSOLETE }
+// OBSOLETE ip = next_ip;
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */
+// OBSOLETE
+// OBSOLETE if (next_ip &&
+// OBSOLETE ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */
+// OBSOLETE || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */
+// OBSOLETE || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */
+// OBSOLETE {
+// OBSOLETE ip = next_ip;
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Accept zero or more instances of "st[qtl]? gx, n(fp)".
+// OBSOLETE This may cause us to mistake the copying of a register
+// OBSOLETE parameter to the frame for the saving of a callee-saved
+// OBSOLETE register, but that can't be helped, since with the
+// OBSOLETE "-fcall-saved" flag, any register can be made callee-saved.
+// OBSOLETE We can, however, refuse to accept a save of register g14,
+// OBSOLETE since that is matched explicitly below. */
+// OBSOLETE
+// OBSOLETE while (next_ip &&
+// OBSOLETE ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */
+// OBSOLETE || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */
+// OBSOLETE || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */
+// OBSOLETE || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */
+// OBSOLETE && ((src = MEM_SRCDST (insn1)) != G14_REGNUM))
+// OBSOLETE {
+// OBSOLETE save_addr = frame_addr + ((insn1 & BITMASK (12, 1))
+// OBSOLETE ? insn2 : MEMA_OFFSET (insn1));
+// OBSOLETE size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3)
+// OBSOLETE : ((insn1 & BITMASK (27, 1)) ? 2 : 1);
+// OBSOLETE while (size--)
+// OBSOLETE {
+// OBSOLETE fsr->regs[src++] = save_addr;
+// OBSOLETE save_addr += 4;
+// OBSOLETE }
+// OBSOLETE ip = next_ip;
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Accept the varargs prologue code if present. */
+// OBSOLETE
+// OBSOLETE size = sizeof (varargs_prologue_code) / sizeof (int);
+// OBSOLETE pcode = varargs_prologue_code;
+// OBSOLETE while (size-- && next_ip && *pcode++ == insn1)
+// OBSOLETE {
+// OBSOLETE ip = next_ip;
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Accept an optional "st g14, n(fp)". */
+// OBSOLETE
+// OBSOLETE if (next_ip &&
+// OBSOLETE ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */
+// OBSOLETE || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */
+// OBSOLETE {
+// OBSOLETE fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1))
+// OBSOLETE ? insn2 : MEMA_OFFSET (insn1));
+// OBSOLETE ip = next_ip;
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Accept zero or one instance of "mov g13, ry", where y >= 4.
+// OBSOLETE This is saving the address where a struct should be returned. */
+// OBSOLETE
+// OBSOLETE if (next_ip
+// OBSOLETE && (insn1 & 0xff802fbf) == 0x5c00061d
+// OBSOLETE && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
+// OBSOLETE {
+// OBSOLETE save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
+// OBSOLETE fsr->regs[G0_REGNUM + 13] = save_addr;
+// OBSOLETE ip = next_ip;
+// OBSOLETE #if 0 /* We'll need this once there is a subsequent instruction examined. */
+// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
+// OBSOLETE #endif
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE return (ip);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Given an ip value corresponding to the start of a function,
+// OBSOLETE return the ip of the first instruction after the function
+// OBSOLETE prologue. */
+// OBSOLETE
+// OBSOLETE CORE_ADDR
+// OBSOLETE i960_skip_prologue (CORE_ADDR ip)
+// OBSOLETE {
+// OBSOLETE struct frame_saved_regs saved_regs_dummy;
+// OBSOLETE struct symtab_and_line sal;
+// OBSOLETE CORE_ADDR limit;
+// OBSOLETE
+// OBSOLETE sal = find_pc_line (ip, 0);
+// OBSOLETE limit = (sal.end) ? sal.end : 0xffffffff;
+// OBSOLETE
+// OBSOLETE return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy));
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
+// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO.
+// OBSOLETE This includes special registers such as pc and fp saved in special
+// OBSOLETE ways in the stack frame. sp is even more special:
+// OBSOLETE the address we return for it IS the sp for the next frame.
+// OBSOLETE
+// OBSOLETE We cache the result of doing this in the frame_obstack, since it is
+// OBSOLETE fairly expensive. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
+// OBSOLETE {
+// OBSOLETE register CORE_ADDR next_addr;
+// OBSOLETE register CORE_ADDR *saved_regs;
+// OBSOLETE register int regnum;
+// OBSOLETE register struct frame_saved_regs *cache_fsr;
+// OBSOLETE CORE_ADDR ip;
+// OBSOLETE struct symtab_and_line sal;
+// OBSOLETE CORE_ADDR limit;
+// OBSOLETE
+// OBSOLETE if (!fi->fsr)
+// OBSOLETE {
+// OBSOLETE cache_fsr = (struct frame_saved_regs *)
+// OBSOLETE frame_obstack_alloc (sizeof (struct frame_saved_regs));
+// OBSOLETE memset (cache_fsr, '\0', sizeof (struct frame_saved_regs));
+// OBSOLETE fi->fsr = cache_fsr;
+// OBSOLETE
+// OBSOLETE /* Find the start and end of the function prologue. If the PC
+// OBSOLETE is in the function prologue, we only consider the part that
+// OBSOLETE has executed already. */
+// OBSOLETE
+// OBSOLETE ip = get_pc_function_start (fi->pc);
+// OBSOLETE sal = find_pc_line (ip, 0);
+// OBSOLETE limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc;
+// OBSOLETE
+// OBSOLETE examine_prologue (ip, limit, fi->frame, cache_fsr);
+// OBSOLETE
+// OBSOLETE /* Record the addresses at which the local registers are saved.
+// OBSOLETE Strictly speaking, we should only do this for non-leaf procedures,
+// OBSOLETE but no one will ever look at these values if it is a leaf procedure,
+// OBSOLETE since local registers are always caller-saved. */
+// OBSOLETE
+// OBSOLETE next_addr = (CORE_ADDR) fi->frame;
+// OBSOLETE saved_regs = cache_fsr->regs;
+// OBSOLETE for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++)
+// OBSOLETE {
+// OBSOLETE *saved_regs++ = next_addr;
+// OBSOLETE next_addr += 4;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM];
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE *fsr = *fi->fsr;
+// OBSOLETE
+// OBSOLETE /* Fetch the value of the sp from memory every time, since it
+// OBSOLETE is conceivable that it has changed since the cache was flushed.
+// OBSOLETE This unfortunately undoes much of the savings from caching the
+// OBSOLETE saved register values. I suggest adding an argument to
+// OBSOLETE get_frame_saved_regs () specifying the register number we're
+// OBSOLETE interested in (or -1 for all registers). This would be passed
+// OBSOLETE through to FRAME_FIND_SAVED_REGS (), permitting more efficient
+// OBSOLETE computation of saved register addresses (e.g., on the i960,
+// OBSOLETE we don't have to examine the prologue to find local registers).
+// OBSOLETE -- markf@wrs.com
+// OBSOLETE FIXME, we don't need to refetch this, since the cache is cleared
+// OBSOLETE every time the child process is restarted. If GDB itself
+// OBSOLETE modifies SP, it has to clear the cache by hand (does it?). -gnu */
+// OBSOLETE
+// OBSOLETE fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Return the address of the argument block for the frame
+// OBSOLETE described by FI. Returns 0 if the address is unknown. */
+// OBSOLETE
+// OBSOLETE CORE_ADDR
+// OBSOLETE frame_args_address (struct frame_info *fi, int must_be_correct)
+// OBSOLETE {
+// OBSOLETE struct frame_saved_regs fsr;
+// OBSOLETE CORE_ADDR ap;
+// OBSOLETE
+// OBSOLETE /* If g14 was saved in the frame by the function prologue code, return
+// OBSOLETE the saved value. If the frame is current and we are being sloppy,
+// OBSOLETE return the value of g14. Otherwise, return zero. */
+// OBSOLETE
+// OBSOLETE get_frame_saved_regs (fi, &fsr);
+// OBSOLETE if (fsr.regs[G14_REGNUM])
+// OBSOLETE ap = read_memory_integer (fsr.regs[G14_REGNUM], 4);
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE if (must_be_correct)
+// OBSOLETE return 0; /* Don't cache this result */
+// OBSOLETE if (get_next_frame (fi))
+// OBSOLETE ap = 0;
+// OBSOLETE else
+// OBSOLETE ap = read_register (G14_REGNUM);
+// OBSOLETE if (ap == 0)
+// OBSOLETE ap = fi->frame;
+// OBSOLETE }
+// OBSOLETE fi->arg_pointer = ap; /* Cache it for next time */
+// OBSOLETE return ap;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Return the address of the return struct for the frame
+// OBSOLETE described by FI. Returns 0 if the address is unknown. */
+// OBSOLETE
+// OBSOLETE CORE_ADDR
+// OBSOLETE frame_struct_result_address (struct frame_info *fi)
+// OBSOLETE {
+// OBSOLETE struct frame_saved_regs fsr;
+// OBSOLETE CORE_ADDR ap;
+// OBSOLETE
+// OBSOLETE /* If the frame is non-current, check to see if g14 was saved in the
+// OBSOLETE frame by the function prologue code; return the saved value if so,
+// OBSOLETE zero otherwise. If the frame is current, return the value of g14.
+// OBSOLETE
+// OBSOLETE FIXME, shouldn't this use the saved value as long as we are past
+// OBSOLETE the function prologue, and only use the current value if we have
+// OBSOLETE no saved value and are at TOS? -- gnu@cygnus.com */
+// OBSOLETE
+// OBSOLETE if (get_next_frame (fi))
+// OBSOLETE {
+// OBSOLETE get_frame_saved_regs (fi, &fsr);
+// OBSOLETE if (fsr.regs[G13_REGNUM])
+// OBSOLETE ap = read_memory_integer (fsr.regs[G13_REGNUM], 4);
+// OBSOLETE else
+// OBSOLETE ap = 0;
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE ap = read_register (G13_REGNUM);
+// OBSOLETE
+// OBSOLETE return ap;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Return address to which the currently executing leafproc will return,
+// OBSOLETE or 0 if IP, the value of the instruction pointer from the currently
+// OBSOLETE executing function, is not in a leafproc (or if we can't tell if it
+// OBSOLETE is).
+// OBSOLETE
+// OBSOLETE Do this by finding the starting address of the routine in which IP lies.
+// OBSOLETE If the instruction there is "mov g14, gx" (where x is in [0,7]), this
+// OBSOLETE is a leafproc and the return address is in register gx. Well, this is
+// OBSOLETE true unless the return address points at a RET instruction in the current
+// OBSOLETE procedure, which indicates that we have a 'dual entry' routine that
+// OBSOLETE has been entered through the CALL entry point. */
+// OBSOLETE
+// OBSOLETE CORE_ADDR
+// OBSOLETE leafproc_return (CORE_ADDR ip)
+// OBSOLETE {
+// OBSOLETE register struct minimal_symbol *msymbol;
+// OBSOLETE char *p;
+// OBSOLETE int dst;
+// OBSOLETE unsigned int insn1, insn2;
+// OBSOLETE CORE_ADDR return_addr;
+// OBSOLETE
+// OBSOLETE if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL)
+// OBSOLETE {
+// OBSOLETE if ((p = strchr (SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf"))
+// OBSOLETE {
+// OBSOLETE if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2)
+// OBSOLETE && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
+// OBSOLETE && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7)
+// OBSOLETE {
+// OBSOLETE /* Get the return address. If the "mov g14, gx"
+// OBSOLETE instruction hasn't been executed yet, read
+// OBSOLETE the return address from g14; otherwise, read it
+// OBSOLETE from the register into which g14 was moved. */
+// OBSOLETE
+// OBSOLETE return_addr =
+// OBSOLETE read_register ((ip == SYMBOL_VALUE_ADDRESS (msymbol))
+// OBSOLETE ? G14_REGNUM : dst);
+// OBSOLETE
+// OBSOLETE /* We know we are in a leaf procedure, but we don't know
+// OBSOLETE whether the caller actually did a "bal" to the ".lf"
+// OBSOLETE entry point, or a normal "call" to the non-leaf entry
+// OBSOLETE point one instruction before. In the latter case, the
+// OBSOLETE return address will be the address of a "ret"
+// OBSOLETE instruction within the procedure itself. We test for
+// OBSOLETE this below. */
+// OBSOLETE
+// OBSOLETE if (!next_insn (return_addr, &insn1, &insn2)
+// OBSOLETE || (insn1 & 0xff000000) != 0xa000000 /* ret */
+// OBSOLETE || lookup_minimal_symbol_by_pc (return_addr) != msymbol)
+// OBSOLETE return (return_addr);
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE return (0);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Immediately after a function call, return the saved pc.
+// OBSOLETE Can't go through the frames for this because on some machines
+// OBSOLETE the new frame is not set up until the new function executes
+// OBSOLETE some instructions.
+// OBSOLETE On the i960, the frame *is* set up immediately after the call,
+// OBSOLETE unless the function is a leaf procedure. */
+// OBSOLETE
+// OBSOLETE CORE_ADDR
+// OBSOLETE saved_pc_after_call (struct frame_info *frame)
+// OBSOLETE {
+// OBSOLETE CORE_ADDR saved_pc;
+// OBSOLETE
+// OBSOLETE saved_pc = leafproc_return (get_frame_pc (frame));
+// OBSOLETE if (!saved_pc)
+// OBSOLETE saved_pc = FRAME_SAVED_PC (frame);
+// OBSOLETE
+// OBSOLETE return saved_pc;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Discard from the stack the innermost frame,
+// OBSOLETE restoring all saved registers. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE i960_pop_frame (void)
+// OBSOLETE {
+// OBSOLETE register struct frame_info *current_fi, *prev_fi;
+// OBSOLETE register int i;
+// OBSOLETE CORE_ADDR save_addr;
+// OBSOLETE CORE_ADDR leaf_return_addr;
+// OBSOLETE struct frame_saved_regs fsr;
+// OBSOLETE char local_regs_buf[16 * 4];
+// OBSOLETE
+// OBSOLETE current_fi = get_current_frame ();
+// OBSOLETE
+// OBSOLETE /* First, undo what the hardware does when we return.
+// OBSOLETE If this is a non-leaf procedure, restore local registers from
+// OBSOLETE the save area in the calling frame. Otherwise, load the return
+// OBSOLETE address obtained from leafproc_return () into the rip. */
+// OBSOLETE
+// OBSOLETE leaf_return_addr = leafproc_return (current_fi->pc);
+// OBSOLETE if (!leaf_return_addr)
+// OBSOLETE {
+// OBSOLETE /* Non-leaf procedure. Restore local registers, incl IP. */
+// OBSOLETE prev_fi = get_prev_frame (current_fi);
+// OBSOLETE read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf));
+// OBSOLETE write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf,
+// OBSOLETE sizeof (local_regs_buf));
+// OBSOLETE
+// OBSOLETE /* Restore frame pointer. */
+// OBSOLETE write_register (FP_REGNUM, prev_fi->frame);
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE /* Leaf procedure. Just restore the return address into the IP. */
+// OBSOLETE write_register (RIP_REGNUM, leaf_return_addr);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Now restore any global regs that the current function had saved. */
+// OBSOLETE get_frame_saved_regs (current_fi, &fsr);
+// OBSOLETE for (i = G0_REGNUM; i < G14_REGNUM; i++)
+// OBSOLETE {
+// OBSOLETE save_addr = fsr.regs[i];
+// OBSOLETE if (save_addr != 0)
+// OBSOLETE write_register (i, read_memory_integer (save_addr, 4));
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Flush the frame cache, create a frame for the new innermost frame,
+// OBSOLETE and make it the current frame. */
+// OBSOLETE
+// OBSOLETE flush_cached_frames ();
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Given a 960 stop code (fault or trace), return the signal which
+// OBSOLETE corresponds. */
+// OBSOLETE
+// OBSOLETE enum target_signal
+// OBSOLETE i960_fault_to_signal (int fault)
+// OBSOLETE {
+// OBSOLETE switch (fault)
+// OBSOLETE {
+// OBSOLETE case 0:
+// OBSOLETE return TARGET_SIGNAL_BUS; /* parallel fault */
+// OBSOLETE case 1:
+// OBSOLETE return TARGET_SIGNAL_UNKNOWN;
+// OBSOLETE case 2:
+// OBSOLETE return TARGET_SIGNAL_ILL; /* operation fault */
+// OBSOLETE case 3:
+// OBSOLETE return TARGET_SIGNAL_FPE; /* arithmetic fault */
+// OBSOLETE case 4:
+// OBSOLETE return TARGET_SIGNAL_FPE; /* floating point fault */
+// OBSOLETE
+// OBSOLETE /* constraint fault. This appears not to distinguish between
+// OBSOLETE a range constraint fault (which should be SIGFPE) and a privileged
+// OBSOLETE fault (which should be SIGILL). */
+// OBSOLETE case 5:
+// OBSOLETE return TARGET_SIGNAL_ILL;
+// OBSOLETE
+// OBSOLETE case 6:
+// OBSOLETE return TARGET_SIGNAL_SEGV; /* virtual memory fault */
+// OBSOLETE
+// OBSOLETE /* protection fault. This is for an out-of-range argument to
+// OBSOLETE "calls". I guess it also could be SIGILL. */
+// OBSOLETE case 7:
+// OBSOLETE return TARGET_SIGNAL_SEGV;
+// OBSOLETE
+// OBSOLETE case 8:
+// OBSOLETE return TARGET_SIGNAL_BUS; /* machine fault */
+// OBSOLETE case 9:
+// OBSOLETE return TARGET_SIGNAL_BUS; /* structural fault */
+// OBSOLETE case 0xa:
+// OBSOLETE return TARGET_SIGNAL_ILL; /* type fault */
+// OBSOLETE case 0xb:
+// OBSOLETE return TARGET_SIGNAL_UNKNOWN; /* reserved fault */
+// OBSOLETE case 0xc:
+// OBSOLETE return TARGET_SIGNAL_BUS; /* process fault */
+// OBSOLETE case 0xd:
+// OBSOLETE return TARGET_SIGNAL_SEGV; /* descriptor fault */
+// OBSOLETE case 0xe:
+// OBSOLETE return TARGET_SIGNAL_BUS; /* event fault */
+// OBSOLETE case 0xf:
+// OBSOLETE return TARGET_SIGNAL_UNKNOWN; /* reserved fault */
+// OBSOLETE case 0x10:
+// OBSOLETE return TARGET_SIGNAL_TRAP; /* single-step trace */
+// OBSOLETE case 0x11:
+// OBSOLETE return TARGET_SIGNAL_TRAP; /* branch trace */
+// OBSOLETE case 0x12:
+// OBSOLETE return TARGET_SIGNAL_TRAP; /* call trace */
+// OBSOLETE case 0x13:
+// OBSOLETE return TARGET_SIGNAL_TRAP; /* return trace */
+// OBSOLETE case 0x14:
+// OBSOLETE return TARGET_SIGNAL_TRAP; /* pre-return trace */
+// OBSOLETE case 0x15:
+// OBSOLETE return TARGET_SIGNAL_TRAP; /* supervisor call trace */
+// OBSOLETE case 0x16:
+// OBSOLETE return TARGET_SIGNAL_TRAP; /* breakpoint trace */
+// OBSOLETE default:
+// OBSOLETE return TARGET_SIGNAL_UNKNOWN;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /****************************************/
+// OBSOLETE /* MEM format */
+// OBSOLETE /****************************************/
+// OBSOLETE
+// OBSOLETE struct tabent
+// OBSOLETE {
+// OBSOLETE char *name;
+// OBSOLETE char numops;
+// OBSOLETE };
+// OBSOLETE
+// OBSOLETE /* Return instruction length, either 4 or 8. When NOPRINT is non-zero
+// OBSOLETE (TRUE), don't output any text. (Actually, as implemented, if NOPRINT
+// OBSOLETE is 0, abort() is called.) */
+// OBSOLETE
+// OBSOLETE static int
+// OBSOLETE mem (unsigned long memaddr, unsigned long word1, unsigned long word2,
+// OBSOLETE int noprint)
+// OBSOLETE {
+// OBSOLETE int i, j;
+// OBSOLETE int len;
+// OBSOLETE int mode;
+// OBSOLETE int offset;
+// OBSOLETE const char *reg1, *reg2, *reg3;
+// OBSOLETE
+// OBSOLETE /* This lookup table is too sparse to make it worth typing in, but not
+// OBSOLETE * so large as to make a sparse array necessary. We allocate the
+// OBSOLETE * table at runtime, initialize all entries to empty, and copy the
+// OBSOLETE * real ones in from an initialization table.
+// OBSOLETE *
+// OBSOLETE * NOTE: In this table, the meaning of 'numops' is:
+// OBSOLETE * 1: single operand
+// OBSOLETE * 2: 2 operands, load instruction
+// OBSOLETE * -2: 2 operands, store instruction
+// OBSOLETE */
+// OBSOLETE static struct tabent *mem_tab = NULL;
+// OBSOLETE /* Opcodes of 0x8X, 9X, aX, bX, and cX must be in the table. */
+// OBSOLETE #define MEM_MIN 0x80
+// OBSOLETE #define MEM_MAX 0xcf
+// OBSOLETE #define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent))
+// OBSOLETE
+// OBSOLETE static struct
+// OBSOLETE {
+// OBSOLETE int opcode;
+// OBSOLETE char *name;
+// OBSOLETE char numops;
+// OBSOLETE }
+// OBSOLETE mem_init[] =
+// OBSOLETE {
+// OBSOLETE 0x80, "ldob", 2,
+// OBSOLETE 0x82, "stob", -2,
+// OBSOLETE 0x84, "bx", 1,
+// OBSOLETE 0x85, "balx", 2,
+// OBSOLETE 0x86, "callx", 1,
+// OBSOLETE 0x88, "ldos", 2,
+// OBSOLETE 0x8a, "stos", -2,
+// OBSOLETE 0x8c, "lda", 2,
+// OBSOLETE 0x90, "ld", 2,
+// OBSOLETE 0x92, "st", -2,
+// OBSOLETE 0x98, "ldl", 2,
+// OBSOLETE 0x9a, "stl", -2,
+// OBSOLETE 0xa0, "ldt", 2,
+// OBSOLETE 0xa2, "stt", -2,
+// OBSOLETE 0xb0, "ldq", 2,
+// OBSOLETE 0xb2, "stq", -2,
+// OBSOLETE 0xc0, "ldib", 2,
+// OBSOLETE 0xc2, "stib", -2,
+// OBSOLETE 0xc8, "ldis", 2,
+// OBSOLETE 0xca, "stis", -2,
+// OBSOLETE 0, NULL, 0
+// OBSOLETE };
+// OBSOLETE
+// OBSOLETE if (mem_tab == NULL)
+// OBSOLETE {
+// OBSOLETE mem_tab = (struct tabent *) xmalloc (MEM_SIZ);
+// OBSOLETE memset (mem_tab, '\0', MEM_SIZ);
+// OBSOLETE for (i = 0; mem_init[i].opcode != 0; i++)
+// OBSOLETE {
+// OBSOLETE j = mem_init[i].opcode - MEM_MIN;
+// OBSOLETE mem_tab[j].name = mem_init[i].name;
+// OBSOLETE mem_tab[j].numops = mem_init[i].numops;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE i = ((word1 >> 24) & 0xff) - MEM_MIN;
+// OBSOLETE mode = (word1 >> 10) & 0xf;
+// OBSOLETE
+// OBSOLETE if ((mem_tab[i].name != NULL) /* Valid instruction */
+// OBSOLETE && ((mode == 5) || (mode >= 12)))
+// OBSOLETE { /* With 32-bit displacement */
+// OBSOLETE len = 8;
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE len = 4;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE if (noprint)
+// OBSOLETE {
+// OBSOLETE return len;
+// OBSOLETE }
+// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check");
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Read the i960 instruction at 'memaddr' and return the address of
+// OBSOLETE the next instruction after that, or 0 if 'memaddr' is not the
+// OBSOLETE address of a valid instruction. The first word of the instruction
+// OBSOLETE is stored at 'pword1', and the second word, if any, is stored at
+// OBSOLETE 'pword2'. */
+// OBSOLETE
+// OBSOLETE static CORE_ADDR
+// OBSOLETE next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2)
+// OBSOLETE {
+// OBSOLETE int len;
+// OBSOLETE char buf[8];
+// OBSOLETE
+// OBSOLETE /* Read the two (potential) words of the instruction at once,
+// OBSOLETE to eliminate the overhead of two calls to read_memory ().
+// OBSOLETE FIXME: Loses if the first one is readable but the second is not
+// OBSOLETE (e.g. last word of the segment). */
+// OBSOLETE
+// OBSOLETE read_memory (memaddr, buf, 8);
+// OBSOLETE *pword1 = extract_unsigned_integer (buf, 4);
+// OBSOLETE *pword2 = extract_unsigned_integer (buf + 4, 4);
+// OBSOLETE
+// OBSOLETE /* Divide instruction set into classes based on high 4 bits of opcode */
+// OBSOLETE
+// OBSOLETE switch ((*pword1 >> 28) & 0xf)
+// OBSOLETE {
+// OBSOLETE case 0x0:
+// OBSOLETE case 0x1: /* ctrl */
+// OBSOLETE
+// OBSOLETE case 0x2:
+// OBSOLETE case 0x3: /* cobr */
+// OBSOLETE
+// OBSOLETE case 0x5:
+// OBSOLETE case 0x6:
+// OBSOLETE case 0x7: /* reg */
+// OBSOLETE len = 4;
+// OBSOLETE break;
+// OBSOLETE
+// OBSOLETE case 0x8:
+// OBSOLETE case 0x9:
+// OBSOLETE case 0xa:
+// OBSOLETE case 0xb:
+// OBSOLETE case 0xc:
+// OBSOLETE len = mem (memaddr, *pword1, *pword2, 1);
+// OBSOLETE break;
+// OBSOLETE
+// OBSOLETE default: /* invalid instruction */
+// OBSOLETE len = 0;
+// OBSOLETE break;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE if (len)
+// OBSOLETE return memaddr + len;
+// OBSOLETE else
+// OBSOLETE return 0;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* 'start_frame' is a variable in the MON960 runtime startup routine
+// OBSOLETE that contains the frame pointer of the 'start' routine (the routine
+// OBSOLETE that calls 'main'). By reading its contents out of remote memory,
+// OBSOLETE we can tell where the frame chain ends: backtraces should halt before
+// OBSOLETE they display this frame. */
+// OBSOLETE
+// OBSOLETE int
+// OBSOLETE mon960_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe)
+// OBSOLETE {
+// OBSOLETE struct symbol *sym;
+// OBSOLETE struct minimal_symbol *msymbol;
+// OBSOLETE
+// OBSOLETE /* crtmon960.o is an assembler module that is assumed to be linked
+// OBSOLETE * first in an i80960 executable. It contains the true entry point;
+// OBSOLETE * it performs startup up initialization and then calls 'main'.
+// OBSOLETE *
+// OBSOLETE * 'sf' is the name of a variable in crtmon960.o that is set
+// OBSOLETE * during startup to the address of the first frame.
+// OBSOLETE *
+// OBSOLETE * 'a' is the address of that variable in 80960 memory.
+// OBSOLETE */
+// OBSOLETE static char sf[] = "start_frame";
+// OBSOLETE CORE_ADDR a;
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers
+// OBSOLETE contain return status info in them. */
+// OBSOLETE if (chain == 0)
+// OBSOLETE {
+// OBSOLETE return 0;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL,
+// OBSOLETE (struct symtab **) NULL);
+// OBSOLETE if (sym != 0)
+// OBSOLETE {
+// OBSOLETE a = SYMBOL_VALUE (sym);
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE msymbol = lookup_minimal_symbol (sf, NULL, NULL);
+// OBSOLETE if (msymbol == NULL)
+// OBSOLETE return 0;
+// OBSOLETE a = SYMBOL_VALUE_ADDRESS (msymbol);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE return (chain != read_memory_integer (a, 4));
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE _initialize_i960_tdep (void)
+// OBSOLETE {
+// OBSOLETE check_host ();
+// OBSOLETE
+// OBSOLETE tm_print_insn = print_insn_i960;
+// OBSOLETE }
-/* Memory-access and commands for remote NINDY process, for GDB.
-
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001, 2002 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
- WARRANTY. No author or distributor accepts responsibility to anyone
- for the consequences of using it or for whether it serves any
- particular purpose or works at all, unless he says so in writing.
- Refer to the GDB General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute GDB,
- but only under the conditions described in the GDB General Public
- License. A copy of this license is supposed to have been given to you
- along with GDB so you can know your rights and responsibilities. It
- should be in a file named COPYING. Among other things, the copyright
- notice and this notice must be preserved on all copies.
-
- In other words, go ahead and share GDB, but don't try to stop
- anyone else from sharing it farther. Help stamp out software hoarding! */
-
-/*
- Except for the data cache routines, this file bears little resemblence
- to remote.c. A new (although similar) protocol has been specified, and
- portions of the code are entirely dependent on having an i80960 with a
- NINDY ROM monitor at the other end of the line.
- */
-
-/*****************************************************************************
- *
- * REMOTE COMMUNICATION PROTOCOL BETWEEN GDB960 AND THE NINDY ROM MONITOR.
- *
- *
- * MODES OF OPERATION
- * ----- -- ---------
- *
- * As far as NINDY is concerned, GDB is always in one of two modes: command
- * mode or passthrough mode.
- *
- * In command mode (the default) pre-defined packets containing requests
- * are sent by GDB to NINDY. NINDY never talks except in reponse to a request.
- *
- * Once the the user program is started, GDB enters passthrough mode, to give
- * the user program access to the terminal. GDB remains in this mode until
- * NINDY indicates that the program has stopped.
- *
- *
- * PASSTHROUGH MODE
- * ----------- ----
- *
- * GDB writes all input received from the keyboard directly to NINDY, and writes
- * all characters received from NINDY directly to the monitor.
- *
- * Keyboard input is neither buffered nor echoed to the monitor.
- *
- * GDB remains in passthrough mode until NINDY sends a single ^P character,
- * to indicate that the user process has stopped.
- *
- * Note:
- * GDB assumes NINDY performs a 'flushreg' when the user program stops.
- *
- *
- * COMMAND MODE
- * ------- ----
- *
- * All info (except for message ack and nak) is transferred between gdb
- * and the remote processor in messages of the following format:
- *
- * <info>#<checksum>
- *
- * where
- * # is a literal character
- *
- * <info> ASCII information; all numeric information is in the
- * form of hex digits ('0'-'9' and lowercase 'a'-'f').
- *
- * <checksum>
- * is a pair of ASCII hex digits representing an 8-bit
- * checksum formed by adding together each of the
- * characters in <info>.
- *
- * The receiver of a message always sends a single character to the sender
- * to indicate that the checksum was good ('+') or bad ('-'); the sender
- * re-transmits the entire message over until a '+' is received.
- *
- * In response to a command NINDY always sends back either data or
- * a result code of the form "Xnn", where "nn" are hex digits and "X00"
- * means no errors. (Exceptions: the "s" and "c" commands don't respond.)
- *
- * SEE THE HEADER OF THE FILE "gdb.c" IN THE NINDY MONITOR SOURCE CODE FOR A
- * FULL DESCRIPTION OF LEGAL COMMANDS.
- *
- * SEE THE FILE "stop.h" IN THE NINDY MONITOR SOURCE CODE FOR A LIST
- * OF STOP CODES.
- *
- ***************************************************************************/
-
-#include "defs.h"
-#include <signal.h>
-#include <sys/types.h>
-#include <setjmp.h>
-
-#include "frame.h"
-#include "inferior.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "floatformat.h"
-#include "regcache.h"
-
-#include <sys/file.h>
-#include <ctype.h>
-#include "serial.h"
-#include "nindy-share/env.h"
-#include "nindy-share/stop.h"
-#include "remote-utils.h"
-
-extern int unlink ();
-extern char *getenv ();
-extern char *mktemp ();
-
-extern void generic_mourn_inferior ();
-
-extern struct target_ops nindy_ops;
-extern FILE *instream;
-
-extern char ninStopWhy ();
-extern int ninMemGet ();
-extern int ninMemPut ();
-
-int nindy_initial_brk; /* nonzero if want to send an initial BREAK to nindy */
-int nindy_old_protocol; /* nonzero if want to use old protocol */
-char *nindy_ttyname; /* name of tty to talk to nindy on, or null */
-
-#define DLE '\020' /* Character NINDY sends to indicate user program has
- * halted. */
-#define TRUE 1
-#define FALSE 0
-
-/* From nindy-share/nindy.c. */
-extern struct serial *nindy_serial;
-
-static int have_regs = 0; /* 1 iff regs read since i960 last halted */
-static int regs_changed = 0; /* 1 iff regs were modified since last read */
-
-extern char *exists ();
-
-static void nindy_fetch_registers (int);
-
-static void nindy_store_registers (int);
-\f
-static char *savename;
-
-static void
-nindy_close (int quitting)
-{
- if (nindy_serial != NULL)
- serial_close (nindy_serial);
- nindy_serial = NULL;
-
- if (savename)
- xfree (savename);
- savename = 0;
-}
-
-/* Open a connection to a remote debugger.
- FIXME, there should be "set" commands for the options that are
- now specified with gdb command-line options (old_protocol,
- and initial_brk). */
-void
-nindy_open (char *name, /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
- int from_tty)
-{
- char baudrate[1024];
-
- if (!name)
- error_no_arg ("serial port device name");
-
- target_preopen (from_tty);
-
- nindy_close (0);
-
- have_regs = regs_changed = 0;
-
- /* Allow user to interrupt the following -- we could hang if there's
- no NINDY at the other end of the remote tty. */
- immediate_quit++;
- /* If baud_rate is -1, then ninConnect will not recognize the baud rate
- and will deal with the situation in a (more or less) reasonable
- fashion. */
- sprintf (baudrate, "%d", baud_rate);
- ninConnect (name, baudrate,
- nindy_initial_brk, !from_tty, nindy_old_protocol);
- immediate_quit--;
-
- if (nindy_serial == NULL)
- {
- perror_with_name (name);
- }
-
- savename = savestring (name, strlen (name));
- push_target (&nindy_ops);
-
- target_fetch_registers (-1);
-
- init_thread_list ();
- init_wait_for_inferior ();
- clear_proceed_status ();
- normal_stop ();
-}
-
-/* User-initiated quit of nindy operations. */
-
-static void
-nindy_detach (char *name, int from_tty)
-{
- if (name)
- error ("Too many arguments");
- pop_target ();
-}
-
-static void
-nindy_files_info (void)
-{
- /* FIXME: this lies about the baud rate if we autobauded. */
- printf_unfiltered ("\tAttached to %s at %d bits per second%s%s.\n", savename,
- baud_rate,
- nindy_old_protocol ? " in old protocol" : "",
- nindy_initial_brk ? " with initial break" : "");
-}
-\f
-/* Return the number of characters in the buffer BUF before
- the first DLE character. N is maximum number of characters to
- consider. */
-
-static
-int
-non_dle (char *buf, int n)
-{
- int i;
-
- for (i = 0; i < n; i++)
- {
- if (buf[i] == DLE)
- {
- break;
- }
- }
- return i;
-}
-\f
-/* Tell the remote machine to resume. */
-
-void
-nindy_resume (ptid_t ptid, int step, enum target_signal siggnal)
-{
- if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal)
- warning ("Can't send signals to remote NINDY targets.");
-
- if (regs_changed)
- {
- nindy_store_registers (-1);
- regs_changed = 0;
- }
- have_regs = 0;
- ninGo (step);
-}
-\f
-/* FIXME, we can probably use the normal terminal_inferior stuff here.
- We have to do terminal_inferior and then set up the passthrough
- settings initially. Thereafter, terminal_ours and terminal_inferior
- will automatically swap the settings around for us. */
-
-struct clean_up_tty_args
-{
- serial_ttystate state;
- struct serial *serial;
-};
-static struct clean_up_tty_args tty_args;
-
-static void
-clean_up_tty (PTR ptrarg)
-{
- struct clean_up_tty_args *args = (struct clean_up_tty_args *) ptrarg;
- serial_set_tty_state (args->serial, args->state);
- xfree (args->state);
- warning ("\n\nYou may need to reset the 80960 and/or reload your program.\n");
-}
-
-/* Recover from ^Z or ^C while remote process is running */
-static void (*old_ctrlc) ();
-#ifdef SIGTSTP
-static void (*old_ctrlz) ();
-#endif
-
-static void
-clean_up_int (void)
-{
- serial_set_tty_state (tty_args.serial, tty_args.state);
- xfree (tty_args.state);
-
- signal (SIGINT, old_ctrlc);
-#ifdef SIGTSTP
- signal (SIGTSTP, old_ctrlz);
-#endif
- error ("\n\nYou may need to reset the 80960 and/or reload your program.\n");
-}
-
-/* Wait until the remote machine stops. While waiting, operate in passthrough
- * mode; i.e., pass everything NINDY sends to gdb_stdout, and everything from
- * stdin to NINDY.
- *
- * Return to caller, storing status in 'status' just as `wait' would.
- */
-
-static ptid_t
-nindy_wait (ptid_t ptid, struct target_waitstatus *status)
-{
- fd_set fds;
- int c;
- char buf[2];
- int i, n;
- unsigned char stop_exit;
- unsigned char stop_code;
- struct cleanup *old_cleanups;
- long ip_value, fp_value, sp_value; /* Reg values from stop */
-
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = 0;
-
- /* OPERATE IN PASSTHROUGH MODE UNTIL NINDY SENDS A DLE CHARACTER */
-
- /* Save current tty attributes, and restore them when done. */
- tty_args.serial = serial_fdopen (0);
- tty_args.state = serial_get_tty_state (tty_args.serial);
- old_ctrlc = signal (SIGINT, clean_up_int);
-#ifdef SIGTSTP
- old_ctrlz = signal (SIGTSTP, clean_up_int);
-#endif
-
- old_cleanups = make_cleanup (clean_up_tty, &tty_args);
-
- /* Pass input from keyboard to NINDY as it arrives. NINDY will interpret
- <CR> and perform echo. */
- /* This used to set CBREAK and clear ECHO and CRMOD. I hope this is close
- enough. */
- serial_raw (tty_args.serial);
-
- while (1)
- {
- /* Input on remote */
- c = serial_readchar (nindy_serial, -1);
- if (c == SERIAL_ERROR)
- {
- error ("Cannot read from serial line");
- }
- else if (c == 0x1b) /* ESC */
- {
- c = serial_readchar (nindy_serial, -1);
- c &= ~0x40;
- }
- else if (c != 0x10) /* DLE */
- /* Write out any characters preceding DLE */
- {
- buf[0] = (char) c;
- write (1, buf, 1);
- }
- else
- {
- stop_exit = ninStopWhy (&stop_code,
- &ip_value, &fp_value, &sp_value);
- if (!stop_exit && (stop_code == STOP_SRQ))
- {
- immediate_quit++;
- ninSrq ();
- immediate_quit--;
- }
- else
- {
- /* Get out of loop */
- supply_register (IP_REGNUM,
- (char *) &ip_value);
- supply_register (FP_REGNUM,
- (char *) &fp_value);
- supply_register (SP_REGNUM,
- (char *) &sp_value);
- break;
- }
- }
- }
-
- serial_set_tty_state (tty_args.serial, tty_args.state);
- xfree (tty_args.state);
- discard_cleanups (old_cleanups);
-
- if (stop_exit)
- {
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = stop_code;
- }
- else
- {
- /* nindy has some special stop code need to be handled */
- if (stop_code == STOP_GDB_BPT)
- stop_code = TRACE_STEP;
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = i960_fault_to_signal (stop_code);
- }
- return inferior_ptid;
-}
-
-/* Read the remote registers into the block REGS. */
-
-/* This is the block that ninRegsGet and ninRegsPut handles. */
-struct nindy_regs
-{
- char local_regs[16 * 4];
- char global_regs[16 * 4];
- char pcw_acw[2 * 4];
- char ip[4];
- char tcw[4];
- char fp_as_double[4 * 8];
-};
-
-static void
-nindy_fetch_registers (int regno)
-{
- struct nindy_regs nindy_regs;
- int regnum;
-
- immediate_quit++;
- ninRegsGet ((char *) &nindy_regs);
- immediate_quit--;
-
- memcpy (®isters[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16 * 4);
- memcpy (®isters[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16 * 4);
- memcpy (®isters[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2 * 4);
- memcpy (®isters[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1 * 4);
- memcpy (®isters[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1 * 4);
- memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8);
-
- registers_fetched ();
-}
-
-static void
-nindy_prepare_to_store (void)
-{
- /* Fetch all regs if they aren't already here. */
- read_register_bytes (0, NULL, REGISTER_BYTES);
-}
-
-static void
-nindy_store_registers (int regno)
-{
- struct nindy_regs nindy_regs;
- int regnum;
-
- memcpy (nindy_regs.local_regs, ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * 4);
- memcpy (nindy_regs.global_regs, ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * 4);
- memcpy (nindy_regs.pcw_acw, ®isters[REGISTER_BYTE (PCW_REGNUM)], 2 * 4);
- memcpy (nindy_regs.ip, ®isters[REGISTER_BYTE (IP_REGNUM)], 1 * 4);
- memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1 * 4);
- memcpy (nindy_regs.fp_as_double, ®isters[REGISTER_BYTE (FP0_REGNUM)], 8 * 4);
-
- immediate_quit++;
- ninRegsPut ((char *) &nindy_regs);
- immediate_quit--;
-}
-
-/* Copy LEN bytes to or from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. Copy to inferior if
- SHOULD_WRITE is nonzero. Returns the length copied. TARGET is
- unused. */
-
-int
-nindy_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
- int should_write, struct mem_attrib *attrib,
- struct target_ops *target)
-{
- int res;
-
- if (len <= 0)
- return 0;
-
- if (should_write)
- res = ninMemPut (memaddr, myaddr, len);
- else
- res = ninMemGet (memaddr, myaddr, len);
-
- return res;
-}
-\f
-static void
-nindy_create_inferior (char *execfile, char *args, char **env)
-{
- int entry_pt;
- int pid;
-
- if (args && *args)
- error ("Can't pass arguments to remote NINDY process");
-
- if (execfile == 0 || exec_bfd == 0)
- error ("No executable file specified");
-
- entry_pt = (int) bfd_get_start_address (exec_bfd);
-
- pid = 42;
-
- /* The "process" (board) is already stopped awaiting our commands, and
- the program is already downloaded. We just set its PC and go. */
-
- inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior below */
-
- clear_proceed_status ();
-
- /* Tell wait_for_inferior that we've started a new process. */
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- /* insert_step_breakpoint (); FIXME, do we need this? */
- /* Let 'er rip... */
- proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
-}
-
-static void
-reset_command (char *args, int from_tty)
-{
- if (nindy_serial == NULL)
- {
- error ("No target system to reset -- use 'target nindy' command.");
- }
- if (query ("Really reset the target system?", 0, 0))
- {
- serial_send_break (nindy_serial);
- tty_flush (nindy_serial);
- }
-}
-
-void
-nindy_kill (char *args, int from_tty)
-{
- return; /* Ignore attempts to kill target system */
-}
-
-/* Clean up when a program exits.
-
- The program actually lives on in the remote processor's RAM, and may be
- run again without a download. Don't leave it full of breakpoint
- instructions. */
-
-void
-nindy_mourn_inferior (void)
-{
- remove_breakpoints ();
- unpush_target (&nindy_ops);
- generic_mourn_inferior (); /* Do all the proper things now */
-}
-\f
-/* Pass the args the way catch_errors wants them. */
-static int
-nindy_open_stub (char *arg)
-{
- nindy_open (arg, 1);
- return 1;
-}
-
-static void
-nindy_load (char *filename, int from_tty)
-{
- asection *s;
- /* Can't do unix style forking on a VMS system, so we'll use bfd to do
- all the work for us
- */
-
- bfd *file = bfd_openr (filename, 0);
- if (!file)
- {
- perror_with_name (filename);
- return;
- }
-
- if (!bfd_check_format (file, bfd_object))
- {
- error ("can't prove it's an object file\n");
- return;
- }
-
- for (s = file->sections; s; s = s->next)
- {
- if (s->flags & SEC_LOAD)
- {
- char *buffer = xmalloc (s->_raw_size);
- bfd_get_section_contents (file, s, buffer, 0, s->_raw_size);
- printf ("Loading section %s, size %x vma %x\n",
- s->name,
- s->_raw_size,
- s->vma);
- ninMemPut (s->vma, buffer, s->_raw_size);
- xfree (buffer);
- }
- }
- bfd_close (file);
-}
-
-static int
-load_stub (char *arg)
-{
- target_load (arg, 1);
- return 1;
-}
-
-/* This routine is run as a hook, just before the main command loop is
- entered. If gdb is configured for the i960, but has not had its
- nindy target specified yet, this will loop prompting the user to do so.
-
- Unlike the loop provided by Intel, we actually let the user get out
- of this with a RETURN. This is useful when e.g. simply examining
- an i960 object file on the host system. */
-
-void
-nindy_before_main_loop (void)
-{
- char ttyname[100];
- char *p, *p2;
-
- while (target_stack->target_ops != &nindy_ops) /* What is this crap??? */
- { /* remote tty not specified yet */
- if (instream == stdin)
- {
- printf_unfiltered ("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: ");
- gdb_flush (gdb_stdout);
- }
- fgets (ttyname, sizeof (ttyname) - 1, stdin);
-
- /* Strip leading and trailing whitespace */
- for (p = ttyname; isspace (*p); p++)
- {
- ;
- }
- if (*p == '\0')
- {
- return; /* User just hit spaces or return, wants out */
- }
- for (p2 = p; !isspace (*p2) && (*p2 != '\0'); p2++)
- {
- ;
- }
- *p2 = '\0';
- if (STREQ ("quit", p))
- {
- exit (1);
- }
-
- if (catch_errors (nindy_open_stub, p, "", RETURN_MASK_ALL))
- {
- /* Now that we have a tty open for talking to the remote machine,
- download the executable file if one was specified. */
- if (exec_bfd)
- {
- catch_errors (load_stub, bfd_get_filename (exec_bfd), "",
- RETURN_MASK_ALL);
- }
- }
- }
-}
-\f
-/* Define the target subroutine names */
-
-struct target_ops nindy_ops;
-
-static void
-init_nindy_ops (void)
-{
- nindy_ops.to_shortname = "nindy";
- "Remote serial target in i960 NINDY-specific protocol",
- nindy_ops.to_longname = "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_ops.to_doc = "";
- nindy_ops.to_open = nindy_open;
- nindy_ops.to_close = nindy_close;
- nindy_ops.to_attach = 0;
- nindy_ops.to_post_attach = NULL;
- nindy_ops.to_require_attach = NULL;
- nindy_ops.to_detach = nindy_detach;
- nindy_ops.to_require_detach = NULL;
- nindy_ops.to_resume = nindy_resume;
- nindy_ops.to_wait = nindy_wait;
- nindy_ops.to_post_wait = NULL;
- nindy_ops.to_fetch_registers = nindy_fetch_registers;
- nindy_ops.to_store_registers = nindy_store_registers;
- nindy_ops.to_prepare_to_store = nindy_prepare_to_store;
- nindy_ops.to_xfer_memory = nindy_xfer_inferior_memory;
- nindy_ops.to_files_info = nindy_files_info;
- nindy_ops.to_insert_breakpoint = memory_insert_breakpoint;
- nindy_ops.to_remove_breakpoint = memory_remove_breakpoint;
- nindy_ops.to_terminal_init = 0;
- nindy_ops.to_terminal_inferior = 0;
- nindy_ops.to_terminal_ours_for_output = 0;
- nindy_ops.to_terminal_ours = 0;
- nindy_ops.to_terminal_info = 0; /* Terminal crud */
- nindy_ops.to_kill = nindy_kill;
- nindy_ops.to_load = nindy_load;
- nindy_ops.to_lookup_symbol = 0; /* lookup_symbol */
- nindy_ops.to_create_inferior = nindy_create_inferior;
- nindy_ops.to_post_startup_inferior = NULL;
- nindy_ops.to_acknowledge_created_inferior = NULL;
- nindy_ops.to_clone_and_follow_inferior = NULL;
- nindy_ops.to_post_follow_inferior_by_clone = NULL;
- nindy_ops.to_insert_fork_catchpoint = NULL;
- nindy_ops.to_remove_fork_catchpoint = NULL;
- nindy_ops.to_insert_vfork_catchpoint = NULL;
- nindy_ops.to_remove_vfork_catchpoint = NULL;
- nindy_ops.to_has_forked = NULL;
- nindy_ops.to_has_vforked = NULL;
- nindy_ops.to_can_follow_vfork_prior_to_exec = NULL;
- nindy_ops.to_post_follow_vfork = NULL;
- nindy_ops.to_insert_exec_catchpoint = NULL;
- nindy_ops.to_remove_exec_catchpoint = NULL;
- nindy_ops.to_has_execd = NULL;
- nindy_ops.to_reported_exec_events_per_exec_call = NULL;
- nindy_ops.to_has_exited = NULL;
- nindy_ops.to_mourn_inferior = nindy_mourn_inferior;
- nindy_ops.to_can_run = 0; /* can_run */
- nindy_ops.to_notice_signals = 0; /* notice_signals */
- nindy_ops.to_thread_alive = 0; /* to_thread_alive */
- nindy_ops.to_stop = 0; /* to_stop */
- nindy_ops.to_pid_to_exec_file = NULL;
- nindy_ops.to_stratum = process_stratum;
- nindy_ops.DONT_USE = 0; /* next */
- nindy_ops.to_has_all_memory = 1;
- nindy_ops.to_has_memory = 1;
- nindy_ops.to_has_stack = 1;
- nindy_ops.to_has_registers = 1;
- nindy_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */
- nindy_ops.to_sections = 0;
- nindy_ops.to_sections_end = 0; /* Section pointers */
- nindy_ops.to_magic = OPS_MAGIC; /* Always the last thing */
-}
-
-void
-_initialize_nindy (void)
-{
- init_nindy_ops ();
- add_target (&nindy_ops);
- add_com ("reset", class_obscure, reset_command,
- "Send a 'break' to the remote target system.\n\
-Only useful if the target has been equipped with a circuit\n\
-to perform a hard reset when a break is detected.");
-}
+// OBSOLETE /* Memory-access and commands for remote NINDY process, for GDB.
+// OBSOLETE
+// OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
+// OBSOLETE 2000, 2001, 2002 Free Software Foundation, Inc.
+// OBSOLETE
+// OBSOLETE Contributed by Intel Corporation. Modified from remote.c by Chris Benenati.
+// OBSOLETE
+// OBSOLETE GDB is distributed in the hope that it will be useful, but WITHOUT ANY
+// OBSOLETE WARRANTY. No author or distributor accepts responsibility to anyone
+// OBSOLETE for the consequences of using it or for whether it serves any
+// OBSOLETE particular purpose or works at all, unless he says so in writing.
+// OBSOLETE Refer to the GDB General Public License for full details.
+// OBSOLETE
+// OBSOLETE Everyone is granted permission to copy, modify and redistribute GDB,
+// OBSOLETE but only under the conditions described in the GDB General Public
+// OBSOLETE License. A copy of this license is supposed to have been given to you
+// OBSOLETE along with GDB so you can know your rights and responsibilities. It
+// OBSOLETE should be in a file named COPYING. Among other things, the copyright
+// OBSOLETE notice and this notice must be preserved on all copies.
+// OBSOLETE
+// OBSOLETE In other words, go ahead and share GDB, but don't try to stop
+// OBSOLETE anyone else from sharing it farther. Help stamp out software hoarding! */
+// OBSOLETE
+// OBSOLETE /*
+// OBSOLETE Except for the data cache routines, this file bears little resemblence
+// OBSOLETE to remote.c. A new (although similar) protocol has been specified, and
+// OBSOLETE portions of the code are entirely dependent on having an i80960 with a
+// OBSOLETE NINDY ROM monitor at the other end of the line.
+// OBSOLETE */
+// OBSOLETE
+// OBSOLETE /*****************************************************************************
+// OBSOLETE *
+// OBSOLETE * REMOTE COMMUNICATION PROTOCOL BETWEEN GDB960 AND THE NINDY ROM MONITOR.
+// OBSOLETE *
+// OBSOLETE *
+// OBSOLETE * MODES OF OPERATION
+// OBSOLETE * ----- -- ---------
+// OBSOLETE *
+// OBSOLETE * As far as NINDY is concerned, GDB is always in one of two modes: command
+// OBSOLETE * mode or passthrough mode.
+// OBSOLETE *
+// OBSOLETE * In command mode (the default) pre-defined packets containing requests
+// OBSOLETE * are sent by GDB to NINDY. NINDY never talks except in reponse to a request.
+// OBSOLETE *
+// OBSOLETE * Once the the user program is started, GDB enters passthrough mode, to give
+// OBSOLETE * the user program access to the terminal. GDB remains in this mode until
+// OBSOLETE * NINDY indicates that the program has stopped.
+// OBSOLETE *
+// OBSOLETE *
+// OBSOLETE * PASSTHROUGH MODE
+// OBSOLETE * ----------- ----
+// OBSOLETE *
+// OBSOLETE * GDB writes all input received from the keyboard directly to NINDY, and writes
+// OBSOLETE * all characters received from NINDY directly to the monitor.
+// OBSOLETE *
+// OBSOLETE * Keyboard input is neither buffered nor echoed to the monitor.
+// OBSOLETE *
+// OBSOLETE * GDB remains in passthrough mode until NINDY sends a single ^P character,
+// OBSOLETE * to indicate that the user process has stopped.
+// OBSOLETE *
+// OBSOLETE * Note:
+// OBSOLETE * GDB assumes NINDY performs a 'flushreg' when the user program stops.
+// OBSOLETE *
+// OBSOLETE *
+// OBSOLETE * COMMAND MODE
+// OBSOLETE * ------- ----
+// OBSOLETE *
+// OBSOLETE * All info (except for message ack and nak) is transferred between gdb
+// OBSOLETE * and the remote processor in messages of the following format:
+// OBSOLETE *
+// OBSOLETE * <info>#<checksum>
+// OBSOLETE *
+// OBSOLETE * where
+// OBSOLETE * # is a literal character
+// OBSOLETE *
+// OBSOLETE * <info> ASCII information; all numeric information is in the
+// OBSOLETE * form of hex digits ('0'-'9' and lowercase 'a'-'f').
+// OBSOLETE *
+// OBSOLETE * <checksum>
+// OBSOLETE * is a pair of ASCII hex digits representing an 8-bit
+// OBSOLETE * checksum formed by adding together each of the
+// OBSOLETE * characters in <info>.
+// OBSOLETE *
+// OBSOLETE * The receiver of a message always sends a single character to the sender
+// OBSOLETE * to indicate that the checksum was good ('+') or bad ('-'); the sender
+// OBSOLETE * re-transmits the entire message over until a '+' is received.
+// OBSOLETE *
+// OBSOLETE * In response to a command NINDY always sends back either data or
+// OBSOLETE * a result code of the form "Xnn", where "nn" are hex digits and "X00"
+// OBSOLETE * means no errors. (Exceptions: the "s" and "c" commands don't respond.)
+// OBSOLETE *
+// OBSOLETE * SEE THE HEADER OF THE FILE "gdb.c" IN THE NINDY MONITOR SOURCE CODE FOR A
+// OBSOLETE * FULL DESCRIPTION OF LEGAL COMMANDS.
+// OBSOLETE *
+// OBSOLETE * SEE THE FILE "stop.h" IN THE NINDY MONITOR SOURCE CODE FOR A LIST
+// OBSOLETE * OF STOP CODES.
+// OBSOLETE *
+// OBSOLETE ***************************************************************************/
+// OBSOLETE
+// OBSOLETE #include "defs.h"
+// OBSOLETE #include <signal.h>
+// OBSOLETE #include <sys/types.h>
+// OBSOLETE #include <setjmp.h>
+// OBSOLETE
+// OBSOLETE #include "frame.h"
+// OBSOLETE #include "inferior.h"
+// OBSOLETE #include "bfd.h"
+// OBSOLETE #include "symfile.h"
+// OBSOLETE #include "target.h"
+// OBSOLETE #include "gdbcore.h"
+// OBSOLETE #include "command.h"
+// OBSOLETE #include "floatformat.h"
+// OBSOLETE #include "regcache.h"
+// OBSOLETE
+// OBSOLETE #include <sys/file.h>
+// OBSOLETE #include <ctype.h>
+// OBSOLETE #include "serial.h"
+// OBSOLETE #include "nindy-share/env.h"
+// OBSOLETE #include "nindy-share/stop.h"
+// OBSOLETE #include "remote-utils.h"
+// OBSOLETE
+// OBSOLETE extern int unlink ();
+// OBSOLETE extern char *getenv ();
+// OBSOLETE extern char *mktemp ();
+// OBSOLETE
+// OBSOLETE extern void generic_mourn_inferior ();
+// OBSOLETE
+// OBSOLETE extern struct target_ops nindy_ops;
+// OBSOLETE extern FILE *instream;
+// OBSOLETE
+// OBSOLETE extern char ninStopWhy ();
+// OBSOLETE extern int ninMemGet ();
+// OBSOLETE extern int ninMemPut ();
+// OBSOLETE
+// OBSOLETE int nindy_initial_brk; /* nonzero if want to send an initial BREAK to nindy */
+// OBSOLETE int nindy_old_protocol; /* nonzero if want to use old protocol */
+// OBSOLETE char *nindy_ttyname; /* name of tty to talk to nindy on, or null */
+// OBSOLETE
+// OBSOLETE #define DLE '\020' /* Character NINDY sends to indicate user program has
+// OBSOLETE * halted. */
+// OBSOLETE #define TRUE 1
+// OBSOLETE #define FALSE 0
+// OBSOLETE
+// OBSOLETE /* From nindy-share/nindy.c. */
+// OBSOLETE extern struct serial *nindy_serial;
+// OBSOLETE
+// OBSOLETE static int have_regs = 0; /* 1 iff regs read since i960 last halted */
+// OBSOLETE static int regs_changed = 0; /* 1 iff regs were modified since last read */
+// OBSOLETE
+// OBSOLETE extern char *exists ();
+// OBSOLETE
+// OBSOLETE static void nindy_fetch_registers (int);
+// OBSOLETE
+// OBSOLETE static void nindy_store_registers (int);
+// OBSOLETE \f
+// OBSOLETE static char *savename;
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nindy_close (int quitting)
+// OBSOLETE {
+// OBSOLETE if (nindy_serial != NULL)
+// OBSOLETE serial_close (nindy_serial);
+// OBSOLETE nindy_serial = NULL;
+// OBSOLETE
+// OBSOLETE if (savename)
+// OBSOLETE xfree (savename);
+// OBSOLETE savename = 0;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Open a connection to a remote debugger.
+// OBSOLETE FIXME, there should be "set" commands for the options that are
+// OBSOLETE now specified with gdb command-line options (old_protocol,
+// OBSOLETE and initial_brk). */
+// OBSOLETE void
+// OBSOLETE nindy_open (char *name, /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
+// OBSOLETE int from_tty)
+// OBSOLETE {
+// OBSOLETE char baudrate[1024];
+// OBSOLETE
+// OBSOLETE if (!name)
+// OBSOLETE error_no_arg ("serial port device name");
+// OBSOLETE
+// OBSOLETE target_preopen (from_tty);
+// OBSOLETE
+// OBSOLETE nindy_close (0);
+// OBSOLETE
+// OBSOLETE have_regs = regs_changed = 0;
+// OBSOLETE
+// OBSOLETE /* Allow user to interrupt the following -- we could hang if there's
+// OBSOLETE no NINDY at the other end of the remote tty. */
+// OBSOLETE immediate_quit++;
+// OBSOLETE /* If baud_rate is -1, then ninConnect will not recognize the baud rate
+// OBSOLETE and will deal with the situation in a (more or less) reasonable
+// OBSOLETE fashion. */
+// OBSOLETE sprintf (baudrate, "%d", baud_rate);
+// OBSOLETE ninConnect (name, baudrate,
+// OBSOLETE nindy_initial_brk, !from_tty, nindy_old_protocol);
+// OBSOLETE immediate_quit--;
+// OBSOLETE
+// OBSOLETE if (nindy_serial == NULL)
+// OBSOLETE {
+// OBSOLETE perror_with_name (name);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE savename = savestring (name, strlen (name));
+// OBSOLETE push_target (&nindy_ops);
+// OBSOLETE
+// OBSOLETE target_fetch_registers (-1);
+// OBSOLETE
+// OBSOLETE init_thread_list ();
+// OBSOLETE init_wait_for_inferior ();
+// OBSOLETE clear_proceed_status ();
+// OBSOLETE normal_stop ();
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* User-initiated quit of nindy operations. */
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nindy_detach (char *name, int from_tty)
+// OBSOLETE {
+// OBSOLETE if (name)
+// OBSOLETE error ("Too many arguments");
+// OBSOLETE pop_target ();
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nindy_files_info (void)
+// OBSOLETE {
+// OBSOLETE /* FIXME: this lies about the baud rate if we autobauded. */
+// OBSOLETE printf_unfiltered ("\tAttached to %s at %d bits per second%s%s.\n", savename,
+// OBSOLETE baud_rate,
+// OBSOLETE nindy_old_protocol ? " in old protocol" : "",
+// OBSOLETE nindy_initial_brk ? " with initial break" : "");
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE /* Return the number of characters in the buffer BUF before
+// OBSOLETE the first DLE character. N is maximum number of characters to
+// OBSOLETE consider. */
+// OBSOLETE
+// OBSOLETE static
+// OBSOLETE int
+// OBSOLETE non_dle (char *buf, int n)
+// OBSOLETE {
+// OBSOLETE int i;
+// OBSOLETE
+// OBSOLETE for (i = 0; i < n; i++)
+// OBSOLETE {
+// OBSOLETE if (buf[i] == DLE)
+// OBSOLETE {
+// OBSOLETE break;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE return i;
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE /* Tell the remote machine to resume. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE nindy_resume (ptid_t ptid, int step, enum target_signal siggnal)
+// OBSOLETE {
+// OBSOLETE if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal)
+// OBSOLETE warning ("Can't send signals to remote NINDY targets.");
+// OBSOLETE
+// OBSOLETE if (regs_changed)
+// OBSOLETE {
+// OBSOLETE nindy_store_registers (-1);
+// OBSOLETE regs_changed = 0;
+// OBSOLETE }
+// OBSOLETE have_regs = 0;
+// OBSOLETE ninGo (step);
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE /* FIXME, we can probably use the normal terminal_inferior stuff here.
+// OBSOLETE We have to do terminal_inferior and then set up the passthrough
+// OBSOLETE settings initially. Thereafter, terminal_ours and terminal_inferior
+// OBSOLETE will automatically swap the settings around for us. */
+// OBSOLETE
+// OBSOLETE struct clean_up_tty_args
+// OBSOLETE {
+// OBSOLETE serial_ttystate state;
+// OBSOLETE struct serial *serial;
+// OBSOLETE };
+// OBSOLETE static struct clean_up_tty_args tty_args;
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE clean_up_tty (PTR ptrarg)
+// OBSOLETE {
+// OBSOLETE struct clean_up_tty_args *args = (struct clean_up_tty_args *) ptrarg;
+// OBSOLETE serial_set_tty_state (args->serial, args->state);
+// OBSOLETE xfree (args->state);
+// OBSOLETE warning ("\n\nYou may need to reset the 80960 and/or reload your program.\n");
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Recover from ^Z or ^C while remote process is running */
+// OBSOLETE static void (*old_ctrlc) ();
+// OBSOLETE #ifdef SIGTSTP
+// OBSOLETE static void (*old_ctrlz) ();
+// OBSOLETE #endif
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE clean_up_int (void)
+// OBSOLETE {
+// OBSOLETE serial_set_tty_state (tty_args.serial, tty_args.state);
+// OBSOLETE xfree (tty_args.state);
+// OBSOLETE
+// OBSOLETE signal (SIGINT, old_ctrlc);
+// OBSOLETE #ifdef SIGTSTP
+// OBSOLETE signal (SIGTSTP, old_ctrlz);
+// OBSOLETE #endif
+// OBSOLETE error ("\n\nYou may need to reset the 80960 and/or reload your program.\n");
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Wait until the remote machine stops. While waiting, operate in passthrough
+// OBSOLETE * mode; i.e., pass everything NINDY sends to gdb_stdout, and everything from
+// OBSOLETE * stdin to NINDY.
+// OBSOLETE *
+// OBSOLETE * Return to caller, storing status in 'status' just as `wait' would.
+// OBSOLETE */
+// OBSOLETE
+// OBSOLETE static ptid_t
+// OBSOLETE nindy_wait (ptid_t ptid, struct target_waitstatus *status)
+// OBSOLETE {
+// OBSOLETE fd_set fds;
+// OBSOLETE int c;
+// OBSOLETE char buf[2];
+// OBSOLETE int i, n;
+// OBSOLETE unsigned char stop_exit;
+// OBSOLETE unsigned char stop_code;
+// OBSOLETE struct cleanup *old_cleanups;
+// OBSOLETE long ip_value, fp_value, sp_value; /* Reg values from stop */
+// OBSOLETE
+// OBSOLETE status->kind = TARGET_WAITKIND_EXITED;
+// OBSOLETE status->value.integer = 0;
+// OBSOLETE
+// OBSOLETE /* OPERATE IN PASSTHROUGH MODE UNTIL NINDY SENDS A DLE CHARACTER */
+// OBSOLETE
+// OBSOLETE /* Save current tty attributes, and restore them when done. */
+// OBSOLETE tty_args.serial = serial_fdopen (0);
+// OBSOLETE tty_args.state = serial_get_tty_state (tty_args.serial);
+// OBSOLETE old_ctrlc = signal (SIGINT, clean_up_int);
+// OBSOLETE #ifdef SIGTSTP
+// OBSOLETE old_ctrlz = signal (SIGTSTP, clean_up_int);
+// OBSOLETE #endif
+// OBSOLETE
+// OBSOLETE old_cleanups = make_cleanup (clean_up_tty, &tty_args);
+// OBSOLETE
+// OBSOLETE /* Pass input from keyboard to NINDY as it arrives. NINDY will interpret
+// OBSOLETE <CR> and perform echo. */
+// OBSOLETE /* This used to set CBREAK and clear ECHO and CRMOD. I hope this is close
+// OBSOLETE enough. */
+// OBSOLETE serial_raw (tty_args.serial);
+// OBSOLETE
+// OBSOLETE while (1)
+// OBSOLETE {
+// OBSOLETE /* Input on remote */
+// OBSOLETE c = serial_readchar (nindy_serial, -1);
+// OBSOLETE if (c == SERIAL_ERROR)
+// OBSOLETE {
+// OBSOLETE error ("Cannot read from serial line");
+// OBSOLETE }
+// OBSOLETE else if (c == 0x1b) /* ESC */
+// OBSOLETE {
+// OBSOLETE c = serial_readchar (nindy_serial, -1);
+// OBSOLETE c &= ~0x40;
+// OBSOLETE }
+// OBSOLETE else if (c != 0x10) /* DLE */
+// OBSOLETE /* Write out any characters preceding DLE */
+// OBSOLETE {
+// OBSOLETE buf[0] = (char) c;
+// OBSOLETE write (1, buf, 1);
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE stop_exit = ninStopWhy (&stop_code,
+// OBSOLETE &ip_value, &fp_value, &sp_value);
+// OBSOLETE if (!stop_exit && (stop_code == STOP_SRQ))
+// OBSOLETE {
+// OBSOLETE immediate_quit++;
+// OBSOLETE ninSrq ();
+// OBSOLETE immediate_quit--;
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE /* Get out of loop */
+// OBSOLETE supply_register (IP_REGNUM,
+// OBSOLETE (char *) &ip_value);
+// OBSOLETE supply_register (FP_REGNUM,
+// OBSOLETE (char *) &fp_value);
+// OBSOLETE supply_register (SP_REGNUM,
+// OBSOLETE (char *) &sp_value);
+// OBSOLETE break;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE serial_set_tty_state (tty_args.serial, tty_args.state);
+// OBSOLETE xfree (tty_args.state);
+// OBSOLETE discard_cleanups (old_cleanups);
+// OBSOLETE
+// OBSOLETE if (stop_exit)
+// OBSOLETE {
+// OBSOLETE status->kind = TARGET_WAITKIND_EXITED;
+// OBSOLETE status->value.integer = stop_code;
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE /* nindy has some special stop code need to be handled */
+// OBSOLETE if (stop_code == STOP_GDB_BPT)
+// OBSOLETE stop_code = TRACE_STEP;
+// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED;
+// OBSOLETE status->value.sig = i960_fault_to_signal (stop_code);
+// OBSOLETE }
+// OBSOLETE return inferior_ptid;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Read the remote registers into the block REGS. */
+// OBSOLETE
+// OBSOLETE /* This is the block that ninRegsGet and ninRegsPut handles. */
+// OBSOLETE struct nindy_regs
+// OBSOLETE {
+// OBSOLETE char local_regs[16 * 4];
+// OBSOLETE char global_regs[16 * 4];
+// OBSOLETE char pcw_acw[2 * 4];
+// OBSOLETE char ip[4];
+// OBSOLETE char tcw[4];
+// OBSOLETE char fp_as_double[4 * 8];
+// OBSOLETE };
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nindy_fetch_registers (int regno)
+// OBSOLETE {
+// OBSOLETE struct nindy_regs nindy_regs;
+// OBSOLETE int regnum;
+// OBSOLETE
+// OBSOLETE immediate_quit++;
+// OBSOLETE ninRegsGet ((char *) &nindy_regs);
+// OBSOLETE immediate_quit--;
+// OBSOLETE
+// OBSOLETE memcpy (®isters[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16 * 4);
+// OBSOLETE memcpy (®isters[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16 * 4);
+// OBSOLETE memcpy (®isters[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2 * 4);
+// OBSOLETE memcpy (®isters[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1 * 4);
+// OBSOLETE memcpy (®isters[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1 * 4);
+// OBSOLETE memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8);
+// OBSOLETE
+// OBSOLETE registers_fetched ();
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nindy_prepare_to_store (void)
+// OBSOLETE {
+// OBSOLETE /* Fetch all regs if they aren't already here. */
+// OBSOLETE read_register_bytes (0, NULL, REGISTER_BYTES);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nindy_store_registers (int regno)
+// OBSOLETE {
+// OBSOLETE struct nindy_regs nindy_regs;
+// OBSOLETE int regnum;
+// OBSOLETE
+// OBSOLETE memcpy (nindy_regs.local_regs, ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * 4);
+// OBSOLETE memcpy (nindy_regs.global_regs, ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * 4);
+// OBSOLETE memcpy (nindy_regs.pcw_acw, ®isters[REGISTER_BYTE (PCW_REGNUM)], 2 * 4);
+// OBSOLETE memcpy (nindy_regs.ip, ®isters[REGISTER_BYTE (IP_REGNUM)], 1 * 4);
+// OBSOLETE memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1 * 4);
+// OBSOLETE memcpy (nindy_regs.fp_as_double, ®isters[REGISTER_BYTE (FP0_REGNUM)], 8 * 4);
+// OBSOLETE
+// OBSOLETE immediate_quit++;
+// OBSOLETE ninRegsPut ((char *) &nindy_regs);
+// OBSOLETE immediate_quit--;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
+// OBSOLETE to debugger memory starting at MYADDR. Copy to inferior if
+// OBSOLETE SHOULD_WRITE is nonzero. Returns the length copied. TARGET is
+// OBSOLETE unused. */
+// OBSOLETE
+// OBSOLETE int
+// OBSOLETE nindy_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
+// OBSOLETE int should_write, struct mem_attrib *attrib,
+// OBSOLETE struct target_ops *target)
+// OBSOLETE {
+// OBSOLETE int res;
+// OBSOLETE
+// OBSOLETE if (len <= 0)
+// OBSOLETE return 0;
+// OBSOLETE
+// OBSOLETE if (should_write)
+// OBSOLETE res = ninMemPut (memaddr, myaddr, len);
+// OBSOLETE else
+// OBSOLETE res = ninMemGet (memaddr, myaddr, len);
+// OBSOLETE
+// OBSOLETE return res;
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE static void
+// OBSOLETE nindy_create_inferior (char *execfile, char *args, char **env)
+// OBSOLETE {
+// OBSOLETE int entry_pt;
+// OBSOLETE int pid;
+// OBSOLETE
+// OBSOLETE if (args && *args)
+// OBSOLETE error ("Can't pass arguments to remote NINDY process");
+// OBSOLETE
+// OBSOLETE if (execfile == 0 || exec_bfd == 0)
+// OBSOLETE error ("No executable file specified");
+// OBSOLETE
+// OBSOLETE entry_pt = (int) bfd_get_start_address (exec_bfd);
+// OBSOLETE
+// OBSOLETE pid = 42;
+// OBSOLETE
+// OBSOLETE /* The "process" (board) is already stopped awaiting our commands, and
+// OBSOLETE the program is already downloaded. We just set its PC and go. */
+// OBSOLETE
+// OBSOLETE inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior below */
+// OBSOLETE
+// OBSOLETE clear_proceed_status ();
+// OBSOLETE
+// OBSOLETE /* Tell wait_for_inferior that we've started a new process. */
+// OBSOLETE init_wait_for_inferior ();
+// OBSOLETE
+// OBSOLETE /* Set up the "saved terminal modes" of the inferior
+// OBSOLETE based on what modes we are starting it with. */
+// OBSOLETE target_terminal_init ();
+// OBSOLETE
+// OBSOLETE /* Install inferior's terminal modes. */
+// OBSOLETE target_terminal_inferior ();
+// OBSOLETE
+// OBSOLETE /* insert_step_breakpoint (); FIXME, do we need this? */
+// OBSOLETE /* Let 'er rip... */
+// OBSOLETE proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE reset_command (char *args, int from_tty)
+// OBSOLETE {
+// OBSOLETE if (nindy_serial == NULL)
+// OBSOLETE {
+// OBSOLETE error ("No target system to reset -- use 'target nindy' command.");
+// OBSOLETE }
+// OBSOLETE if (query ("Really reset the target system?", 0, 0))
+// OBSOLETE {
+// OBSOLETE serial_send_break (nindy_serial);
+// OBSOLETE tty_flush (nindy_serial);
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE nindy_kill (char *args, int from_tty)
+// OBSOLETE {
+// OBSOLETE return; /* Ignore attempts to kill target system */
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Clean up when a program exits.
+// OBSOLETE
+// OBSOLETE The program actually lives on in the remote processor's RAM, and may be
+// OBSOLETE run again without a download. Don't leave it full of breakpoint
+// OBSOLETE instructions. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE nindy_mourn_inferior (void)
+// OBSOLETE {
+// OBSOLETE remove_breakpoints ();
+// OBSOLETE unpush_target (&nindy_ops);
+// OBSOLETE generic_mourn_inferior (); /* Do all the proper things now */
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE /* Pass the args the way catch_errors wants them. */
+// OBSOLETE static int
+// OBSOLETE nindy_open_stub (char *arg)
+// OBSOLETE {
+// OBSOLETE nindy_open (arg, 1);
+// OBSOLETE return 1;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nindy_load (char *filename, int from_tty)
+// OBSOLETE {
+// OBSOLETE asection *s;
+// OBSOLETE /* Can't do unix style forking on a VMS system, so we'll use bfd to do
+// OBSOLETE all the work for us
+// OBSOLETE */
+// OBSOLETE
+// OBSOLETE bfd *file = bfd_openr (filename, 0);
+// OBSOLETE if (!file)
+// OBSOLETE {
+// OBSOLETE perror_with_name (filename);
+// OBSOLETE return;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE if (!bfd_check_format (file, bfd_object))
+// OBSOLETE {
+// OBSOLETE error ("can't prove it's an object file\n");
+// OBSOLETE return;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE for (s = file->sections; s; s = s->next)
+// OBSOLETE {
+// OBSOLETE if (s->flags & SEC_LOAD)
+// OBSOLETE {
+// OBSOLETE char *buffer = xmalloc (s->_raw_size);
+// OBSOLETE bfd_get_section_contents (file, s, buffer, 0, s->_raw_size);
+// OBSOLETE printf ("Loading section %s, size %x vma %x\n",
+// OBSOLETE s->name,
+// OBSOLETE s->_raw_size,
+// OBSOLETE s->vma);
+// OBSOLETE ninMemPut (s->vma, buffer, s->_raw_size);
+// OBSOLETE xfree (buffer);
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE bfd_close (file);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static int
+// OBSOLETE load_stub (char *arg)
+// OBSOLETE {
+// OBSOLETE target_load (arg, 1);
+// OBSOLETE return 1;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* This routine is run as a hook, just before the main command loop is
+// OBSOLETE entered. If gdb is configured for the i960, but has not had its
+// OBSOLETE nindy target specified yet, this will loop prompting the user to do so.
+// OBSOLETE
+// OBSOLETE Unlike the loop provided by Intel, we actually let the user get out
+// OBSOLETE of this with a RETURN. This is useful when e.g. simply examining
+// OBSOLETE an i960 object file on the host system. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE nindy_before_main_loop (void)
+// OBSOLETE {
+// OBSOLETE char ttyname[100];
+// OBSOLETE char *p, *p2;
+// OBSOLETE
+// OBSOLETE while (target_stack->target_ops != &nindy_ops) /* What is this crap??? */
+// OBSOLETE { /* remote tty not specified yet */
+// OBSOLETE if (instream == stdin)
+// OBSOLETE {
+// OBSOLETE printf_unfiltered ("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: ");
+// OBSOLETE gdb_flush (gdb_stdout);
+// OBSOLETE }
+// OBSOLETE fgets (ttyname, sizeof (ttyname) - 1, stdin);
+// OBSOLETE
+// OBSOLETE /* Strip leading and trailing whitespace */
+// OBSOLETE for (p = ttyname; isspace (*p); p++)
+// OBSOLETE {
+// OBSOLETE ;
+// OBSOLETE }
+// OBSOLETE if (*p == '\0')
+// OBSOLETE {
+// OBSOLETE return; /* User just hit spaces or return, wants out */
+// OBSOLETE }
+// OBSOLETE for (p2 = p; !isspace (*p2) && (*p2 != '\0'); p2++)
+// OBSOLETE {
+// OBSOLETE ;
+// OBSOLETE }
+// OBSOLETE *p2 = '\0';
+// OBSOLETE if (STREQ ("quit", p))
+// OBSOLETE {
+// OBSOLETE exit (1);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE if (catch_errors (nindy_open_stub, p, "", RETURN_MASK_ALL))
+// OBSOLETE {
+// OBSOLETE /* Now that we have a tty open for talking to the remote machine,
+// OBSOLETE download the executable file if one was specified. */
+// OBSOLETE if (exec_bfd)
+// OBSOLETE {
+// OBSOLETE catch_errors (load_stub, bfd_get_filename (exec_bfd), "",
+// OBSOLETE RETURN_MASK_ALL);
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE \f
+// OBSOLETE /* Define the target subroutine names */
+// OBSOLETE
+// OBSOLETE struct target_ops nindy_ops;
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE init_nindy_ops (void)
+// OBSOLETE {
+// OBSOLETE nindy_ops.to_shortname = "nindy";
+// OBSOLETE "Remote serial target in i960 NINDY-specific protocol",
+// OBSOLETE nindy_ops.to_longname = "Use a remote i960 system running NINDY connected by a serial line.\n\
+// OBSOLETE Specify the name of the device the serial line is connected to.\n\
+// OBSOLETE The speed (baud rate), whether to use the old NINDY protocol,\n\
+// OBSOLETE and whether to send a break on startup, are controlled by options\n\
+// OBSOLETE specified when you started GDB.";
+// OBSOLETE nindy_ops.to_doc = "";
+// OBSOLETE nindy_ops.to_open = nindy_open;
+// OBSOLETE nindy_ops.to_close = nindy_close;
+// OBSOLETE nindy_ops.to_attach = 0;
+// OBSOLETE nindy_ops.to_post_attach = NULL;
+// OBSOLETE nindy_ops.to_require_attach = NULL;
+// OBSOLETE nindy_ops.to_detach = nindy_detach;
+// OBSOLETE nindy_ops.to_require_detach = NULL;
+// OBSOLETE nindy_ops.to_resume = nindy_resume;
+// OBSOLETE nindy_ops.to_wait = nindy_wait;
+// OBSOLETE nindy_ops.to_post_wait = NULL;
+// OBSOLETE nindy_ops.to_fetch_registers = nindy_fetch_registers;
+// OBSOLETE nindy_ops.to_store_registers = nindy_store_registers;
+// OBSOLETE nindy_ops.to_prepare_to_store = nindy_prepare_to_store;
+// OBSOLETE nindy_ops.to_xfer_memory = nindy_xfer_inferior_memory;
+// OBSOLETE nindy_ops.to_files_info = nindy_files_info;
+// OBSOLETE nindy_ops.to_insert_breakpoint = memory_insert_breakpoint;
+// OBSOLETE nindy_ops.to_remove_breakpoint = memory_remove_breakpoint;
+// OBSOLETE nindy_ops.to_terminal_init = 0;
+// OBSOLETE nindy_ops.to_terminal_inferior = 0;
+// OBSOLETE nindy_ops.to_terminal_ours_for_output = 0;
+// OBSOLETE nindy_ops.to_terminal_ours = 0;
+// OBSOLETE nindy_ops.to_terminal_info = 0; /* Terminal crud */
+// OBSOLETE nindy_ops.to_kill = nindy_kill;
+// OBSOLETE nindy_ops.to_load = nindy_load;
+// OBSOLETE nindy_ops.to_lookup_symbol = 0; /* lookup_symbol */
+// OBSOLETE nindy_ops.to_create_inferior = nindy_create_inferior;
+// OBSOLETE nindy_ops.to_post_startup_inferior = NULL;
+// OBSOLETE nindy_ops.to_acknowledge_created_inferior = NULL;
+// OBSOLETE nindy_ops.to_clone_and_follow_inferior = NULL;
+// OBSOLETE nindy_ops.to_post_follow_inferior_by_clone = NULL;
+// OBSOLETE nindy_ops.to_insert_fork_catchpoint = NULL;
+// OBSOLETE nindy_ops.to_remove_fork_catchpoint = NULL;
+// OBSOLETE nindy_ops.to_insert_vfork_catchpoint = NULL;
+// OBSOLETE nindy_ops.to_remove_vfork_catchpoint = NULL;
+// OBSOLETE nindy_ops.to_has_forked = NULL;
+// OBSOLETE nindy_ops.to_has_vforked = NULL;
+// OBSOLETE nindy_ops.to_can_follow_vfork_prior_to_exec = NULL;
+// OBSOLETE nindy_ops.to_post_follow_vfork = NULL;
+// OBSOLETE nindy_ops.to_insert_exec_catchpoint = NULL;
+// OBSOLETE nindy_ops.to_remove_exec_catchpoint = NULL;
+// OBSOLETE nindy_ops.to_has_execd = NULL;
+// OBSOLETE nindy_ops.to_reported_exec_events_per_exec_call = NULL;
+// OBSOLETE nindy_ops.to_has_exited = NULL;
+// OBSOLETE nindy_ops.to_mourn_inferior = nindy_mourn_inferior;
+// OBSOLETE nindy_ops.to_can_run = 0; /* can_run */
+// OBSOLETE nindy_ops.to_notice_signals = 0; /* notice_signals */
+// OBSOLETE nindy_ops.to_thread_alive = 0; /* to_thread_alive */
+// OBSOLETE nindy_ops.to_stop = 0; /* to_stop */
+// OBSOLETE nindy_ops.to_pid_to_exec_file = NULL;
+// OBSOLETE nindy_ops.to_stratum = process_stratum;
+// OBSOLETE nindy_ops.DONT_USE = 0; /* next */
+// OBSOLETE nindy_ops.to_has_all_memory = 1;
+// OBSOLETE nindy_ops.to_has_memory = 1;
+// OBSOLETE nindy_ops.to_has_stack = 1;
+// OBSOLETE nindy_ops.to_has_registers = 1;
+// OBSOLETE nindy_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */
+// OBSOLETE nindy_ops.to_sections = 0;
+// OBSOLETE nindy_ops.to_sections_end = 0; /* Section pointers */
+// OBSOLETE nindy_ops.to_magic = OPS_MAGIC; /* Always the last thing */
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE _initialize_nindy (void)
+// OBSOLETE {
+// OBSOLETE init_nindy_ops ();
+// OBSOLETE add_target (&nindy_ops);
+// OBSOLETE add_com ("reset", class_obscure, reset_command,
+// OBSOLETE "Send a 'break' to the remote target system.\n\
+// OBSOLETE Only useful if the target has been equipped with a circuit\n\
+// OBSOLETE to perform a hard reset when a break is detected.");
+// OBSOLETE }
-/* Remote debugging with the XLNT Designs, Inc (XDI) NetROM.
- Copyright 1990, 1991, 1992, 1995, 1998, 1999, 2000
- Free Software Foundation, Inc.
- Contributed by:
- Roger Moyers
- XLNT Designs, Inc.
- 15050 Avenue of Science, Suite 106
- San Diego, CA 92128
- (619)487-9320
- roger@xlnt.com
- Adapted from work done at Cygnus Support in remote-nindy.c,
- later merged in by Stan Shebs at Cygnus.
-
- 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 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. */
-
-#include "defs.h"
-#include "gdbcmd.h"
-#include "serial.h"
-#include "target.h"
-
-/* Default ports used to talk with the NetROM. */
-
-#define DEFAULT_NETROM_LOAD_PORT 1236
-#define DEFAULT_NETROM_CONTROL_PORT 1237
-
-static void nrom_close (int quitting);
-
-/* New commands. */
-
-static void nrom_passthru (char *, int);
-
-/* We talk to the NetROM over these sockets. */
-
-static struct serial *load_desc = NULL;
-static struct serial *ctrl_desc = NULL;
-
-static int load_port = DEFAULT_NETROM_LOAD_PORT;
-static int control_port = DEFAULT_NETROM_CONTROL_PORT;
-
-static char nrom_hostname[100];
-
-/* Forward data declaration. */
-
-extern struct target_ops nrom_ops;
-
-/* Scan input from the remote system, until STRING is found. Print chars that
- don't match. */
-
-static int
-expect (char *string)
-{
- char *p = string;
- int c;
-
- immediate_quit++;
-
- while (1)
- {
- c = serial_readchar (ctrl_desc, 5);
-
- if (c == *p++)
- {
- if (*p == '\0')
- {
- immediate_quit--;
- return 0;
- }
- }
- else
- {
- fputc_unfiltered (c, gdb_stdout);
- p = string;
- if (c == *p)
- p++;
- }
- }
-}
-
-static void
-nrom_kill (void)
-{
- nrom_close (0);
-}
-
-static struct serial *
-open_socket (char *name, int port)
-{
- char sockname[100];
- struct serial *desc;
-
- sprintf (sockname, "%s:%d", name, port);
- desc = serial_open (sockname);
- if (!desc)
- perror_with_name (sockname);
-
- return desc;
-}
-
-static void
-load_cleanup (void)
-{
- serial_close (load_desc);
- load_desc = NULL;
-}
-
-/* Download a file specified in ARGS to the netROM. */
-
-static void
-nrom_load (char *args, int fromtty)
-{
- int fd, rd_amt, fsize;
- bfd *pbfd;
- asection *section;
- char *downloadstring = "download 0\n";
- struct cleanup *old_chain;
-
- /* Tell the netrom to get ready to download. */
- if (serial_write (ctrl_desc, downloadstring, strlen (downloadstring)))
- error ("nrom_load: control_send() of `%s' failed", downloadstring);
-
- expect ("Waiting for a connection...\n");
-
- load_desc = open_socket (nrom_hostname, load_port);
-
- old_chain = make_cleanup (load_cleanup, 0);
-
- pbfd = bfd_openr (args, 0);
-
- if (pbfd)
- {
- make_cleanup (bfd_close, pbfd);
-
- if (!bfd_check_format (pbfd, bfd_object))
- error ("\"%s\": not in executable format: %s",
- args, bfd_errmsg (bfd_get_error ()));
-
- for (section = pbfd->sections; section; section = section->next)
- {
- if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC)
- {
- bfd_vma section_address;
- unsigned long section_size;
- const char *section_name;
-
- section_name = bfd_get_section_name (pbfd, section);
- section_address = bfd_get_section_vma (pbfd, section);
- section_size = bfd_section_size (pbfd, section);
-
- if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)
- {
- file_ptr fptr;
-
- printf_filtered ("[Loading section %s at %x (%d bytes)]\n",
- section_name, section_address,
- section_size);
-
- fptr = 0;
-
- while (section_size > 0)
- {
- char buffer[1024];
- int count;
-
- count = min (section_size, 1024);
-
- bfd_get_section_contents (pbfd, section, buffer, fptr,
- count);
-
- serial_write (load_desc, buffer, count);
- section_address += count;
- fptr += count;
- section_size -= count;
- }
- }
- else
- /* BSS and such */
- {
- printf_filtered ("[section %s: not loading]\n",
- section_name);
- }
- }
- }
- }
- else
- error ("\"%s\": Could not open", args);
-
- do_cleanups (old_chain);
-}
-
-/* Open a connection to the remote NetROM devices. */
-
-static void
-nrom_open (char *name, int from_tty)
-{
- int errn;
-
- if (!name || strchr (name, '/') || strchr (name, ':'))
- error (
- "To open a NetROM connection, you must specify the hostname\n\
-or IP address of the NetROM device you wish to use.");
-
- strcpy (nrom_hostname, name);
-
- target_preopen (from_tty);
-
- unpush_target (&nrom_ops);
-
- ctrl_desc = open_socket (nrom_hostname, control_port);
-
- push_target (&nrom_ops);
-
- if (from_tty)
- printf_filtered ("Connected to NetROM device \"%s\"\n", nrom_hostname);
-}
-
-/* Close out all files and local state before this target loses control. */
-
-static void
-nrom_close (int quitting)
-{
- if (load_desc)
- serial_close (load_desc);
- if (ctrl_desc)
- serial_close (ctrl_desc);
-}
-
-/* Pass arguments directly to the NetROM. */
-
-static void
-nrom_passthru (char *args, int fromtty)
-{
- char buf[1024];
-
- sprintf (buf, "%s\n", args);
- if (serial_write (ctrl_desc, buf, strlen (buf)))
- error ("nrom_reset: control_send() of `%s'failed", args);
-}
-
-static void
-nrom_mourn (void)
-{
- unpush_target (&nrom_ops);
- generic_mourn_inferior ();
-}
-
-/* Define the target vector. */
-
-struct target_ops nrom_ops;
-
-static void
-init_nrom_ops (void)
-{
- nrom_ops.to_shortname = "nrom";
- nrom_ops.to_longname = "Remote XDI `NetROM' target";
- nrom_ops.to_doc = "Remote debug using a NetROM over Ethernet";
- nrom_ops.to_open = nrom_open;
- nrom_ops.to_close = nrom_close;
- nrom_ops.to_attach = NULL;
- nrom_ops.to_post_attach = NULL;
- nrom_ops.to_require_attach = NULL;
- nrom_ops.to_detach = NULL;
- nrom_ops.to_require_detach = NULL;
- nrom_ops.to_resume = NULL;
- nrom_ops.to_wait = NULL;
- nrom_ops.to_post_wait = NULL;
- nrom_ops.to_fetch_registers = NULL;
- nrom_ops.to_store_registers = NULL;
- nrom_ops.to_prepare_to_store = NULL;
- nrom_ops.to_xfer_memory = NULL;
- nrom_ops.to_files_info = NULL;
- nrom_ops.to_insert_breakpoint = NULL;
- nrom_ops.to_remove_breakpoint = NULL;
- nrom_ops.to_terminal_init = NULL;
- nrom_ops.to_terminal_inferior = NULL;
- nrom_ops.to_terminal_ours_for_output = NULL;
- nrom_ops.to_terminal_ours = NULL;
- nrom_ops.to_terminal_info = NULL;
- nrom_ops.to_kill = nrom_kill;
- nrom_ops.to_load = nrom_load;
- nrom_ops.to_lookup_symbol = NULL;
- nrom_ops.to_create_inferior = NULL;
- nrom_ops.to_post_startup_inferior = NULL;
- nrom_ops.to_acknowledge_created_inferior = NULL;
- nrom_ops.to_clone_and_follow_inferior = NULL;
- nrom_ops.to_post_follow_inferior_by_clone = NULL;
- nrom_ops.to_insert_fork_catchpoint = NULL;
- nrom_ops.to_remove_fork_catchpoint = NULL;
- nrom_ops.to_insert_vfork_catchpoint = NULL;
- nrom_ops.to_remove_vfork_catchpoint = NULL;
- nrom_ops.to_has_forked = NULL;
- nrom_ops.to_has_vforked = NULL;
- nrom_ops.to_can_follow_vfork_prior_to_exec = NULL;
- nrom_ops.to_post_follow_vfork = NULL;
- nrom_ops.to_insert_exec_catchpoint = NULL;
- nrom_ops.to_remove_exec_catchpoint = NULL;
- nrom_ops.to_has_execd = NULL;
- nrom_ops.to_reported_exec_events_per_exec_call = NULL;
- nrom_ops.to_has_exited = NULL;
- nrom_ops.to_mourn_inferior = nrom_mourn;
- nrom_ops.to_can_run = NULL;
- nrom_ops.to_notice_signals = 0;
- nrom_ops.to_thread_alive = 0;
- nrom_ops.to_stop = 0;
- nrom_ops.to_pid_to_exec_file = NULL;
- nrom_ops.to_stratum = download_stratum;
- nrom_ops.DONT_USE = NULL;
- nrom_ops.to_has_all_memory = 1;
- nrom_ops.to_has_memory = 1;
- nrom_ops.to_has_stack = 1;
- nrom_ops.to_has_registers = 1;
- nrom_ops.to_has_execution = 0;
- nrom_ops.to_sections = NULL;
- nrom_ops.to_sections_end = NULL;
- nrom_ops.to_magic = OPS_MAGIC;
-}
-
-void
-_initialize_remote_nrom (void)
-{
- init_nrom_ops ();
- add_target (&nrom_ops);
-
- add_show_from_set (
- add_set_cmd ("nrom_load_port", no_class, var_zinteger, (char *) &load_port,
- "Set the port to use for NetROM downloads\n", &setlist),
- &showlist);
-
- add_show_from_set (
- add_set_cmd ("nrom_control_port", no_class, var_zinteger, (char *) &control_port,
- "Set the port to use for NetROM debugger services\n", &setlist),
- &showlist);
-
- add_cmd ("nrom", no_class, nrom_passthru,
- "Pass arguments as command to NetROM",
- &cmdlist);
-}
+// OBSOLETE /* Remote debugging with the XLNT Designs, Inc (XDI) NetROM.
+// OBSOLETE Copyright 1990, 1991, 1992, 1995, 1998, 1999, 2000
+// OBSOLETE Free Software Foundation, Inc.
+// OBSOLETE Contributed by:
+// OBSOLETE Roger Moyers
+// OBSOLETE XLNT Designs, Inc.
+// OBSOLETE 15050 Avenue of Science, Suite 106
+// OBSOLETE San Diego, CA 92128
+// OBSOLETE (619)487-9320
+// OBSOLETE roger@xlnt.com
+// OBSOLETE Adapted from work done at Cygnus Support in remote-nindy.c,
+// OBSOLETE later merged in by Stan Shebs at Cygnus.
+// OBSOLETE
+// OBSOLETE This file is part of GDB.
+// OBSOLETE
+// OBSOLETE This program is free software; you can redistribute it and/or modify
+// OBSOLETE it under the terms of the GNU General Public License as published by
+// OBSOLETE the Free Software Foundation; either version 2 of the License, or
+// OBSOLETE (at your option) any later version.
+// OBSOLETE
+// OBSOLETE This program is distributed in the hope that it will be useful,
+// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
+// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// OBSOLETE GNU General Public License for more details.
+// OBSOLETE
+// OBSOLETE You should have received a copy of the GNU General Public License
+// OBSOLETE along with this program; if not, write to the Free Software
+// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
+// OBSOLETE Boston, MA 02111-1307, USA. */
+// OBSOLETE
+// OBSOLETE #include "defs.h"
+// OBSOLETE #include "gdbcmd.h"
+// OBSOLETE #include "serial.h"
+// OBSOLETE #include "target.h"
+// OBSOLETE
+// OBSOLETE /* Default ports used to talk with the NetROM. */
+// OBSOLETE
+// OBSOLETE #define DEFAULT_NETROM_LOAD_PORT 1236
+// OBSOLETE #define DEFAULT_NETROM_CONTROL_PORT 1237
+// OBSOLETE
+// OBSOLETE static void nrom_close (int quitting);
+// OBSOLETE
+// OBSOLETE /* New commands. */
+// OBSOLETE
+// OBSOLETE static void nrom_passthru (char *, int);
+// OBSOLETE
+// OBSOLETE /* We talk to the NetROM over these sockets. */
+// OBSOLETE
+// OBSOLETE static struct serial *load_desc = NULL;
+// OBSOLETE static struct serial *ctrl_desc = NULL;
+// OBSOLETE
+// OBSOLETE static int load_port = DEFAULT_NETROM_LOAD_PORT;
+// OBSOLETE static int control_port = DEFAULT_NETROM_CONTROL_PORT;
+// OBSOLETE
+// OBSOLETE static char nrom_hostname[100];
+// OBSOLETE
+// OBSOLETE /* Forward data declaration. */
+// OBSOLETE
+// OBSOLETE extern struct target_ops nrom_ops;
+// OBSOLETE
+// OBSOLETE /* Scan input from the remote system, until STRING is found. Print chars that
+// OBSOLETE don't match. */
+// OBSOLETE
+// OBSOLETE static int
+// OBSOLETE expect (char *string)
+// OBSOLETE {
+// OBSOLETE char *p = string;
+// OBSOLETE int c;
+// OBSOLETE
+// OBSOLETE immediate_quit++;
+// OBSOLETE
+// OBSOLETE while (1)
+// OBSOLETE {
+// OBSOLETE c = serial_readchar (ctrl_desc, 5);
+// OBSOLETE
+// OBSOLETE if (c == *p++)
+// OBSOLETE {
+// OBSOLETE if (*p == '\0')
+// OBSOLETE {
+// OBSOLETE immediate_quit--;
+// OBSOLETE return 0;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE fputc_unfiltered (c, gdb_stdout);
+// OBSOLETE p = string;
+// OBSOLETE if (c == *p)
+// OBSOLETE p++;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nrom_kill (void)
+// OBSOLETE {
+// OBSOLETE nrom_close (0);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static struct serial *
+// OBSOLETE open_socket (char *name, int port)
+// OBSOLETE {
+// OBSOLETE char sockname[100];
+// OBSOLETE struct serial *desc;
+// OBSOLETE
+// OBSOLETE sprintf (sockname, "%s:%d", name, port);
+// OBSOLETE desc = serial_open (sockname);
+// OBSOLETE if (!desc)
+// OBSOLETE perror_with_name (sockname);
+// OBSOLETE
+// OBSOLETE return desc;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE load_cleanup (void)
+// OBSOLETE {
+// OBSOLETE serial_close (load_desc);
+// OBSOLETE load_desc = NULL;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Download a file specified in ARGS to the netROM. */
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nrom_load (char *args, int fromtty)
+// OBSOLETE {
+// OBSOLETE int fd, rd_amt, fsize;
+// OBSOLETE bfd *pbfd;
+// OBSOLETE asection *section;
+// OBSOLETE char *downloadstring = "download 0\n";
+// OBSOLETE struct cleanup *old_chain;
+// OBSOLETE
+// OBSOLETE /* Tell the netrom to get ready to download. */
+// OBSOLETE if (serial_write (ctrl_desc, downloadstring, strlen (downloadstring)))
+// OBSOLETE error ("nrom_load: control_send() of `%s' failed", downloadstring);
+// OBSOLETE
+// OBSOLETE expect ("Waiting for a connection...\n");
+// OBSOLETE
+// OBSOLETE load_desc = open_socket (nrom_hostname, load_port);
+// OBSOLETE
+// OBSOLETE old_chain = make_cleanup (load_cleanup, 0);
+// OBSOLETE
+// OBSOLETE pbfd = bfd_openr (args, 0);
+// OBSOLETE
+// OBSOLETE if (pbfd)
+// OBSOLETE {
+// OBSOLETE make_cleanup (bfd_close, pbfd);
+// OBSOLETE
+// OBSOLETE if (!bfd_check_format (pbfd, bfd_object))
+// OBSOLETE error ("\"%s\": not in executable format: %s",
+// OBSOLETE args, bfd_errmsg (bfd_get_error ()));
+// OBSOLETE
+// OBSOLETE for (section = pbfd->sections; section; section = section->next)
+// OBSOLETE {
+// OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC)
+// OBSOLETE {
+// OBSOLETE bfd_vma section_address;
+// OBSOLETE unsigned long section_size;
+// OBSOLETE const char *section_name;
+// OBSOLETE
+// OBSOLETE section_name = bfd_get_section_name (pbfd, section);
+// OBSOLETE section_address = bfd_get_section_vma (pbfd, section);
+// OBSOLETE section_size = bfd_section_size (pbfd, section);
+// OBSOLETE
+// OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)
+// OBSOLETE {
+// OBSOLETE file_ptr fptr;
+// OBSOLETE
+// OBSOLETE printf_filtered ("[Loading section %s at %x (%d bytes)]\n",
+// OBSOLETE section_name, section_address,
+// OBSOLETE section_size);
+// OBSOLETE
+// OBSOLETE fptr = 0;
+// OBSOLETE
+// OBSOLETE while (section_size > 0)
+// OBSOLETE {
+// OBSOLETE char buffer[1024];
+// OBSOLETE int count;
+// OBSOLETE
+// OBSOLETE count = min (section_size, 1024);
+// OBSOLETE
+// OBSOLETE bfd_get_section_contents (pbfd, section, buffer, fptr,
+// OBSOLETE count);
+// OBSOLETE
+// OBSOLETE serial_write (load_desc, buffer, count);
+// OBSOLETE section_address += count;
+// OBSOLETE fptr += count;
+// OBSOLETE section_size -= count;
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE /* BSS and such */
+// OBSOLETE {
+// OBSOLETE printf_filtered ("[section %s: not loading]\n",
+// OBSOLETE section_name);
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE error ("\"%s\": Could not open", args);
+// OBSOLETE
+// OBSOLETE do_cleanups (old_chain);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Open a connection to the remote NetROM devices. */
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nrom_open (char *name, int from_tty)
+// OBSOLETE {
+// OBSOLETE int errn;
+// OBSOLETE
+// OBSOLETE if (!name || strchr (name, '/') || strchr (name, ':'))
+// OBSOLETE error (
+// OBSOLETE "To open a NetROM connection, you must specify the hostname\n\
+// OBSOLETE or IP address of the NetROM device you wish to use.");
+// OBSOLETE
+// OBSOLETE strcpy (nrom_hostname, name);
+// OBSOLETE
+// OBSOLETE target_preopen (from_tty);
+// OBSOLETE
+// OBSOLETE unpush_target (&nrom_ops);
+// OBSOLETE
+// OBSOLETE ctrl_desc = open_socket (nrom_hostname, control_port);
+// OBSOLETE
+// OBSOLETE push_target (&nrom_ops);
+// OBSOLETE
+// OBSOLETE if (from_tty)
+// OBSOLETE printf_filtered ("Connected to NetROM device \"%s\"\n", nrom_hostname);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Close out all files and local state before this target loses control. */
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nrom_close (int quitting)
+// OBSOLETE {
+// OBSOLETE if (load_desc)
+// OBSOLETE serial_close (load_desc);
+// OBSOLETE if (ctrl_desc)
+// OBSOLETE serial_close (ctrl_desc);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Pass arguments directly to the NetROM. */
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nrom_passthru (char *args, int fromtty)
+// OBSOLETE {
+// OBSOLETE char buf[1024];
+// OBSOLETE
+// OBSOLETE sprintf (buf, "%s\n", args);
+// OBSOLETE if (serial_write (ctrl_desc, buf, strlen (buf)))
+// OBSOLETE error ("nrom_reset: control_send() of `%s'failed", args);
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE nrom_mourn (void)
+// OBSOLETE {
+// OBSOLETE unpush_target (&nrom_ops);
+// OBSOLETE generic_mourn_inferior ();
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Define the target vector. */
+// OBSOLETE
+// OBSOLETE struct target_ops nrom_ops;
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE init_nrom_ops (void)
+// OBSOLETE {
+// OBSOLETE nrom_ops.to_shortname = "nrom";
+// OBSOLETE nrom_ops.to_longname = "Remote XDI `NetROM' target";
+// OBSOLETE nrom_ops.to_doc = "Remote debug using a NetROM over Ethernet";
+// OBSOLETE nrom_ops.to_open = nrom_open;
+// OBSOLETE nrom_ops.to_close = nrom_close;
+// OBSOLETE nrom_ops.to_attach = NULL;
+// OBSOLETE nrom_ops.to_post_attach = NULL;
+// OBSOLETE nrom_ops.to_require_attach = NULL;
+// OBSOLETE nrom_ops.to_detach = NULL;
+// OBSOLETE nrom_ops.to_require_detach = NULL;
+// OBSOLETE nrom_ops.to_resume = NULL;
+// OBSOLETE nrom_ops.to_wait = NULL;
+// OBSOLETE nrom_ops.to_post_wait = NULL;
+// OBSOLETE nrom_ops.to_fetch_registers = NULL;
+// OBSOLETE nrom_ops.to_store_registers = NULL;
+// OBSOLETE nrom_ops.to_prepare_to_store = NULL;
+// OBSOLETE nrom_ops.to_xfer_memory = NULL;
+// OBSOLETE nrom_ops.to_files_info = NULL;
+// OBSOLETE nrom_ops.to_insert_breakpoint = NULL;
+// OBSOLETE nrom_ops.to_remove_breakpoint = NULL;
+// OBSOLETE nrom_ops.to_terminal_init = NULL;
+// OBSOLETE nrom_ops.to_terminal_inferior = NULL;
+// OBSOLETE nrom_ops.to_terminal_ours_for_output = NULL;
+// OBSOLETE nrom_ops.to_terminal_ours = NULL;
+// OBSOLETE nrom_ops.to_terminal_info = NULL;
+// OBSOLETE nrom_ops.to_kill = nrom_kill;
+// OBSOLETE nrom_ops.to_load = nrom_load;
+// OBSOLETE nrom_ops.to_lookup_symbol = NULL;
+// OBSOLETE nrom_ops.to_create_inferior = NULL;
+// OBSOLETE nrom_ops.to_post_startup_inferior = NULL;
+// OBSOLETE nrom_ops.to_acknowledge_created_inferior = NULL;
+// OBSOLETE nrom_ops.to_clone_and_follow_inferior = NULL;
+// OBSOLETE nrom_ops.to_post_follow_inferior_by_clone = NULL;
+// OBSOLETE nrom_ops.to_insert_fork_catchpoint = NULL;
+// OBSOLETE nrom_ops.to_remove_fork_catchpoint = NULL;
+// OBSOLETE nrom_ops.to_insert_vfork_catchpoint = NULL;
+// OBSOLETE nrom_ops.to_remove_vfork_catchpoint = NULL;
+// OBSOLETE nrom_ops.to_has_forked = NULL;
+// OBSOLETE nrom_ops.to_has_vforked = NULL;
+// OBSOLETE nrom_ops.to_can_follow_vfork_prior_to_exec = NULL;
+// OBSOLETE nrom_ops.to_post_follow_vfork = NULL;
+// OBSOLETE nrom_ops.to_insert_exec_catchpoint = NULL;
+// OBSOLETE nrom_ops.to_remove_exec_catchpoint = NULL;
+// OBSOLETE nrom_ops.to_has_execd = NULL;
+// OBSOLETE nrom_ops.to_reported_exec_events_per_exec_call = NULL;
+// OBSOLETE nrom_ops.to_has_exited = NULL;
+// OBSOLETE nrom_ops.to_mourn_inferior = nrom_mourn;
+// OBSOLETE nrom_ops.to_can_run = NULL;
+// OBSOLETE nrom_ops.to_notice_signals = 0;
+// OBSOLETE nrom_ops.to_thread_alive = 0;
+// OBSOLETE nrom_ops.to_stop = 0;
+// OBSOLETE nrom_ops.to_pid_to_exec_file = NULL;
+// OBSOLETE nrom_ops.to_stratum = download_stratum;
+// OBSOLETE nrom_ops.DONT_USE = NULL;
+// OBSOLETE nrom_ops.to_has_all_memory = 1;
+// OBSOLETE nrom_ops.to_has_memory = 1;
+// OBSOLETE nrom_ops.to_has_stack = 1;
+// OBSOLETE nrom_ops.to_has_registers = 1;
+// OBSOLETE nrom_ops.to_has_execution = 0;
+// OBSOLETE nrom_ops.to_sections = NULL;
+// OBSOLETE nrom_ops.to_sections_end = NULL;
+// OBSOLETE nrom_ops.to_magic = OPS_MAGIC;
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE _initialize_remote_nrom (void)
+// OBSOLETE {
+// OBSOLETE init_nrom_ops ();
+// OBSOLETE add_target (&nrom_ops);
+// OBSOLETE
+// OBSOLETE add_show_from_set (
+// OBSOLETE add_set_cmd ("nrom_load_port", no_class, var_zinteger, (char *) &load_port,
+// OBSOLETE "Set the port to use for NetROM downloads\n", &setlist),
+// OBSOLETE &showlist);
+// OBSOLETE
+// OBSOLETE add_show_from_set (
+// OBSOLETE add_set_cmd ("nrom_control_port", no_class, var_zinteger, (char *) &control_port,
+// OBSOLETE "Set the port to use for NetROM debugger services\n", &setlist),
+// OBSOLETE &showlist);
+// OBSOLETE
+// OBSOLETE add_cmd ("nrom", no_class, nrom_passthru,
+// OBSOLETE "Pass arguments as command to NetROM",
+// OBSOLETE &cmdlist);
+// OBSOLETE }
-/* i80960-dependent portions of the RPC protocol
- used with a VxWorks target
-
- Contributed by Wind River Systems.
-
- 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 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. */
-
-#include <stdio.h>
-#include "defs.h"
-
-#include "vx-share/regPacket.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
-#include "regcache.h"
-
-#include "gdb_string.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-
-#ifdef _AIX /* IBM claims "void *malloc()" not char * */
-#define malloc bogon_malloc
-#endif
-
-#include <rpc/rpc.h>
-#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
-#include <netdb.h>
-#include "vx-share/ptrace.h"
-#include "vx-share/xdr_ptrace.h"
-#include "vx-share/xdr_ld.h"
-#include "vx-share/xdr_rdb.h"
-#include "vx-share/dbgRpcLib.h"
-
-/* get rid of value.h if possible */
-#include <value.h>
-#include <symtab.h>
-
-/* Flag set if target has fpu */
-
-extern int target_has_fp;
-
-/* 960 floating point format descriptor, from "i960-tdep.c." */
-
-extern struct ext_format ext_format_i960;
-
-/* Generic register read/write routines in remote-vx.c. */
-
-extern void net_read_registers ();
-extern void net_write_registers ();
-
-/* Read a register or registers from the VxWorks target.
- REGNO is the register to read, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_read_register (int regno)
-{
- char i960_greg_packet[I960_GREG_PLEN];
- char i960_fpreg_packet[I960_FPREG_PLEN];
-
- /* Get general-purpose registers. When copying values into
- registers [], don't assume that a location in registers []
- is properly aligned for the target data type. */
-
- net_read_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_GETREGS);
-
- bcopy (&i960_greg_packet[I960_R_R0],
- ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * I960_GREG_SIZE);
- bcopy (&i960_greg_packet[I960_R_G0],
- ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * I960_GREG_SIZE);
- bcopy (&i960_greg_packet[I960_R_PCW],
- ®isters[REGISTER_BYTE (PCW_REGNUM)], sizeof (int));
- bcopy (&i960_greg_packet[I960_R_ACW],
- ®isters[REGISTER_BYTE (ACW_REGNUM)], sizeof (int));
- bcopy (&i960_greg_packet[I960_R_TCW],
- ®isters[REGISTER_BYTE (TCW_REGNUM)], sizeof (int));
-
- /* If the target has floating point registers, fetch them.
- Otherwise, zero the floating point register values in
- registers[] for good measure, even though we might not
- need to. */
-
- if (target_has_fp)
- {
- net_read_registers (i960_fpreg_packet, I960_FPREG_PLEN,
- PTRACE_GETFPREGS);
- bcopy (&i960_fpreg_packet[I960_R_FP0],
- ®isters[REGISTER_BYTE (FP0_REGNUM)],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
- }
- else
- bzero (®isters[REGISTER_BYTE (FP0_REGNUM)],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
-
- /* Mark the register cache valid. */
-
- registers_fetched ();
-}
-
-/* Store a register or registers into the VxWorks target.
- REGNO is the register to store, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_write_register (int regno)
-{
- char i960_greg_packet[I960_GREG_PLEN];
- char i960_fpreg_packet[I960_FPREG_PLEN];
-
- /* Store floating-point registers. When copying values from
- registers [], don't assume that a location in registers []
- is properly aligned for the target data type. */
-
- bcopy (®isters[REGISTER_BYTE (R0_REGNUM)],
- &i960_greg_packet[I960_R_R0], 16 * I960_GREG_SIZE);
- bcopy (®isters[REGISTER_BYTE (G0_REGNUM)],
- &i960_greg_packet[I960_R_G0], 16 * I960_GREG_SIZE);
- bcopy (®isters[REGISTER_BYTE (PCW_REGNUM)],
- &i960_greg_packet[I960_R_PCW], sizeof (int));
- bcopy (®isters[REGISTER_BYTE (ACW_REGNUM)],
- &i960_greg_packet[I960_R_ACW], sizeof (int));
- bcopy (®isters[REGISTER_BYTE (TCW_REGNUM)],
- &i960_greg_packet[I960_R_TCW], sizeof (int));
-
- net_write_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_SETREGS);
-
- /* Store floating point registers if the target has them. */
-
- if (target_has_fp)
- {
- bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)],
- &i960_fpreg_packet[I960_R_FP0],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
-
- net_write_registers (i960_fpreg_packet, I960_FPREG_PLEN,
- PTRACE_SETFPREGS);
- }
-}
+// OBSOLETE /* i80960-dependent portions of the RPC protocol
+// OBSOLETE used with a VxWorks target
+// OBSOLETE
+// OBSOLETE Contributed by Wind River Systems.
+// OBSOLETE
+// OBSOLETE This file is part of GDB.
+// OBSOLETE
+// OBSOLETE This program is free software; you can redistribute it and/or modify
+// OBSOLETE it under the terms of the GNU General Public License as published by
+// OBSOLETE the Free Software Foundation; either version 2 of the License, or
+// OBSOLETE (at your option) any later version.
+// OBSOLETE
+// OBSOLETE This program is distributed in the hope that it will be useful,
+// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
+// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// OBSOLETE GNU General Public License for more details.
+// OBSOLETE
+// OBSOLETE You should have received a copy of the GNU General Public License
+// OBSOLETE along with this program; if not, write to the Free Software
+// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
+// OBSOLETE Boston, MA 02111-1307, USA. */
+// OBSOLETE
+// OBSOLETE #include <stdio.h>
+// OBSOLETE #include "defs.h"
+// OBSOLETE
+// OBSOLETE #include "vx-share/regPacket.h"
+// OBSOLETE #include "frame.h"
+// OBSOLETE #include "inferior.h"
+// OBSOLETE #include "target.h"
+// OBSOLETE #include "gdbcore.h"
+// OBSOLETE #include "command.h"
+// OBSOLETE #include "symtab.h"
+// OBSOLETE #include "symfile.h" /* for struct complaint */
+// OBSOLETE #include "regcache.h"
+// OBSOLETE
+// OBSOLETE #include "gdb_string.h"
+// OBSOLETE #include <errno.h>
+// OBSOLETE #include <fcntl.h>
+// OBSOLETE #include <sys/types.h>
+// OBSOLETE #include <sys/time.h>
+// OBSOLETE #include <sys/socket.h>
+// OBSOLETE
+// OBSOLETE #ifdef _AIX /* IBM claims "void *malloc()" not char * */
+// OBSOLETE #define malloc bogon_malloc
+// OBSOLETE #endif
+// OBSOLETE
+// OBSOLETE #include <rpc/rpc.h>
+// OBSOLETE #include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
+// OBSOLETE #include <netdb.h>
+// OBSOLETE #include "vx-share/ptrace.h"
+// OBSOLETE #include "vx-share/xdr_ptrace.h"
+// OBSOLETE #include "vx-share/xdr_ld.h"
+// OBSOLETE #include "vx-share/xdr_rdb.h"
+// OBSOLETE #include "vx-share/dbgRpcLib.h"
+// OBSOLETE
+// OBSOLETE /* get rid of value.h if possible */
+// OBSOLETE #include <value.h>
+// OBSOLETE #include <symtab.h>
+// OBSOLETE
+// OBSOLETE /* Flag set if target has fpu */
+// OBSOLETE
+// OBSOLETE extern int target_has_fp;
+// OBSOLETE
+// OBSOLETE /* 960 floating point format descriptor, from "i960-tdep.c." */
+// OBSOLETE
+// OBSOLETE extern struct ext_format ext_format_i960;
+// OBSOLETE
+// OBSOLETE /* Generic register read/write routines in remote-vx.c. */
+// OBSOLETE
+// OBSOLETE extern void net_read_registers ();
+// OBSOLETE extern void net_write_registers ();
+// OBSOLETE
+// OBSOLETE /* Read a register or registers from the VxWorks target.
+// OBSOLETE REGNO is the register to read, or -1 for all; currently,
+// OBSOLETE it is ignored. FIXME look at regno to improve efficiency. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE vx_read_register (int regno)
+// OBSOLETE {
+// OBSOLETE char i960_greg_packet[I960_GREG_PLEN];
+// OBSOLETE char i960_fpreg_packet[I960_FPREG_PLEN];
+// OBSOLETE
+// OBSOLETE /* Get general-purpose registers. When copying values into
+// OBSOLETE registers [], don't assume that a location in registers []
+// OBSOLETE is properly aligned for the target data type. */
+// OBSOLETE
+// OBSOLETE net_read_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_GETREGS);
+// OBSOLETE
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_R0],
+// OBSOLETE ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_G0],
+// OBSOLETE ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_PCW],
+// OBSOLETE ®isters[REGISTER_BYTE (PCW_REGNUM)], sizeof (int));
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_ACW],
+// OBSOLETE ®isters[REGISTER_BYTE (ACW_REGNUM)], sizeof (int));
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_TCW],
+// OBSOLETE ®isters[REGISTER_BYTE (TCW_REGNUM)], sizeof (int));
+// OBSOLETE
+// OBSOLETE /* If the target has floating point registers, fetch them.
+// OBSOLETE Otherwise, zero the floating point register values in
+// OBSOLETE registers[] for good measure, even though we might not
+// OBSOLETE need to. */
+// OBSOLETE
+// OBSOLETE if (target_has_fp)
+// OBSOLETE {
+// OBSOLETE net_read_registers (i960_fpreg_packet, I960_FPREG_PLEN,
+// OBSOLETE PTRACE_GETFPREGS);
+// OBSOLETE bcopy (&i960_fpreg_packet[I960_R_FP0],
+// OBSOLETE ®isters[REGISTER_BYTE (FP0_REGNUM)],
+// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE bzero (®isters[REGISTER_BYTE (FP0_REGNUM)],
+// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
+// OBSOLETE
+// OBSOLETE /* Mark the register cache valid. */
+// OBSOLETE
+// OBSOLETE registers_fetched ();
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE /* Store a register or registers into the VxWorks target.
+// OBSOLETE REGNO is the register to store, or -1 for all; currently,
+// OBSOLETE it is ignored. FIXME look at regno to improve efficiency. */
+// OBSOLETE
+// OBSOLETE void
+// OBSOLETE vx_write_register (int regno)
+// OBSOLETE {
+// OBSOLETE char i960_greg_packet[I960_GREG_PLEN];
+// OBSOLETE char i960_fpreg_packet[I960_FPREG_PLEN];
+// OBSOLETE
+// OBSOLETE /* Store floating-point registers. When copying values from
+// OBSOLETE registers [], don't assume that a location in registers []
+// OBSOLETE is properly aligned for the target data type. */
+// OBSOLETE
+// OBSOLETE bcopy (®isters[REGISTER_BYTE (R0_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_R0], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (®isters[REGISTER_BYTE (G0_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_G0], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (®isters[REGISTER_BYTE (PCW_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_PCW], sizeof (int));
+// OBSOLETE bcopy (®isters[REGISTER_BYTE (ACW_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_ACW], sizeof (int));
+// OBSOLETE bcopy (®isters[REGISTER_BYTE (TCW_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_TCW], sizeof (int));
+// OBSOLETE
+// OBSOLETE net_write_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_SETREGS);
+// OBSOLETE
+// OBSOLETE /* Store floating point registers if the target has them. */
+// OBSOLETE
+// OBSOLETE if (target_has_fp)
+// OBSOLETE {
+// OBSOLETE bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)],
+// OBSOLETE &i960_fpreg_packet[I960_R_FP0],
+// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
+// OBSOLETE
+// OBSOLETE net_write_registers (i960_fpreg_packet, I960_FPREG_PLEN,
+// OBSOLETE PTRACE_SETFPREGS);
+// OBSOLETE }
+// OBSOLETE }