diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-05-04 15:52:42 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-05-04 15:52:42 +0000 |
commit | cd9bfe1540597cc048bc965db716ac68fb2eaa16 (patch) | |
tree | 8c252d09c506718ee2cb656d05e19e353d384a4b | |
parent | b9c07f0f780871624cd4556936f931cdaea26995 (diff) | |
download | gdb-cd9bfe1540597cc048bc965db716ac68fb2eaa16.zip gdb-cd9bfe1540597cc048bc965db716ac68fb2eaa16.tar.gz gdb-cd9bfe1540597cc048bc965db716ac68fb2eaa16.tar.bz2 |
* MAINTAINERS: Mark a29k as deleted.
* NEWS: Mention that a29k was removed. Add OBSOLETE section.
Move new configurations to the top.
* configure.tgt: Remove a29k.
* config/a29k/tm-vx29k.h: Delete.
* config/a29k/vx29k.mt: Delete.
* config/a29k/tm-a29k.h: Delete.
* config/a29k/a29k-udi.mt: Delete.
* config/a29k/a29k.mt: Delete.
* a29k-tdep.c: Delete.
* remote-udi.c: Delete.
* remote-mm.c: Delete.
* remote-eb.c: Delete.
* remote-adapt.c: Delete.
* Makefile.in: Remove obsolete code.
* gdbserver/Makefile.in: Ditto.
* config/s390/s390x.mt: Ditto.
* config/s390/s390.mt: Ditto.
* config/sparc/sparclynx.mh: Ditto.
* config/sparc/linux.mh: Ditto.
* config/pa/hppaosf.mh: Ditto.
* config/pa/hppabsd.mh: Ditto.
* config/ns32k/nbsd.mt: Ditto.
* config/mips/vr5000.mt: Ditto.
* config/m68k/sun3os4.mh: Ditto.
* config/m68k/nbsd.mt: Ditto.
* config/m68k/m68klynx.mh: Ditto.
* config/m32r/m32r.mt: Ditto.
* config/i386/x86-64linux.mt: Ditto.
* config/i386/nbsdelf.mt: Ditto.
* config/i386/nbsd.mt: Ditto.
* config/i386/i386lynx.mh: Ditto.
35 files changed, 58 insertions, 8248 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index de25269..41f5904 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,40 @@ 2002-05-04 Andrew Cagney <ac131313@redhat.com> + * MAINTAINERS: Mark a29k as deleted. + * NEWS: Mention that a29k was removed. Add OBSOLETE section. + Move new configurations to the top. + * configure.tgt: Remove a29k. + * config/a29k/tm-vx29k.h: Delete. + * config/a29k/vx29k.mt: Delete. + * config/a29k/tm-a29k.h: Delete. + * config/a29k/a29k-udi.mt: Delete. + * config/a29k/a29k.mt: Delete. + * a29k-tdep.c: Delete. + * remote-udi.c: Delete. + * remote-mm.c: Delete. + * remote-eb.c: Delete. + * remote-adapt.c: Delete. + * Makefile.in: Remove obsolete code. + * gdbserver/Makefile.in: Ditto. + * config/s390/s390x.mt: Ditto. + * config/s390/s390.mt: Ditto. + * config/sparc/sparclynx.mh: Ditto. + * config/sparc/linux.mh: Ditto. + * config/pa/hppaosf.mh: Ditto. + * config/pa/hppabsd.mh: Ditto. + * config/ns32k/nbsd.mt: Ditto. + * config/mips/vr5000.mt: Ditto. + * config/m68k/sun3os4.mh: Ditto. + * config/m68k/nbsd.mt: Ditto. + * config/m68k/m68klynx.mh: Ditto. + * config/m32r/m32r.mt: Ditto. + * config/i386/x86-64linux.mt: Ditto. + * config/i386/nbsdelf.mt: Ditto. + * config/i386/nbsd.mt: Ditto. + * config/i386/i386lynx.mh: Ditto. + +2002-05-04 Andrew Cagney <ac131313@redhat.com> + * target.c (debug_print_register): New function. Handle oversize registers. (debug_to_fetch_registers): Call. diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 932a3f4..de8e371 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -54,7 +54,7 @@ variants. *-tdep.c. The Target/Architecture maintainer works with the host maintainer when resolving build issues. The Target/Architecture maintainer works with the native maintainer when resolving API issues. - a29k OBSOLETE + a29k Deleted. alpha --target=alpha-dec-osf4.0a -Werror Maintenance only diff --git a/gdb/Makefile.in b/gdb/Makefile.in index c87eb17..de30f43 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1239,9 +1239,6 @@ udi2go32.o: $(srcdir)/29k-share/udi/udi2go32.c $(udiheaders) udr.o: $(srcdir)/29k-share/udi/udr.c $(udiheaders) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udr.c -# OBSOLETE a29k-tdep.o: a29k-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \ -# OBSOLETE $(regcache_h) - a68v-nat.o: a68v-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \ $(regcache_h) @@ -1903,9 +1900,6 @@ lin-lwp.o: lin-lwp.c $(defs_h) gdb_assert.h gdb_wait.h $(gdbthread_h) \ proc-service.o: proc-service.c $(defs_h) $(inferior_h) gdb_proc_service.h \ $(symtab_h) $(target_h) gregset.h -# OBSOLETE remote-adapt.o: remote-adapt.c $(defs_h) $(gdbcore_h) \ -# OBSOLETE $(inferior_h) $(target_h) $(terminal_h) $(gdb_string_h) $(regcache_h) - remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \ $(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) $(remote_utils_h) \ $(version_h) $(regcache_h) @@ -1933,10 +1927,6 @@ remote-bug.o: remote-bug.c $(defs_h) $(gdbcore_h) $(serial_h) \ remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(target_h) \ $(serial_h) $(gdb_string_h) $(regcache_h) -# OBSOLETE remote-eb.o: remote-eb.c $(srcdir)/config/a29k/tm-a29k.h \ -# OBSOLETE $(defs_h) $(gdbcore_h) $(inferior_h) $(symfile_h) $(target_h) \ -# OBSOLETE $(terminal_h) $(gdb_string_h) $(regcache_h) - remote-es.o: remote-es.c $(bfd_h) $(command_h) $(defs_h) \ $(inferior_h) $(remote_utils_h) $(terminal_h) $(gdb_string_h) \ $(symfile_h) $(regcache_h) $(value_h) @@ -1951,9 +1941,6 @@ remote-mips.o: remote-mips.c $(defs_h) $(gdbcmd_h) \ $(gdbcore_h) $(inferior_h) $(serial_h) $(symfile_h) $(target_h) \ $(regcache_h) -# OBSOLETE remote-mm.o: remote-mm.c $(bfd_h) $(defs_h) $(inferior_h) \ -# OBSOLETE minimon.h $(target_h) $(terminal_h) $(gdb_string_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) \ @@ -1974,10 +1961,6 @@ remote-sim.o: remote-sim.c $(defs_h) $(gdbcore_h) \ remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(serial_h) \ $(target_h) $(gdb_string_h) $(regcache_h) -# OBSOLETE remote-udi.o: remote-udi.c $(bfd_h) $(defs_h) $(gdbcmd_h) \ -# OBSOLETE $(inferior_h) $(target_h) $(terminal_h) $(udiheaders) $(gdb_string_h) \ -# OBSOLETE $(regcache_h) - remote-vx.o: remote-vx.c $(complaints_h) $(defs_h) $(gdbcmd_h) \ $(gdbcore_h) $(inferior_h) $(target_h) vx-share/dbgRpcLib.h \ vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \ @@ -3,18 +3,35 @@ *** Changes since GDB 5.2: -* New target. +* New targets. Atmel AVR avr*-*-* -* Changes in VAX configurations. - -Multi-arch support is enabled for all VAX configurations. - * New native configurations Alpha NetBSD alpha*-*-netbsd* +* OBSOLETE configurations and files + +Configurations that have been declared obsolete in this release have +been commented out. Unless there is activity to revive these +configurations, the next release of GDB will have their sources +permanently REMOVED. + +* REMOVED configurations and files + +AMD 29k family via UDI a29k-amd-udi, udi29k +A29K VxWorks a29k-*-vxworks +AMD 29000 embedded, using EBMON a29k-none-none +AMD 29000 embedded with COFF a29k-none-coff +AMD 29000 embedded with a.out a29k-none-aout + +testsuite/gdb.hp/gdb.threads-hp/ directory + +* Changes in VAX configurations. + +Multi-arch support is enabled for all VAX configurations. + * Changes in Alpha configurations. Multi-arch support is enabled for all Alpha configurations. diff --git a/gdb/a29k-tdep.c b/gdb/a29k-tdep.c deleted file mode 100644 index 4fcc0f2..0000000 --- a/gdb/a29k-tdep.c +++ /dev/null @@ -1,1015 +0,0 @@ -/* OBSOLETE /* Target-machine dependent code for the AMD 29000 */ -/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */ -/* OBSOLETE 2001 */ -/* OBSOLETE Free Software Foundation, Inc. */ -/* OBSOLETE Contributed by Cygnus Support. Written by Jim Kingdon. */ -/* 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 "gdbcore.h" */ -/* OBSOLETE #include "frame.h" */ -/* OBSOLETE #include "value.h" */ -/* OBSOLETE #include "symtab.h" */ -/* OBSOLETE #include "inferior.h" */ -/* OBSOLETE #include "gdbcmd.h" */ -/* OBSOLETE #include "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE /* If all these bits in an instruction word are zero, it is a "tag word" */ -/* OBSOLETE which precedes a function entry point and gives stack traceback info. */ -/* OBSOLETE This used to be defined as 0xff000000, but that treated 0x00000deb as */ -/* OBSOLETE a tag word, while it is really used as a breakpoint. */ */ -/* OBSOLETE #define TAGWORD_ZERO_MASK 0xff00f800 */ -/* OBSOLETE */ -/* OBSOLETE extern CORE_ADDR text_start; /* FIXME, kludge... */ */ -/* OBSOLETE */ -/* OBSOLETE /* The user-settable top of the register stack in virtual memory. We */ -/* OBSOLETE won't attempt to access any stored registers above this address, if set */ -/* OBSOLETE nonzero. */ */ -/* OBSOLETE */ -/* OBSOLETE static CORE_ADDR rstack_high_address = UINT_MAX; */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Should call_function allocate stack space for a struct return? */ */ -/* OBSOLETE /* On the a29k objects over 16 words require the caller to allocate space. */ */ -/* OBSOLETE int */ -/* OBSOLETE a29k_use_struct_convention (int gcc_p, struct type *type) */ -/* OBSOLETE { */ -/* OBSOLETE return (TYPE_LENGTH (type) > 16 * 4); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Structure to hold cached info about function prologues. */ */ -/* OBSOLETE */ -/* OBSOLETE struct prologue_info */ -/* OBSOLETE { */ -/* OBSOLETE CORE_ADDR pc; /* First addr after fn prologue */ */ -/* OBSOLETE unsigned rsize, msize; /* register stack frame size, mem stack ditto */ */ -/* OBSOLETE unsigned mfp_used:1; /* memory frame pointer used */ */ -/* OBSOLETE unsigned rsize_valid:1; /* Validity bits for the above */ */ -/* OBSOLETE unsigned msize_valid:1; */ -/* OBSOLETE unsigned mfp_valid:1; */ -/* OBSOLETE }; */ -/* OBSOLETE */ -/* OBSOLETE /* Examine the prologue of a function which starts at PC. Return */ -/* OBSOLETE the first addess past the prologue. If MSIZE is non-NULL, then */ -/* OBSOLETE set *MSIZE to the memory stack frame size. If RSIZE is non-NULL, */ -/* OBSOLETE then set *RSIZE to the register stack frame size (not including */ -/* OBSOLETE incoming arguments and the return address & frame pointer stored */ -/* OBSOLETE with them). If no prologue is found, *RSIZE is set to zero. */ -/* OBSOLETE If no prologue is found, or a prologue which doesn't involve */ -/* OBSOLETE allocating a memory stack frame, then set *MSIZE to zero. */ -/* OBSOLETE */ -/* OBSOLETE Note that both msize and rsize are in bytes. This is not consistent */ -/* OBSOLETE with the _User's Manual_ with respect to rsize, but it is much more */ -/* OBSOLETE convenient. */ -/* OBSOLETE */ -/* OBSOLETE If MFP_USED is non-NULL, *MFP_USED is set to nonzero if a memory */ -/* OBSOLETE frame pointer is being used. */ */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE examine_prologue (CORE_ADDR pc, unsigned *rsize, unsigned *msize, int *mfp_used) */ -/* OBSOLETE { */ -/* OBSOLETE long insn; */ -/* OBSOLETE CORE_ADDR p = pc; */ -/* OBSOLETE struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc); */ -/* OBSOLETE struct prologue_info *mi = 0; */ -/* OBSOLETE */ -/* OBSOLETE if (msymbol != NULL) */ -/* OBSOLETE mi = (struct prologue_info *) msymbol->info; */ -/* OBSOLETE */ -/* OBSOLETE if (mi != 0) */ -/* OBSOLETE { */ -/* OBSOLETE int valid = 1; */ -/* OBSOLETE if (rsize != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE *rsize = mi->rsize; */ -/* OBSOLETE valid &= mi->rsize_valid; */ -/* OBSOLETE } */ -/* OBSOLETE if (msize != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE *msize = mi->msize; */ -/* OBSOLETE valid &= mi->msize_valid; */ -/* OBSOLETE } */ -/* OBSOLETE if (mfp_used != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE *mfp_used = mi->mfp_used; */ -/* OBSOLETE valid &= mi->mfp_valid; */ -/* OBSOLETE } */ -/* OBSOLETE if (valid) */ -/* OBSOLETE return mi->pc; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (rsize != NULL) */ -/* OBSOLETE *rsize = 0; */ -/* OBSOLETE if (msize != NULL) */ -/* OBSOLETE *msize = 0; */ -/* OBSOLETE if (mfp_used != NULL) */ -/* OBSOLETE *mfp_used = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* Prologue must start with subtracting a constant from gr1. */ -/* OBSOLETE Normally this is sub gr1,gr1,<rsize * 4>. */ */ -/* OBSOLETE insn = read_memory_integer (p, 4); */ -/* OBSOLETE if ((insn & 0xffffff00) != 0x25010100) */ -/* OBSOLETE { */ -/* OBSOLETE /* If the frame is large, instead of a single instruction it */ -/* OBSOLETE might be a pair of instructions: */ -/* OBSOLETE const <reg>, <rsize * 4> */ -/* OBSOLETE sub gr1,gr1,<reg> */ -/* OBSOLETE */ */ -/* OBSOLETE int reg; */ -/* OBSOLETE /* Possible value for rsize. */ */ -/* OBSOLETE unsigned int rsize0; */ -/* OBSOLETE */ -/* OBSOLETE if ((insn & 0xff000000) != 0x03000000) */ -/* OBSOLETE { */ -/* OBSOLETE p = pc; */ -/* OBSOLETE goto done; */ -/* OBSOLETE } */ -/* OBSOLETE reg = (insn >> 8) & 0xff; */ -/* OBSOLETE rsize0 = (((insn >> 8) & 0xff00) | (insn & 0xff)); */ -/* OBSOLETE p += 4; */ -/* OBSOLETE insn = read_memory_integer (p, 4); */ -/* OBSOLETE if ((insn & 0xffffff00) != 0x24010100 */ -/* OBSOLETE || (insn & 0xff) != reg) */ -/* OBSOLETE { */ -/* OBSOLETE p = pc; */ -/* OBSOLETE goto done; */ -/* OBSOLETE } */ -/* OBSOLETE if (rsize != NULL) */ -/* OBSOLETE *rsize = rsize0; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE if (rsize != NULL) */ -/* OBSOLETE *rsize = (insn & 0xff); */ -/* OBSOLETE } */ -/* OBSOLETE p += 4; */ -/* OBSOLETE */ -/* OBSOLETE /* Next instruction ought to be asgeu V_SPILL,gr1,rab. */ -/* OBSOLETE * We don't check the vector number to allow for kernel debugging. The */ -/* OBSOLETE * kernel will use a different trap number. */ -/* OBSOLETE * If this insn is missing, we just keep going; Metaware R2.3u compiler */ -/* OBSOLETE * generates prologue that intermixes initializations and puts the asgeu */ -/* OBSOLETE * way down. */ -/* OBSOLETE */ */ -/* OBSOLETE insn = read_memory_integer (p, 4); */ -/* OBSOLETE if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM)) */ -/* OBSOLETE { */ -/* OBSOLETE p += 4; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Next instruction usually sets the frame pointer (lr1) by adding */ -/* OBSOLETE <size * 4> from gr1. However, this can (and high C does) be */ -/* OBSOLETE deferred until anytime before the first function call. So it is */ -/* OBSOLETE OK if we don't see anything which sets lr1. */ -/* OBSOLETE To allow for alternate register sets (gcc -mkernel-registers) the msp */ -/* OBSOLETE register number is a compile time constant. */ */ -/* OBSOLETE */ -/* OBSOLETE /* Normally this is just add lr1,gr1,<size * 4>. */ */ -/* OBSOLETE insn = read_memory_integer (p, 4); */ -/* OBSOLETE if ((insn & 0xffffff00) == 0x15810100) */ -/* OBSOLETE p += 4; */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* However, for large frames it can be */ -/* OBSOLETE const <reg>, <size *4> */ -/* OBSOLETE add lr1,gr1,<reg> */ -/* OBSOLETE */ */ -/* OBSOLETE int reg; */ -/* OBSOLETE CORE_ADDR q; */ -/* OBSOLETE */ -/* OBSOLETE if ((insn & 0xff000000) == 0x03000000) */ -/* OBSOLETE { */ -/* OBSOLETE reg = (insn >> 8) & 0xff; */ -/* OBSOLETE q = p + 4; */ -/* OBSOLETE insn = read_memory_integer (q, 4); */ -/* OBSOLETE if ((insn & 0xffffff00) == 0x14810100 */ -/* OBSOLETE && (insn & 0xff) == reg) */ -/* OBSOLETE p = q; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Next comes "add lr{<rsize-1>},msp,0", but only if a memory */ -/* OBSOLETE frame pointer is in use. We just check for add lr<anything>,msp,0; */ -/* OBSOLETE we don't check this rsize against the first instruction, and */ -/* OBSOLETE we don't check that the trace-back tag indicates a memory frame pointer */ -/* OBSOLETE is in use. */ -/* OBSOLETE To allow for alternate register sets (gcc -mkernel-registers) the msp */ -/* OBSOLETE register number is a compile time constant. */ -/* OBSOLETE */ -/* OBSOLETE The recommended instruction is actually "sll lr<whatever>,msp,0". */ -/* OBSOLETE We check for that, too. Originally Jim Kingdon's code seemed */ -/* OBSOLETE to be looking for a "sub" instruction here, but the mask was set */ -/* OBSOLETE up to lose all the time. */ */ -/* OBSOLETE insn = read_memory_integer (p, 4); */ -/* OBSOLETE if (((insn & 0xff80ffff) == (0x15800000 | (MSP_HW_REGNUM << 8))) /* add */ */ -/* OBSOLETE || ((insn & 0xff80ffff) == (0x81800000 | (MSP_HW_REGNUM << 8)))) /* sll */ */ -/* OBSOLETE { */ -/* OBSOLETE p += 4; */ -/* OBSOLETE if (mfp_used != NULL) */ -/* OBSOLETE *mfp_used = 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Next comes a subtraction from msp to allocate a memory frame, */ -/* OBSOLETE but only if a memory frame is */ -/* OBSOLETE being used. We don't check msize against the trace-back tag. */ -/* OBSOLETE */ -/* OBSOLETE To allow for alternate register sets (gcc -mkernel-registers) the msp */ -/* OBSOLETE register number is a compile time constant. */ -/* OBSOLETE */ -/* OBSOLETE Normally this is just */ -/* OBSOLETE sub msp,msp,<msize> */ -/* OBSOLETE */ */ -/* OBSOLETE insn = read_memory_integer (p, 4); */ -/* OBSOLETE if ((insn & 0xffffff00) == */ -/* OBSOLETE (0x25000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8))) */ -/* OBSOLETE { */ -/* OBSOLETE p += 4; */ -/* OBSOLETE if (msize != NULL) */ -/* OBSOLETE *msize = insn & 0xff; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* For large frames, instead of a single instruction it might */ -/* OBSOLETE be */ -/* OBSOLETE */ -/* OBSOLETE const <reg>, <msize> */ -/* OBSOLETE consth <reg>, <msize> ; optional */ -/* OBSOLETE sub msp,msp,<reg> */ -/* OBSOLETE */ */ -/* OBSOLETE int reg; */ -/* OBSOLETE unsigned msize0; */ -/* OBSOLETE CORE_ADDR q = p; */ -/* OBSOLETE */ -/* OBSOLETE if ((insn & 0xff000000) == 0x03000000) */ -/* OBSOLETE { */ -/* OBSOLETE reg = (insn >> 8) & 0xff; */ -/* OBSOLETE msize0 = ((insn >> 8) & 0xff00) | (insn & 0xff); */ -/* OBSOLETE q += 4; */ -/* OBSOLETE insn = read_memory_integer (q, 4); */ -/* OBSOLETE /* Check for consth. */ */ -/* OBSOLETE if ((insn & 0xff000000) == 0x02000000 */ -/* OBSOLETE && (insn & 0x0000ff00) == reg) */ -/* OBSOLETE { */ -/* OBSOLETE msize0 |= (insn << 8) & 0xff000000; */ -/* OBSOLETE msize0 |= (insn << 16) & 0x00ff0000; */ -/* OBSOLETE q += 4; */ -/* OBSOLETE insn = read_memory_integer (q, 4); */ -/* OBSOLETE } */ -/* OBSOLETE /* Check for sub msp,msp,<reg>. */ */ -/* OBSOLETE if ((insn & 0xffffff00) == */ -/* OBSOLETE (0x24000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8)) */ -/* OBSOLETE && (insn & 0xff) == reg) */ -/* OBSOLETE { */ -/* OBSOLETE p = q + 4; */ -/* OBSOLETE if (msize != NULL) */ -/* OBSOLETE *msize = msize0; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Next instruction might be asgeu V_SPILL,gr1,rab. */ -/* OBSOLETE * We don't check the vector number to allow for kernel debugging. The */ -/* OBSOLETE * kernel will use a different trap number. */ -/* OBSOLETE * Metaware R2.3u compiler */ -/* OBSOLETE * generates prologue that intermixes initializations and puts the asgeu */ -/* OBSOLETE * way down after everything else. */ -/* OBSOLETE */ */ -/* OBSOLETE insn = read_memory_integer (p, 4); */ -/* OBSOLETE if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM)) */ -/* OBSOLETE { */ -/* OBSOLETE p += 4; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE done: */ -/* OBSOLETE if (msymbol != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE if (mi == 0) */ -/* OBSOLETE { */ -/* OBSOLETE /* Add a new cache entry. */ */ -/* OBSOLETE mi = (struct prologue_info *) xmalloc (sizeof (struct prologue_info)); */ -/* OBSOLETE msymbol->info = (char *) mi; */ -/* OBSOLETE mi->rsize_valid = 0; */ -/* OBSOLETE mi->msize_valid = 0; */ -/* OBSOLETE mi->mfp_valid = 0; */ -/* OBSOLETE } */ -/* OBSOLETE /* else, cache entry exists, but info is incomplete. */ */ -/* OBSOLETE mi->pc = p; */ -/* OBSOLETE if (rsize != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE mi->rsize = *rsize; */ -/* OBSOLETE mi->rsize_valid = 1; */ -/* OBSOLETE } */ -/* OBSOLETE if (msize != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE mi->msize = *msize; */ -/* OBSOLETE mi->msize_valid = 1; */ -/* OBSOLETE } */ -/* OBSOLETE if (mfp_used != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE mi->mfp_used = *mfp_used; */ -/* OBSOLETE mi->mfp_valid = 1; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE return p; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Advance PC across any function entry prologue instructions */ -/* OBSOLETE to reach some "real" code. */ */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE a29k_skip_prologue (CORE_ADDR pc) */ -/* OBSOLETE { */ -/* OBSOLETE return examine_prologue (pc, NULL, NULL, NULL); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Examine the one or two word tag at the beginning of a function. */ -/* OBSOLETE * The tag word is expect to be at 'p', if it is not there, we fail */ -/* OBSOLETE * by returning 0. The documentation for the tag word was taken from */ -/* OBSOLETE * page 7-15 of the 29050 User's Manual. We are assuming that the */ -/* OBSOLETE * m bit is in bit 22 of the tag word, which seems to be the agreed upon */ -/* OBSOLETE * convention today (1/15/92). */ -/* OBSOLETE * msize is return in bytes. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE static int /* 0/1 - failure/success of finding the tag word */ */ -/* OBSOLETE examine_tag (CORE_ADDR p, int *is_trans, int *argcount, unsigned *msize, */ -/* OBSOLETE int *mfp_used) */ -/* OBSOLETE { */ -/* OBSOLETE unsigned int tag1, tag2; */ -/* OBSOLETE */ -/* OBSOLETE tag1 = read_memory_integer (p, 4); */ -/* OBSOLETE if ((tag1 & TAGWORD_ZERO_MASK) != 0) /* Not a tag word */ */ -/* OBSOLETE return 0; */ -/* OBSOLETE if (tag1 & (1 << 23)) /* A two word tag */ */ -/* OBSOLETE { */ -/* OBSOLETE tag2 = read_memory_integer (p - 4, 4); */ -/* OBSOLETE if (msize) */ -/* OBSOLETE *msize = tag2 * 2; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE /* A one word tag */ */ -/* OBSOLETE { */ -/* OBSOLETE if (msize) */ -/* OBSOLETE *msize = tag1 & 0x7ff; */ -/* OBSOLETE } */ -/* OBSOLETE if (is_trans) */ -/* OBSOLETE *is_trans = ((tag1 & (1 << 21)) ? 1 : 0); */ -/* OBSOLETE /* Note that this includes the frame pointer and the return address */ -/* OBSOLETE register, so the actual number of registers of arguments is two less. */ -/* OBSOLETE argcount can be zero, however, sometimes, for strange assembler */ -/* OBSOLETE routines. */ */ -/* OBSOLETE if (argcount) */ -/* OBSOLETE *argcount = (tag1 >> 16) & 0x1f; */ -/* OBSOLETE if (mfp_used) */ -/* OBSOLETE *mfp_used = ((tag1 & (1 << 22)) ? 1 : 0); */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Initialize the frame. In addition to setting "extra" frame info, */ -/* OBSOLETE we also set ->frame because we use it in a nonstandard way, and ->pc */ -/* OBSOLETE because we need to know it to get the other stuff. See the diagram */ -/* OBSOLETE of stacks and the frame cache in tm-a29k.h for more detail. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE init_frame_info (int innermost_frame, struct frame_info *frame) */ -/* OBSOLETE { */ -/* OBSOLETE CORE_ADDR p; */ -/* OBSOLETE long insn; */ -/* OBSOLETE unsigned rsize; */ -/* OBSOLETE unsigned msize; */ -/* OBSOLETE int mfp_used, trans; */ -/* OBSOLETE struct symbol *func; */ -/* OBSOLETE */ -/* OBSOLETE p = frame->pc; */ -/* OBSOLETE */ -/* OBSOLETE if (innermost_frame) */ -/* OBSOLETE frame->frame = read_register (GR1_REGNUM); */ -/* OBSOLETE else */ -/* OBSOLETE frame->frame = frame->next->frame + frame->next->rsize; */ -/* OBSOLETE */ -/* OBSOLETE #if 0 /* CALL_DUMMY_LOCATION == ON_STACK */ */ -/* OBSOLETE This wont work; */ -/* OBSOLETE #else */ -/* OBSOLETE if (PC_IN_CALL_DUMMY (p, 0, 0)) */ -/* OBSOLETE #endif */ -/* OBSOLETE { */ -/* OBSOLETE frame->rsize = DUMMY_FRAME_RSIZE; */ -/* OBSOLETE /* This doesn't matter since we never try to get locals or args */ -/* OBSOLETE from a dummy frame. */ */ -/* OBSOLETE frame->msize = 0; */ -/* OBSOLETE /* Dummy frames always use a memory frame pointer. */ */ -/* OBSOLETE frame->saved_msp = */ -/* OBSOLETE read_register_stack_integer (frame->frame + DUMMY_FRAME_RSIZE - 4, 4); */ -/* OBSOLETE frame->flags |= (TRANSPARENT_FRAME | MFP_USED); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE func = find_pc_function (p); */ -/* OBSOLETE if (func != NULL) */ -/* OBSOLETE p = BLOCK_START (SYMBOL_BLOCK_VALUE (func)); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* Search backward to find the trace-back tag. However, */ -/* OBSOLETE do not trace back beyond the start of the text segment */ -/* OBSOLETE (just as a sanity check to avoid going into never-never land). */ */ -/* OBSOLETE #if 1 */ -/* OBSOLETE while (p >= text_start */ -/* OBSOLETE && ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0) */ -/* OBSOLETE p -= 4; */ -/* OBSOLETE #else /* 0 */ */ -/* OBSOLETE char pat[4] = */ -/* OBSOLETE {0, 0, 0, 0}; */ -/* OBSOLETE char mask[4]; */ -/* OBSOLETE char insn_raw[4]; */ -/* OBSOLETE store_unsigned_integer (mask, 4, TAGWORD_ZERO_MASK); */ -/* OBSOLETE /* Enable this once target_search is enabled and tested. */ */ -/* OBSOLETE target_search (4, pat, mask, p, -4, text_start, p + 1, &p, &insn_raw); */ -/* OBSOLETE insn = extract_unsigned_integer (insn_raw, 4); */ -/* OBSOLETE #endif /* 0 */ */ -/* OBSOLETE */ -/* OBSOLETE if (p < text_start) */ -/* OBSOLETE { */ -/* OBSOLETE /* Couldn't find the trace-back tag. */ -/* OBSOLETE Something strange is going on. */ */ -/* OBSOLETE frame->saved_msp = 0; */ -/* OBSOLETE frame->rsize = 0; */ -/* OBSOLETE frame->msize = 0; */ -/* OBSOLETE frame->flags = TRANSPARENT_FRAME; */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE /* Advance to the first word of the function, i.e. the word */ -/* OBSOLETE after the trace-back tag. */ */ -/* OBSOLETE p += 4; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* We've found the start of the function. */ -/* OBSOLETE Try looking for a tag word that indicates whether there is a */ -/* OBSOLETE memory frame pointer and what the memory stack allocation is. */ -/* OBSOLETE If one doesn't exist, try using a more exhaustive search of */ -/* OBSOLETE the prologue. */ */ -/* OBSOLETE */ -/* OBSOLETE if (examine_tag (p - 4, &trans, (int *) NULL, &msize, &mfp_used)) /* Found good tag */ */ -/* OBSOLETE examine_prologue (p, &rsize, 0, 0); */ -/* OBSOLETE else /* No tag try prologue */ */ -/* OBSOLETE examine_prologue (p, &rsize, &msize, &mfp_used); */ -/* OBSOLETE */ -/* OBSOLETE frame->rsize = rsize; */ -/* OBSOLETE frame->msize = msize; */ -/* OBSOLETE frame->flags = 0; */ -/* OBSOLETE if (mfp_used) */ -/* OBSOLETE frame->flags |= MFP_USED; */ -/* OBSOLETE if (trans) */ -/* OBSOLETE frame->flags |= TRANSPARENT_FRAME; */ -/* OBSOLETE if (innermost_frame) */ -/* OBSOLETE { */ -/* OBSOLETE frame->saved_msp = read_register (MSP_REGNUM) + msize; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE if (mfp_used) */ -/* OBSOLETE frame->saved_msp = */ -/* OBSOLETE read_register_stack_integer (frame->frame + rsize - 4, 4); */ -/* OBSOLETE else */ -/* OBSOLETE frame->saved_msp = frame->next->saved_msp + msize; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE init_extra_frame_info (struct frame_info *frame) */ -/* OBSOLETE { */ -/* OBSOLETE if (frame->next == 0) */ -/* OBSOLETE /* Assume innermost frame. May produce strange results for "info frame" */ -/* OBSOLETE but there isn't any way to tell the difference. */ */ -/* OBSOLETE init_frame_info (1, frame); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* We're in get_prev_frame. */ -/* OBSOLETE Take care of everything in init_frame_pc. */ */ -/* OBSOLETE ; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE init_frame_pc (int fromleaf, struct frame_info *frame) */ -/* OBSOLETE { */ -/* OBSOLETE frame->pc = (fromleaf ? SAVED_PC_AFTER_CALL (frame->next) : */ -/* OBSOLETE frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ()); */ -/* OBSOLETE init_frame_info (fromleaf, frame); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their */ -/* OBSOLETE offsets being relative to the memory stack pointer (high C) or */ -/* OBSOLETE saved_msp (gcc). */ */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE frame_locals_address (struct frame_info *fi) */ -/* OBSOLETE { */ -/* OBSOLETE if (fi->flags & MFP_USED) */ -/* OBSOLETE return fi->saved_msp; */ -/* OBSOLETE else */ -/* OBSOLETE return fi->saved_msp - fi->msize; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Routines for reading the register stack. The caller gets to treat */ -/* OBSOLETE the register stack as a uniform stack in memory, from address $gr1 */ -/* OBSOLETE straight through $rfb and beyond. */ */ -/* OBSOLETE */ -/* OBSOLETE /* Analogous to read_memory except the length is understood to be 4. */ -/* OBSOLETE Also, myaddr can be NULL (meaning don't bother to read), and */ -/* OBSOLETE if actual_mem_addr is non-NULL, store there the address that it */ -/* OBSOLETE was fetched from (or if from a register the offset within */ -/* OBSOLETE registers). Set *LVAL to lval_memory or lval_register, depending */ -/* OBSOLETE on where it came from. The contents written into MYADDR are in */ -/* OBSOLETE target format. */ */ -/* OBSOLETE void */ -/* OBSOLETE read_register_stack (CORE_ADDR memaddr, char *myaddr, */ -/* OBSOLETE CORE_ADDR *actual_mem_addr, enum lval_type *lval) */ -/* OBSOLETE { */ -/* OBSOLETE long rfb = read_register (RFB_REGNUM); */ -/* OBSOLETE long rsp = read_register (RSP_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE /* If we don't do this 'info register' stops in the middle. */ */ -/* OBSOLETE if (memaddr >= rstack_high_address) */ -/* OBSOLETE { */ -/* OBSOLETE /* a bogus value */ */ -/* OBSOLETE static char val[] = */ -/* OBSOLETE {~0, ~0, ~0, ~0}; */ -/* OBSOLETE /* It's in a local register, but off the end of the stack. */ */ -/* OBSOLETE int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; */ -/* OBSOLETE if (myaddr != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE /* Provide bogusness */ */ -/* OBSOLETE memcpy (myaddr, val, 4); */ -/* OBSOLETE } */ -/* OBSOLETE supply_register (regnum, val); /* More bogusness */ */ -/* OBSOLETE if (lval != NULL) */ -/* OBSOLETE *lval = lval_register; */ -/* OBSOLETE if (actual_mem_addr != NULL) */ -/* OBSOLETE *actual_mem_addr = REGISTER_BYTE (regnum); */ -/* OBSOLETE } */ -/* OBSOLETE /* If it's in the part of the register stack that's in real registers, */ -/* OBSOLETE get the value from the registers. If it's anywhere else in memory */ -/* OBSOLETE (e.g. in another thread's saved stack), skip this part and get */ -/* OBSOLETE it from real live memory. */ */ -/* OBSOLETE else if (memaddr < rfb && memaddr >= rsp) */ -/* OBSOLETE { */ -/* OBSOLETE /* It's in a register. */ */ -/* OBSOLETE int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; */ -/* OBSOLETE if (regnum > LR0_REGNUM + 127) */ -/* OBSOLETE error ("Attempt to read register stack out of range."); */ -/* OBSOLETE if (myaddr != NULL) */ -/* OBSOLETE read_register_gen (regnum, myaddr); */ -/* OBSOLETE if (lval != NULL) */ -/* OBSOLETE *lval = lval_register; */ -/* OBSOLETE if (actual_mem_addr != NULL) */ -/* OBSOLETE *actual_mem_addr = REGISTER_BYTE (regnum); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* It's in the memory portion of the register stack. */ */ -/* OBSOLETE if (myaddr != NULL) */ -/* OBSOLETE read_memory (memaddr, myaddr, 4); */ -/* OBSOLETE if (lval != NULL) */ -/* OBSOLETE *lval = lval_memory; */ -/* OBSOLETE if (actual_mem_addr != NULL) */ -/* OBSOLETE *actual_mem_addr = memaddr; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Analogous to read_memory_integer */ -/* OBSOLETE except the length is understood to be 4. */ */ -/* OBSOLETE long */ -/* OBSOLETE read_register_stack_integer (CORE_ADDR memaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE char buf[4]; */ -/* OBSOLETE read_register_stack (memaddr, buf, NULL, NULL); */ -/* OBSOLETE return extract_signed_integer (buf, 4); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Copy 4 bytes from GDB memory at MYADDR into inferior memory */ -/* OBSOLETE at MEMADDR and put the actual address written into in */ -/* OBSOLETE *ACTUAL_MEM_ADDR. */ */ -/* OBSOLETE static void */ -/* OBSOLETE write_register_stack (CORE_ADDR memaddr, char *myaddr, */ -/* OBSOLETE CORE_ADDR *actual_mem_addr) */ -/* OBSOLETE { */ -/* OBSOLETE long rfb = read_register (RFB_REGNUM); */ -/* OBSOLETE long rsp = read_register (RSP_REGNUM); */ -/* OBSOLETE /* If we don't do this 'info register' stops in the middle. */ */ -/* OBSOLETE if (memaddr >= rstack_high_address) */ -/* OBSOLETE { */ -/* OBSOLETE /* It's in a register, but off the end of the stack. */ */ -/* OBSOLETE if (actual_mem_addr != NULL) */ -/* OBSOLETE *actual_mem_addr = 0; */ -/* OBSOLETE } */ -/* OBSOLETE else if (memaddr < rfb) */ -/* OBSOLETE { */ -/* OBSOLETE /* It's in a register. */ */ -/* OBSOLETE int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; */ -/* OBSOLETE if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127) */ -/* OBSOLETE error ("Attempt to read register stack out of range."); */ -/* OBSOLETE if (myaddr != NULL) */ -/* OBSOLETE write_register (regnum, *(long *) myaddr); */ -/* OBSOLETE if (actual_mem_addr != NULL) */ -/* OBSOLETE *actual_mem_addr = 0; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* It's in the memory portion of the register stack. */ */ -/* OBSOLETE if (myaddr != NULL) */ -/* OBSOLETE write_memory (memaddr, myaddr, 4); */ -/* OBSOLETE if (actual_mem_addr != NULL) */ -/* OBSOLETE *actual_mem_addr = memaddr; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Find register number REGNUM relative to FRAME and put its */ -/* OBSOLETE (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable */ -/* OBSOLETE was optimized out (and thus can't be fetched). If the variable */ -/* OBSOLETE was fetched from memory, set *ADDRP to where it was fetched from, */ -/* OBSOLETE otherwise it was fetched from a register. */ -/* OBSOLETE */ -/* OBSOLETE The argument RAW_BUFFER must point to aligned memory. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE a29k_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, */ -/* OBSOLETE struct frame_info *frame, int regnum, */ -/* OBSOLETE enum lval_type *lvalp) */ -/* OBSOLETE { */ -/* OBSOLETE struct frame_info *fi; */ -/* OBSOLETE CORE_ADDR addr; */ -/* OBSOLETE enum lval_type lval; */ -/* OBSOLETE */ -/* OBSOLETE if (!target_has_registers) */ -/* OBSOLETE error ("No registers."); */ -/* OBSOLETE */ -/* OBSOLETE /* Probably now redundant with the target_has_registers check. */ */ -/* OBSOLETE if (frame == 0) */ -/* OBSOLETE return; */ -/* OBSOLETE */ -/* OBSOLETE /* Once something has a register number, it doesn't get optimized out. */ */ -/* OBSOLETE if (optimized != NULL) */ -/* OBSOLETE *optimized = 0; */ -/* OBSOLETE if (regnum == RSP_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE if (raw_buffer != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame); */ -/* OBSOLETE } */ -/* OBSOLETE if (lvalp != NULL) */ -/* OBSOLETE *lvalp = not_lval; */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE else if (regnum == PC_REGNUM && frame->next != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE if (raw_buffer != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->pc); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Not sure we have to do this. */ */ -/* OBSOLETE if (lvalp != NULL) */ -/* OBSOLETE *lvalp = not_lval; */ -/* OBSOLETE */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE else if (regnum == MSP_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE if (raw_buffer != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE if (frame->next != NULL) */ -/* OBSOLETE { */ -/* OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), */ -/* OBSOLETE frame->next->saved_msp); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE read_register_gen (MSP_REGNUM, raw_buffer); */ -/* OBSOLETE } */ -/* OBSOLETE /* The value may have been computed, not fetched. */ */ -/* OBSOLETE if (lvalp != NULL) */ -/* OBSOLETE *lvalp = not_lval; */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE else if (regnum < LR0_REGNUM || regnum >= LR0_REGNUM + 128) */ -/* OBSOLETE { */ -/* OBSOLETE /* These registers are not saved over procedure calls, */ -/* OBSOLETE so just print out the current values. */ */ -/* OBSOLETE if (raw_buffer != NULL) */ -/* OBSOLETE read_register_gen (regnum, raw_buffer); */ -/* OBSOLETE if (lvalp != NULL) */ -/* OBSOLETE *lvalp = lval_register; */ -/* OBSOLETE if (addrp != NULL) */ -/* OBSOLETE *addrp = REGISTER_BYTE (regnum); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE addr = frame->frame + (regnum - LR0_REGNUM) * 4; */ -/* OBSOLETE if (raw_buffer != NULL) */ -/* OBSOLETE read_register_stack (addr, raw_buffer, &addr, &lval); */ -/* OBSOLETE if (lvalp != NULL) */ -/* OBSOLETE *lvalp = lval; */ -/* OBSOLETE if (addrp != NULL) */ -/* OBSOLETE *addrp = addr; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Discard from the stack the innermost frame, */ -/* OBSOLETE restoring all saved registers. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE pop_frame (void) */ -/* OBSOLETE { */ -/* OBSOLETE struct frame_info *frame = get_current_frame (); */ -/* OBSOLETE CORE_ADDR rfb = read_register (RFB_REGNUM); */ -/* OBSOLETE CORE_ADDR gr1 = frame->frame + frame->rsize; */ -/* OBSOLETE CORE_ADDR lr1; */ -/* OBSOLETE CORE_ADDR original_lr0; */ -/* OBSOLETE int must_fix_lr0 = 0; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE /* If popping a dummy frame, need to restore registers. */ */ -/* OBSOLETE if (PC_IN_CALL_DUMMY (read_register (PC_REGNUM), */ -/* OBSOLETE read_register (SP_REGNUM), */ -/* OBSOLETE FRAME_FP (frame))) */ -/* OBSOLETE { */ -/* OBSOLETE int lrnum = LR0_REGNUM + DUMMY_ARG / 4; */ -/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR128; ++i) */ -/* OBSOLETE write_register (SR_REGNUM (i + 128), read_register (lrnum++)); */ -/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR160; ++i) */ -/* OBSOLETE write_register (SR_REGNUM (i + 160), read_register (lrnum++)); */ -/* OBSOLETE for (i = 0; i < DUMMY_SAVE_GREGS; ++i) */ -/* OBSOLETE write_register (RETURN_REGNUM + i, read_register (lrnum++)); */ -/* OBSOLETE /* Restore the PCs and prepare to restore LR0. */ */ -/* OBSOLETE write_register (PC_REGNUM, read_register (lrnum++)); */ -/* OBSOLETE write_register (NPC_REGNUM, read_register (lrnum++)); */ -/* OBSOLETE write_register (PC2_REGNUM, read_register (lrnum++)); */ -/* OBSOLETE original_lr0 = read_register (lrnum++); */ -/* OBSOLETE must_fix_lr0 = 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Restore the memory stack pointer. */ */ -/* OBSOLETE write_register (MSP_REGNUM, frame->saved_msp); */ -/* OBSOLETE /* Restore the register stack pointer. */ */ -/* OBSOLETE write_register (GR1_REGNUM, gr1); */ -/* OBSOLETE */ -/* OBSOLETE /* If we popped a dummy frame, restore lr0 now that gr1 has been restored. */ */ -/* OBSOLETE if (must_fix_lr0) */ -/* OBSOLETE write_register (LR0_REGNUM, original_lr0); */ -/* OBSOLETE */ -/* OBSOLETE /* Check whether we need to fill registers. */ */ -/* OBSOLETE lr1 = read_register (LR0_REGNUM + 1); */ -/* OBSOLETE if (lr1 > rfb) */ -/* OBSOLETE { */ -/* OBSOLETE /* Fill. */ */ -/* OBSOLETE int num_bytes = lr1 - rfb; */ -/* OBSOLETE int i; */ -/* OBSOLETE long word; */ -/* OBSOLETE */ -/* OBSOLETE write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes); */ -/* OBSOLETE write_register (RFB_REGNUM, lr1); */ -/* OBSOLETE for (i = 0; i < num_bytes; i += 4) */ -/* OBSOLETE { */ -/* OBSOLETE /* Note: word is in host byte order. */ */ -/* OBSOLETE word = read_memory_integer (rfb + i, 4); */ -/* OBSOLETE write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE flush_cached_frames (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE push_dummy_frame (void) */ -/* OBSOLETE { */ -/* OBSOLETE long w; */ -/* OBSOLETE CORE_ADDR rab, gr1; */ -/* OBSOLETE CORE_ADDR msp = read_register (MSP_REGNUM); */ -/* OBSOLETE int lrnum, i; */ -/* OBSOLETE CORE_ADDR original_lr0; */ -/* OBSOLETE */ -/* OBSOLETE /* Read original lr0 before changing gr1. This order isn't really needed */ -/* OBSOLETE since GDB happens to have a snapshot of all the regs and doesn't toss */ -/* OBSOLETE it when gr1 is changed. But it's The Right Thing To Do. */ */ -/* OBSOLETE original_lr0 = read_register (LR0_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE /* Allocate the new frame. */ */ -/* OBSOLETE gr1 = read_register (GR1_REGNUM) - DUMMY_FRAME_RSIZE; */ -/* OBSOLETE write_register (GR1_REGNUM, gr1); */ -/* OBSOLETE */ -/* OBSOLETE #ifdef VXWORKS_TARGET */ -/* OBSOLETE /* We force re-reading all registers to get the new local registers set */ -/* OBSOLETE after gr1 has been modified. This fix is due to the lack of single */ -/* OBSOLETE register read/write operation in the RPC interface between VxGDB and */ -/* OBSOLETE VxWorks. This really must be changed ! */ */ -/* OBSOLETE */ -/* OBSOLETE vx_read_register (-1); */ -/* OBSOLETE */ -/* OBSOLETE #endif /* VXWORK_TARGET */ */ -/* OBSOLETE */ -/* OBSOLETE rab = read_register (RAB_REGNUM); */ -/* OBSOLETE if (gr1 < rab) */ -/* OBSOLETE { */ -/* OBSOLETE /* We need to spill registers. */ */ -/* OBSOLETE int num_bytes = rab - gr1; */ -/* OBSOLETE CORE_ADDR rfb = read_register (RFB_REGNUM); */ -/* OBSOLETE int i; */ -/* OBSOLETE long word; */ -/* OBSOLETE */ -/* OBSOLETE write_register (RFB_REGNUM, rfb - num_bytes); */ -/* OBSOLETE write_register (RAB_REGNUM, gr1); */ -/* OBSOLETE for (i = 0; i < num_bytes; i += 4) */ -/* OBSOLETE { */ -/* OBSOLETE /* Note: word is in target byte order. */ */ -/* OBSOLETE read_register_gen (LR0_REGNUM + i / 4, (char *) &word); */ -/* OBSOLETE write_memory (rfb - num_bytes + i, (char *) &word, 4); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* There are no arguments in to the dummy frame, so we don't need */ -/* OBSOLETE more than rsize plus the return address and lr1. */ */ -/* OBSOLETE write_register (LR0_REGNUM + 1, gr1 + DUMMY_FRAME_RSIZE + 2 * 4); */ -/* OBSOLETE */ -/* OBSOLETE /* Set the memory frame pointer. */ */ -/* OBSOLETE write_register (LR0_REGNUM + DUMMY_FRAME_RSIZE / 4 - 1, msp); */ -/* OBSOLETE */ -/* OBSOLETE /* Allocate arg_slop. */ */ -/* OBSOLETE write_register (MSP_REGNUM, msp - 16 * 4); */ -/* OBSOLETE */ -/* OBSOLETE /* Save registers. */ */ -/* OBSOLETE lrnum = LR0_REGNUM + DUMMY_ARG / 4; */ -/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR128; ++i) */ -/* OBSOLETE write_register (lrnum++, read_register (SR_REGNUM (i + 128))); */ -/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR160; ++i) */ -/* OBSOLETE write_register (lrnum++, read_register (SR_REGNUM (i + 160))); */ -/* OBSOLETE for (i = 0; i < DUMMY_SAVE_GREGS; ++i) */ -/* OBSOLETE write_register (lrnum++, read_register (RETURN_REGNUM + i)); */ -/* OBSOLETE /* Save the PCs and LR0. */ */ -/* OBSOLETE write_register (lrnum++, read_register (PC_REGNUM)); */ -/* OBSOLETE write_register (lrnum++, read_register (NPC_REGNUM)); */ -/* OBSOLETE write_register (lrnum++, read_register (PC2_REGNUM)); */ -/* OBSOLETE */ -/* OBSOLETE /* Why are we saving LR0? What would clobber it? (the dummy frame should */ -/* OBSOLETE be below it on the register stack, no?). */ */ -/* OBSOLETE write_register (lrnum++, original_lr0); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE This routine takes three arguments and makes the cached frames look */ -/* OBSOLETE as if these arguments defined a frame on the cache. This allows the */ -/* OBSOLETE rest of `info frame' to extract the important arguments without much */ -/* OBSOLETE difficulty. Since an individual frame on the 29K is determined by */ -/* OBSOLETE three values (FP, PC, and MSP), we really need all three to do a */ -/* OBSOLETE good job. */ */ -/* OBSOLETE */ -/* OBSOLETE struct frame_info * */ -/* OBSOLETE setup_arbitrary_frame (int argc, CORE_ADDR *argv) */ -/* OBSOLETE { */ -/* OBSOLETE struct frame_info *frame; */ -/* OBSOLETE */ -/* OBSOLETE if (argc != 3) */ -/* OBSOLETE error ("AMD 29k frame specifications require three arguments: rsp pc msp"); */ -/* OBSOLETE */ -/* OBSOLETE frame = create_new_frame (argv[0], argv[1]); */ -/* OBSOLETE */ -/* OBSOLETE if (!frame) */ -/* OBSOLETE internal_error (__FILE__, __LINE__, */ -/* OBSOLETE "create_new_frame returned invalid frame id"); */ -/* OBSOLETE */ -/* OBSOLETE /* Creating a new frame munges the `frame' value from the current */ -/* OBSOLETE GR1, so we restore it again here. FIXME, untangle all this */ -/* OBSOLETE 29K frame stuff... */ */ -/* OBSOLETE frame->frame = argv[0]; */ -/* OBSOLETE */ -/* OBSOLETE /* Our MSP is in argv[2]. It'd be intelligent if we could just */ -/* OBSOLETE save this value in the FRAME. But the way it's set up (FIXME), */ -/* OBSOLETE we must save our caller's MSP. We compute that by adding our */ -/* OBSOLETE memory stack frame size to our MSP. */ */ -/* OBSOLETE frame->saved_msp = argv[2] + frame->msize; */ -/* OBSOLETE */ -/* OBSOLETE return frame; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE gdb_print_insn_a29k (bfd_vma memaddr, disassemble_info *info) */ -/* OBSOLETE { */ -/* OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) */ -/* OBSOLETE return print_insn_big_a29k (memaddr, info); */ -/* OBSOLETE else */ -/* OBSOLETE return print_insn_little_a29k (memaddr, info); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE enum a29k_processor_types processor_type = a29k_unknown; */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE a29k_get_processor_type (void) */ -/* OBSOLETE { */ -/* OBSOLETE unsigned int cfg_reg = (unsigned int) read_register (CFG_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE /* Most of these don't have freeze mode. */ */ -/* OBSOLETE processor_type = a29k_no_freeze_mode; */ -/* OBSOLETE */ -/* OBSOLETE switch ((cfg_reg >> 28) & 0xf) */ -/* OBSOLETE { */ -/* OBSOLETE case 0: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29000"); */ -/* OBSOLETE break; */ -/* OBSOLETE case 1: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29005"); */ -/* OBSOLETE break; */ -/* OBSOLETE case 2: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29050"); */ -/* OBSOLETE processor_type = a29k_freeze_mode; */ -/* OBSOLETE break; */ -/* OBSOLETE case 3: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29035"); */ -/* OBSOLETE break; */ -/* OBSOLETE case 4: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29030"); */ -/* OBSOLETE break; */ -/* OBSOLETE case 5: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am2920*"); */ -/* OBSOLETE break; */ -/* OBSOLETE case 6: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am2924*"); */ -/* OBSOLETE break; */ -/* OBSOLETE case 7: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29040"); */ -/* OBSOLETE break; */ -/* OBSOLETE default: */ -/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an unknown Am29k\n"); */ -/* OBSOLETE /* Don't bother to print the revision. */ */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE fprintf_filtered (gdb_stderr, " revision %c\n", 'A' + ((cfg_reg >> 24) & 0x0f)); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #ifdef GET_LONGJMP_TARGET */ -/* OBSOLETE /* Figure out where the longjmp will land. We expect that we have just entered */ -/* OBSOLETE longjmp and haven't yet setup the stack frame, so the args are still in the */ -/* OBSOLETE output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we */ -/* OBSOLETE extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. */ -/* OBSOLETE This routine returns true on success */ */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE get_longjmp_target (CORE_ADDR *pc) */ -/* OBSOLETE { */ -/* OBSOLETE CORE_ADDR jb_addr; */ -/* OBSOLETE char buf[sizeof (CORE_ADDR)]; */ -/* OBSOLETE */ -/* OBSOLETE jb_addr = read_register (LR2_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) buf, */ -/* OBSOLETE sizeof (CORE_ADDR))) */ -/* OBSOLETE return 0; */ -/* OBSOLETE */ -/* OBSOLETE *pc = extract_address ((PTR) buf, sizeof (CORE_ADDR)); */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* GET_LONGJMP_TARGET */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE _initialize_a29k_tdep (void) */ -/* OBSOLETE { */ -/* OBSOLETE extern CORE_ADDR text_end; */ -/* OBSOLETE */ -/* OBSOLETE tm_print_insn = gdb_print_insn_a29k; */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME, there should be a way to make a CORE_ADDR variable settable. */ */ -/* OBSOLETE add_show_from_set */ -/* OBSOLETE (add_set_cmd ("rstack_high_address", class_support, var_uinteger, */ -/* OBSOLETE (char *) &rstack_high_address, */ -/* OBSOLETE "Set top address in memory of the register stack.\n\ */ -/* OBSOLETE Attempts to access registers saved above this address will be ignored\n\ */ -/* OBSOLETE or will produce the value -1.", &setlist), */ -/* OBSOLETE &showlist); */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME, there should be a way to make a CORE_ADDR variable settable. */ */ -/* OBSOLETE add_show_from_set */ -/* OBSOLETE (add_set_cmd ("call_scratch_address", class_support, var_uinteger, */ -/* OBSOLETE (char *) &text_end, */ -/* OBSOLETE "Set address in memory where small amounts of RAM can be used\n\ */ -/* OBSOLETE when making function calls into the inferior.", &setlist), */ -/* OBSOLETE &showlist); */ -/* OBSOLETE } */ diff --git a/gdb/config/a29k/a29k-udi.mt b/gdb/config/a29k/a29k-udi.mt deleted file mode 100644 index 6fe45b0..0000000 --- a/gdb/config/a29k/a29k-udi.mt +++ /dev/null @@ -1,5 +0,0 @@ -# OBSOLETE # Target: AMD 29000 on EB29K board over a serial line -# OBSOLETE TDEPFILES= a29k-tdep.o remote-udi.o udip2soc.o udr.o udi2go32.o -# OBSOLETE TM_FILE= tm-a29k.h -# OBSOLETE -# OBSOLETE MT_CFLAGS = $(HOST_IPC) diff --git a/gdb/config/a29k/a29k.mt b/gdb/config/a29k/a29k.mt deleted file mode 100644 index b235c05..0000000 --- a/gdb/config/a29k/a29k.mt +++ /dev/null @@ -1,5 +0,0 @@ -# OBSOLETE # Target: AMD 29000 -# OBSOLETE TDEPFILES= a29k-tdep.o remote-eb.o remote-adapt.o -# OBSOLETE TM_FILE= tm-a29k.h -# OBSOLETE -# OBSOLETE MT_CFLAGS = -DNO_HIF_SUPPORT diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h deleted file mode 100644 index c296f59..0000000 --- a/gdb/config/a29k/tm-a29k.h +++ /dev/null @@ -1,722 +0,0 @@ -/* OBSOLETE /* Parameters for target machine AMD 29000, for GDB, the GNU debugger. */ -/* OBSOLETE Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */ -/* OBSOLETE 2001 Free Software Foundation, Inc. */ -/* OBSOLETE Contributed by Cygnus Support. Written by Jim Kingdon. */ -/* 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 "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE /* Parameters for an EB29K (a board which plugs into a PC and is */ -/* OBSOLETE accessed through EBMON software running on the PC, which we */ -/* OBSOLETE use as we'd use a remote stub (see remote-eb.c). */ -/* OBSOLETE */ -/* OBSOLETE If gdb is ported to other a29k machines/systems, the */ -/* OBSOLETE machine/system-specific parts should be removed from this file (a */ -/* OBSOLETE la tm-m68k.h). */ */ -/* OBSOLETE */ -/* OBSOLETE /* Byte order is configurable, but this machine runs big-endian. */ */ -/* OBSOLETE #define TARGET_BYTE_ORDER BFD_ENDIAN_BIG */ -/* OBSOLETE */ -/* OBSOLETE /* Floating point uses IEEE representations. */ */ -/* OBSOLETE #define IEEE_FLOAT (1) */ -/* OBSOLETE */ -/* OBSOLETE /* Recognize our magic number. */ */ -/* OBSOLETE #define BADMAG(x) ((x).f_magic != 0572) */ -/* 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 PC across any function entry prologue instructions */ -/* OBSOLETE to reach some "real" code. */ */ -/* OBSOLETE */ -/* OBSOLETE #define SKIP_PROLOGUE(pc) (a29k_skip_prologue (pc)) */ -/* OBSOLETE CORE_ADDR a29k_skip_prologue (); */ -/* 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 */ -/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) ((frame->flags & TRANSPARENT_FRAME) \ */ -/* OBSOLETE ? read_register (TPC_REGNUM) \ */ -/* OBSOLETE : read_register (LR0_REGNUM)) */ -/* OBSOLETE */ -/* OBSOLETE /* Stack grows downward. */ */ -/* OBSOLETE */ -/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */ -/* OBSOLETE */ -/* OBSOLETE /* Stack must be aligned on 32-bit boundaries when synthesizing */ -/* OBSOLETE function calls. */ */ -/* OBSOLETE */ -/* OBSOLETE #define STACK_ALIGN(ADDR) (((ADDR) + 3) & ~3) */ -/* OBSOLETE */ -/* OBSOLETE /* Sequence of bytes for breakpoint instruction. */ */ -/* OBSOLETE /* ASNEQ 0x50, gr1, gr1 */ -/* OBSOLETE The trap number 0x50 is chosen arbitrarily. */ -/* OBSOLETE We let the command line (or previously included files) override this */ -/* OBSOLETE setting. */ */ -/* OBSOLETE #ifndef BREAKPOINT */ -/* OBSOLETE #if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG */ -/* OBSOLETE #define BREAKPOINT {0x72, 0x50, 0x01, 0x01} */ -/* OBSOLETE #else /* Target is little-endian. */ */ -/* OBSOLETE #define BREAKPOINT {0x01, 0x01, 0x50, 0x72} */ -/* OBSOLETE #endif /* Target is little-endian. */ */ -/* OBSOLETE #endif /* BREAKPOINT */ */ -/* OBSOLETE */ -/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */ -/* OBSOLETE This is often the number of bytes in BREAKPOINT */ -/* OBSOLETE but not always. */ */ -/* OBSOLETE */ -/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */ -/* 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 /* Allow the register declarations here to be overridden for remote */ -/* OBSOLETE kernel debugging. */ */ -/* OBSOLETE #if !defined (REGISTER_NAMES) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of machine registers */ */ -/* OBSOLETE */ -/* OBSOLETE #define NUM_REGS 205 */ -/* OBSOLETE */ -/* OBSOLETE /* Initializer for an array of names of registers. */ -/* OBSOLETE There should be NUM_REGS strings in this initializer. */ -/* OBSOLETE */ -/* OBSOLETE FIXME, add floating point registers and support here. */ -/* OBSOLETE */ -/* OBSOLETE Also note that this list does not attempt to deal with kernel */ -/* OBSOLETE debugging (in which the first 32 registers are gr64-gr95). */ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_NAMES \ */ -/* OBSOLETE {"gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \ */ -/* OBSOLETE "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \ */ -/* OBSOLETE "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \ */ -/* OBSOLETE "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \ */ -/* OBSOLETE "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \ */ -/* OBSOLETE "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \ */ -/* OBSOLETE "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \ */ -/* OBSOLETE "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \ */ -/* OBSOLETE "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \ */ -/* OBSOLETE "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \ */ -/* OBSOLETE "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \ */ -/* OBSOLETE "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \ */ -/* OBSOLETE "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \ */ -/* OBSOLETE "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \ */ -/* OBSOLETE "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \ */ -/* OBSOLETE "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \ */ -/* OBSOLETE "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \ */ -/* OBSOLETE "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \ */ -/* OBSOLETE "lr124", "lr125", "lr126", "lr127", \ */ -/* OBSOLETE "AI0", "AI1", "AI2", "AI3", "AI4", "AI5", "AI6", "AI7", "AI8", "AI9", \ */ -/* OBSOLETE "AI10", "AI11", "AI12", "AI13", "AI14", "AI15", "FP", \ */ -/* OBSOLETE "bp", "fc", "cr", "q", \ */ -/* OBSOLETE "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \ */ -/* OBSOLETE "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "inte", "fps", "exo", "gr1", \ */ -/* OBSOLETE "alu", "ipc", "ipa", "ipb" } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Converts an sdb register number to an internal gdb register number. */ -/* OBSOLETE * Currently under epi, gr96->0...gr127->31...lr0->32...lr127->159, or... */ -/* OBSOLETE * gr64->0...gr95->31, lr0->32...lr127->159. */ -/* OBSOLETE */ */ -/* OBSOLETE #define SDB_REG_TO_REGNUM(value) \ */ -/* OBSOLETE (((value) >= 96 && (value) <= 127) ? ((value) - 96) : \ */ -/* OBSOLETE ((value) >= 128 && (value) <= 255) ? ((value) - 128 + LR0_REGNUM) : \ */ -/* OBSOLETE (value)) */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Provide the processor register numbers of some registers that are */ -/* OBSOLETE * expected/written in instructions that might change under different */ -/* OBSOLETE * register sets. Namely, gcc can compile (-mkernel-registers) so that */ -/* OBSOLETE * it uses gr64-gr95 in stead of gr96-gr127. */ -/* OBSOLETE */ */ -/* OBSOLETE #define MSP_HW_REGNUM 125 /* gr125 */ */ -/* OBSOLETE #define RAB_HW_REGNUM 126 /* gr126 */ */ -/* OBSOLETE */ -/* OBSOLETE /* Convert Processor Special register #x to REGISTER_NAMES register # */ */ -/* OBSOLETE #define SR_REGNUM(x) \ */ -/* OBSOLETE ((x) < 15 ? VAB_REGNUM + (x) \ */ -/* OBSOLETE : (x) >= 128 && (x) < 131 ? IPC_REGNUM + (x) - 128 \ */ -/* OBSOLETE : (x) == 131 ? Q_REGNUM \ */ -/* OBSOLETE : (x) == 132 ? ALU_REGNUM \ */ -/* OBSOLETE : (x) >= 133 && (x) < 136 ? BP_REGNUM + (x) - 133 \ */ -/* OBSOLETE : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x) - 160 \ */ -/* OBSOLETE : (x) == 164 ? EXO_REGNUM \ */ -/* OBSOLETE : (error ("Internal error in SR_REGNUM"), 0)) */ -/* OBSOLETE #define GR96_REGNUM 0 */ -/* OBSOLETE */ -/* OBSOLETE /* Define the return register separately, so it can be overridden for */ -/* OBSOLETE kernel procedure calling conventions. */ */ -/* OBSOLETE #define RETURN_REGNUM GR96_REGNUM */ -/* OBSOLETE #define GR1_REGNUM 200 */ -/* OBSOLETE /* This needs to be the memory stack pointer, not the register stack pointer, */ -/* OBSOLETE to make call_function work right. */ */ -/* OBSOLETE #define SP_REGNUM MSP_REGNUM */ -/* OBSOLETE #define FP_REGNUM 33 /* lr1 */ */ -/* OBSOLETE */ -/* OBSOLETE /* Return register for transparent calling convention (gr122). */ */ -/* OBSOLETE #define TPC_REGNUM (122 - 96 + GR96_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* Large Return Pointer (gr123). */ */ -/* OBSOLETE #define LRP_REGNUM (123 - 96 + GR96_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* Static link pointer (gr124). */ */ -/* OBSOLETE #define SLP_REGNUM (124 - 96 + GR96_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* Memory Stack Pointer (gr125). */ */ -/* OBSOLETE #define MSP_REGNUM (125 - 96 + GR96_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* Register allocate bound (gr126). */ */ -/* OBSOLETE #define RAB_REGNUM (126 - 96 + GR96_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* Register Free Bound (gr127). */ */ -/* OBSOLETE #define RFB_REGNUM (127 - 96 + GR96_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* Register Stack Pointer. */ */ -/* OBSOLETE #define RSP_REGNUM GR1_REGNUM */ -/* OBSOLETE #define LR0_REGNUM 32 */ -/* OBSOLETE #define BP_REGNUM 177 */ -/* OBSOLETE #define FC_REGNUM 178 */ -/* OBSOLETE #define CR_REGNUM 179 */ -/* OBSOLETE #define Q_REGNUM 180 */ -/* OBSOLETE #define VAB_REGNUM 181 */ -/* OBSOLETE #define OPS_REGNUM (VAB_REGNUM + 1) */ -/* OBSOLETE #define CPS_REGNUM (VAB_REGNUM + 2) */ -/* OBSOLETE #define CFG_REGNUM (VAB_REGNUM + 3) */ -/* OBSOLETE #define CHA_REGNUM (VAB_REGNUM + 4) */ -/* OBSOLETE #define CHD_REGNUM (VAB_REGNUM + 5) */ -/* OBSOLETE #define CHC_REGNUM (VAB_REGNUM + 6) */ -/* OBSOLETE #define RBP_REGNUM (VAB_REGNUM + 7) */ -/* OBSOLETE #define TMC_REGNUM (VAB_REGNUM + 8) */ -/* OBSOLETE #define TMR_REGNUM (VAB_REGNUM + 9) */ -/* OBSOLETE #define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */ */ -/* OBSOLETE #define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */ */ -/* OBSOLETE #define PC2_REGNUM (VAB_REGNUM + 12) */ -/* OBSOLETE #define MMU_REGNUM (VAB_REGNUM + 13) */ -/* OBSOLETE #define LRU_REGNUM (VAB_REGNUM + 14) */ -/* OBSOLETE #define FPE_REGNUM (VAB_REGNUM + 15) */ -/* OBSOLETE #define INTE_REGNUM (VAB_REGNUM + 16) */ -/* OBSOLETE #define FPS_REGNUM (VAB_REGNUM + 17) */ -/* OBSOLETE #define EXO_REGNUM (VAB_REGNUM + 18) */ -/* OBSOLETE /* gr1 is defined above as 200 = VAB_REGNUM + 19 */ */ -/* OBSOLETE #define ALU_REGNUM (VAB_REGNUM + 20) */ -/* OBSOLETE #define PS_REGNUM ALU_REGNUM */ -/* OBSOLETE #define IPC_REGNUM (VAB_REGNUM + 21) */ -/* OBSOLETE #define IPA_REGNUM (VAB_REGNUM + 22) */ -/* OBSOLETE #define IPB_REGNUM (VAB_REGNUM + 23) */ -/* OBSOLETE */ -/* OBSOLETE #endif /* !defined(REGISTER_NAMES) */ */ -/* 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 (NUM_REGS * 4) */ -/* OBSOLETE */ -/* OBSOLETE /* Index within `registers' of the first byte of the space for */ -/* OBSOLETE register N. */ */ -/* OBSOLETE #define REGISTER_BYTE(N) ((N)*4) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the actual machine representation */ -/* OBSOLETE for register N. */ */ -/* OBSOLETE */ -/* OBSOLETE /* All regs are 4 bytes. */ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_RAW_SIZE(N) (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the program's representation */ -/* OBSOLETE for register N. */ */ -/* OBSOLETE */ -/* OBSOLETE /* All regs are 4 bytes. */ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ */ -/* OBSOLETE */ -/* OBSOLETE #define MAX_REGISTER_RAW_SIZE (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */ */ -/* OBSOLETE */ -/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Return the GDB type object for the "standard" data type */ -/* OBSOLETE of data in register N. */ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */ -/* OBSOLETE (((N) == PC_REGNUM || (N) == LRP_REGNUM || (N) == SLP_REGNUM \ */ -/* OBSOLETE || (N) == MSP_REGNUM || (N) == RAB_REGNUM || (N) == RFB_REGNUM \ */ -/* OBSOLETE || (N) == GR1_REGNUM || (N) == FP_REGNUM || (N) == LR0_REGNUM \ */ -/* OBSOLETE || (N) == NPC_REGNUM || (N) == PC2_REGNUM) \ */ -/* OBSOLETE ? lookup_pointer_type (builtin_type_void) : builtin_type_int) */ -/* 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 /* On the a29k the LRP points to the part of the structure beyond the first */ -/* OBSOLETE 16 words. */ */ -/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */ -/* OBSOLETE write_register (LRP_REGNUM, (ADDR) + 16 * 4); */ -/* OBSOLETE */ -/* OBSOLETE /* Should call_function allocate stack space for a struct return? */ */ -/* OBSOLETE /* On the a29k objects over 16 words require the caller to allocate space. */ */ -/* OBSOLETE extern use_struct_convention_fn a29k_use_struct_convention; */ -/* OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) a29k_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. */ */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE int reg_length = TYPE_LENGTH (TYPE); \ */ -/* OBSOLETE if (reg_length > 16 * 4) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE reg_length = 16 * 4; \ */ -/* OBSOLETE read_memory (*((int *)(REGBUF) + LRP_REGNUM), (VALBUF) + 16 * 4, \ */ -/* OBSOLETE TYPE_LENGTH (TYPE) - 16 * 4); \ */ -/* OBSOLETE } \ */ -/* OBSOLETE memcpy ((VALBUF), ((int *)(REGBUF))+RETURN_REGNUM, reg_length); \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Write into appropriate registers a function return value */ -/* OBSOLETE of type TYPE, given in virtual format. */ */ -/* OBSOLETE */ -/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE int reg_length = TYPE_LENGTH (TYPE); \ */ -/* OBSOLETE if (reg_length > 16 * 4) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE reg_length = 16 * 4; \ */ -/* OBSOLETE write_memory (read_register (LRP_REGNUM), \ */ -/* OBSOLETE (char *)(VALBUF) + 16 * 4, \ */ -/* OBSOLETE TYPE_LENGTH (TYPE) - 16 * 4); \ */ -/* OBSOLETE } \ */ -/* OBSOLETE write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF), \ */ -/* OBSOLETE TYPE_LENGTH (TYPE)); \ */ -/* OBSOLETE } */ -/* OBSOLETE /* *INDENT-OFF* */ */ -/* OBSOLETE /* The a29k user's guide documents well what the stacks look like. */ -/* OBSOLETE But what isn't so clear there is how this interracts with the */ -/* OBSOLETE symbols, or with GDB. */ -/* OBSOLETE In the following saved_msp, saved memory stack pointer (which functions */ -/* OBSOLETE as a memory frame pointer), means either */ -/* OBSOLETE a register containing the memory frame pointer or, in the case of */ -/* OBSOLETE functions with fixed size memory frames (i.e. those who don't use */ -/* OBSOLETE alloca()), the result of the calculation msp + msize. */ -/* OBSOLETE */ -/* OBSOLETE LOC_ARG, LOC_LOCAL - For GCC, these are relative to saved_msp. */ -/* OBSOLETE For high C, these are relative to msp (making alloca impossible). */ -/* OBSOLETE LOC_REGISTER, LOC_REGPARM - The register number is the number at the */ -/* OBSOLETE time the function is running (after the prologue), or in the case */ -/* OBSOLETE of LOC_REGPARM, may be a register number in the range 160-175. */ -/* OBSOLETE */ -/* OBSOLETE The compilers do things like store an argument into memory, and then put out */ -/* OBSOLETE a LOC_ARG for it, or put it into global registers and put out a */ -/* OBSOLETE LOC_REGPARM. Thus is it important to execute the first line of */ -/* OBSOLETE code (i.e. the line of the open brace, i.e. the prologue) of a function */ -/* OBSOLETE before trying to print arguments or anything. */ -/* OBSOLETE */ -/* OBSOLETE The following diagram attempts to depict what is going on in memory */ -/* OBSOLETE (see also the _a29k user's guide_) and also how that interacts with */ -/* OBSOLETE GDB frames. We arbitrarily pick fci->frame to point the same place */ -/* OBSOLETE as the register stack pointer; since we set it ourself in */ -/* OBSOLETE INIT_EXTRA_FRAME_INFO, and access it only through the FRAME_* */ -/* OBSOLETE macros, it doesn't really matter exactly how we */ -/* OBSOLETE do it. However, note that FRAME_FP is used in two ways in GDB: */ -/* OBSOLETE (1) as a "magic cookie" which uniquely identifies frames (even over */ -/* OBSOLETE calls to the inferior), (2) (in PC_IN_CALL_DUMMY [ON_STACK]) */ -/* OBSOLETE as the value of SP_REGNUM before the dummy frame was pushed. These */ -/* OBSOLETE two meanings would be incompatible for the a29k if we defined */ -/* OBSOLETE CALL_DUMMY_LOCATION == ON_STACK (but we don't, so don't worry about it). */ -/* OBSOLETE Also note that "lr1" below, while called a frame pointer */ -/* OBSOLETE in the user's guide, has only one function: To determine whether */ -/* OBSOLETE registers need to be filled in the function epilogue. */ -/* OBSOLETE */ -/* OBSOLETE Consider the code: */ -/* OBSOLETE < call bar> */ -/* OBSOLETE loc1: . . . */ -/* OBSOLETE bar: sub gr1,gr1,rsize_b */ -/* OBSOLETE . . . */ -/* OBSOLETE add mfp,msp,0 */ -/* OBSOLETE sub msp,msp,msize_b */ -/* OBSOLETE . . . */ -/* OBSOLETE < call foo > */ -/* OBSOLETE loc2: . . . */ -/* OBSOLETE foo: sub gr1,gr1,rsize_f */ -/* OBSOLETE . . . */ -/* OBSOLETE add mfp,msp,0 */ -/* OBSOLETE sub msp,msp,msize_f */ -/* OBSOLETE . . . */ -/* OBSOLETE loc3: < suppose the inferior stops here > */ -/* OBSOLETE */ -/* OBSOLETE memory stack register stack */ -/* OBSOLETE | | |____________| */ -/* OBSOLETE | | |____loc1____| */ -/* OBSOLETE +------->|___________| | | ^ */ -/* OBSOLETE | | ^ | | locals_b | | */ -/* OBSOLETE | | | | |____________| | */ -/* OBSOLETE | | | | | | | rsize_b */ -/* OBSOLETE | | | msize_b | | args_to_f | | */ -/* OBSOLETE | | | | |____________| | */ -/* OBSOLETE | | | | |____lr1_____| V */ -/* OBSOLETE | | V | |____loc2____|<----------------+ */ -/* OBSOLETE | +--->|___________|<---------mfp | ^ | */ -/* OBSOLETE | | | ^ | | locals_f | | | */ -/* OBSOLETE | | | | msize_f | |____________| | | */ -/* OBSOLETE | | | | | | | | rsize_f | */ -/* OBSOLETE | | | V | | args | | | */ -/* OBSOLETE | | |___________|<msp |____________| | | */ -/* OBSOLETE | | |_____lr1____| V | */ -/* OBSOLETE | | |___garbage__| <- gr1 <----+ | */ -/* OBSOLETE | | | | */ -/* OBSOLETE | | | | */ -/* OBSOLETE | | pc=loc3 | | */ -/* OBSOLETE | | | | */ -/* OBSOLETE | | | | */ -/* OBSOLETE | | frame cache | | */ -/* OBSOLETE | | |_________________| | | */ -/* OBSOLETE | | |rsize=rsize_b | | | */ -/* OBSOLETE | | |msize=msize_b | | | */ -/* OBSOLETE +---|--------saved_msp | | | */ -/* OBSOLETE | |frame------------------------------------|---+ */ -/* OBSOLETE | |pc=loc2 | | */ -/* OBSOLETE | |_________________| | */ -/* OBSOLETE | |rsize=rsize_f | | */ -/* OBSOLETE | |msize=msize_f | | */ -/* OBSOLETE +--------saved_msp | | */ -/* OBSOLETE |frame------------------------------------+ */ -/* OBSOLETE |pc=loc3 | */ -/* OBSOLETE |_________________| */ -/* OBSOLETE */ -/* OBSOLETE So, is that sufficiently confusing? Welcome to the 29000. */ -/* OBSOLETE Notes: */ -/* OBSOLETE * The frame for foo uses a memory frame pointer but the frame for */ -/* OBSOLETE bar does not. In the latter case the saved_msp is */ -/* OBSOLETE computed by adding msize to the saved_msp of the */ -/* OBSOLETE next frame. */ -/* OBSOLETE * msize is in the frame cache only for high C's sake. */ */ -/* OBSOLETE /* *INDENT-ON* */ */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE void read_register_stack (); */ -/* OBSOLETE long read_register_stack_integer (); */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_INIT_SAVED_REGS(fi) /*no-op */ */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRA_FRAME_INFO \ */ -/* OBSOLETE CORE_ADDR saved_msp; \ */ -/* OBSOLETE unsigned int rsize; \ */ -/* OBSOLETE unsigned int msize; \ */ -/* OBSOLETE unsigned char flags; */ -/* OBSOLETE */ -/* OBSOLETE /* Bits for flags in EXTRA_FRAME_INFO */ */ -/* OBSOLETE #define TRANSPARENT_FRAME 0x1 /* This is a transparent frame */ */ -/* OBSOLETE #define MFP_USED 0x2 /* A memory frame pointer is used */ */ -/* OBSOLETE */ -/* OBSOLETE /* Because INIT_FRAME_PC gets passed fromleaf, that's where we init */ -/* OBSOLETE not only ->pc and ->frame, but all the extra stuff, when called from */ -/* OBSOLETE get_prev_frame, that is. */ */ -/* OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci) */ -/* OBSOLETE void init_extra_frame_info (); */ -/* OBSOLETE */ -/* OBSOLETE #define INIT_FRAME_PC(fromleaf, fci) init_frame_pc(fromleaf, fci) */ -/* OBSOLETE void init_frame_pc (); */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* FRAME_CHAIN takes a FRAME */ -/* 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 /* On the a29k, the nominal address of a frame is the address on the */ -/* OBSOLETE register stack of the return address (the one next to the incoming */ -/* OBSOLETE arguments, not down at the bottom so nominal address == stack pointer). */ -/* OBSOLETE */ -/* OBSOLETE GDB expects "nominal address" to equal contents of FP_REGNUM, */ -/* OBSOLETE at least when it comes time to create the innermost frame. */ -/* OBSOLETE However, that doesn't work for us, so when creating the innermost */ -/* OBSOLETE frame we set ->frame ourselves in INIT_EXTRA_FRAME_INFO. */ */ -/* OBSOLETE */ -/* OBSOLETE /* These are mostly dummies for the a29k because INIT_FRAME_PC */ -/* OBSOLETE sets prev->frame instead. */ */ -/* OBSOLETE /* If rsize is zero, we must be at end of stack (or otherwise hosed). */ -/* OBSOLETE If we don't check rsize, we loop forever if we see rsize == 0. */ */ -/* OBSOLETE #define FRAME_CHAIN(thisframe) \ */ -/* OBSOLETE ((thisframe)->rsize == 0 \ */ -/* OBSOLETE ? 0 \ */ -/* OBSOLETE : (thisframe)->frame + (thisframe)->rsize) */ -/* OBSOLETE */ -/* OBSOLETE /* Determine if the frame has a 'previous' and back-traceable frame. */ */ -/* OBSOLETE #define FRAME_IS_UNCHAINED(frame) ((frame)->flags & TRANSPARENT_FRAME) */ -/* OBSOLETE */ -/* OBSOLETE /* Find the previous frame of a transparent routine. */ -/* OBSOLETE * For now lets not try and trace through a transparent routine (we might */ -/* OBSOLETE * have to assume that all transparent routines are traps). */ -/* OBSOLETE */ */ -/* OBSOLETE #define FIND_PREV_UNCHAINED_FRAME(frame) 0 */ -/* OBSOLETE */ -/* OBSOLETE /* Define other aspects of the stack frame. */ */ -/* OBSOLETE */ -/* OBSOLETE /* An expression that tells us whether the function invocation represented */ -/* OBSOLETE by FI does not have a frame on the stack associated with it. */ */ -/* OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \ */ -/* OBSOLETE (frameless_look_for_prologue (FI)) */ -/* OBSOLETE */ -/* OBSOLETE /* Saved pc (i.e. return address). */ */ -/* OBSOLETE #define FRAME_SAVED_PC(fraim) \ */ -/* OBSOLETE (read_register_stack_integer ((fraim)->frame + (fraim)->rsize, 4)) */ -/* OBSOLETE */ -/* OBSOLETE /* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their */ -/* OBSOLETE offsets being relative to the memory stack pointer (high C) or */ -/* OBSOLETE saved_msp (gcc). */ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) frame_locals_address (fi) */ -/* OBSOLETE extern CORE_ADDR frame_locals_address (); */ -/* OBSOLETE */ -/* OBSOLETE /* Return number of args passed to a frame. */ -/* OBSOLETE Can return -1, meaning no way to tell. */ */ -/* OBSOLETE /* We tried going to the effort of finding the tags word and getting */ -/* OBSOLETE the argcount field from it, to support debugging assembler code. */ -/* OBSOLETE Problem was, the "argcount" field never did hold the argument */ -/* OBSOLETE count. */ */ -/* OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi) */ -/* OBSOLETE */ -/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_ARGS_SKIP 0 */ -/* OBSOLETE */ -/* OBSOLETE /* Provide our own get_saved_register. HAVE_REGISTER_WINDOWS is insufficient */ -/* OBSOLETE because registers get renumbered on the a29k without getting saved. */ */ -/* OBSOLETE */ -/* OBSOLETE struct frame_info; */ -/* OBSOLETE void a29k_get_saved_register (char *raw_buffer, int *optimized, */ -/* OBSOLETE CORE_ADDR * addrp, struct frame_info *frame, */ -/* OBSOLETE int regnum, enum lval_type *lvalp); */ -/* OBSOLETE #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ */ -/* OBSOLETE a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) */ -/* OBSOLETE */ -/* OBSOLETE /* Call function stuff. */ */ -/* OBSOLETE /* *INDENT-OFF* */ */ -/* OBSOLETE /* The dummy frame looks like this (see also the general frame picture */ -/* OBSOLETE above): */ -/* OBSOLETE */ -/* OBSOLETE register stack */ -/* OBSOLETE */ -/* OBSOLETE | | frame for function */ -/* OBSOLETE | locals_sproc | executing at time */ -/* OBSOLETE |________________| of call_function. */ -/* OBSOLETE | | We must not disturb */ -/* OBSOLETE | args_out_sproc | it. */ -/* OBSOLETE memory stack |________________| */ -/* OBSOLETE |____lr1_sproc___|<-+ */ -/* OBSOLETE | | |__retaddr_sproc_| | <-- gr1 (at start) */ -/* OBSOLETE |____________|<-msp 0 <-----------mfp_dummy_____| | */ -/* OBSOLETE | | (at start) | save regs | | */ -/* OBSOLETE | arg_slop | | pc0,pc1 | | */ -/* OBSOLETE | | | pc2,lr0 sproc | | */ -/* OBSOLETE | (16 words) | | gr96-gr124 | | */ -/* OBSOLETE |____________|<-msp 1--after | sr160-sr162 | | */ -/* OBSOLETE | | PUSH_DUMMY_FRAME| sr128-sr135 | | */ -/* OBSOLETE | struct ret | |________________| | */ -/* OBSOLETE | 17+ | | | | */ -/* OBSOLETE |____________|<- lrp | args_out_dummy | | */ -/* OBSOLETE | struct ret | | (16 words) | | */ -/* OBSOLETE | 16 | |________________| | */ -/* OBSOLETE | (16 words) | |____lr1_dummy___|--+ */ -/* OBSOLETE |____________|<- msp 2--after |_retaddr_dummy__|<- gr1 after */ -/* OBSOLETE | | struct ret | | PUSH_DUMMY_FRAME */ -/* OBSOLETE | margs17+ | area allocated | locals_inf | */ -/* OBSOLETE | | |________________| called */ -/* OBSOLETE |____________|<- msp 4--when | | function's */ -/* OBSOLETE | | inf called | args_out_inf | frame (set up */ -/* OBSOLETE | margs16 | |________________| by called */ -/* OBSOLETE | (16 words) | |_____lr1_inf____| function). */ -/* OBSOLETE |____________|<- msp 3--after | . | */ -/* OBSOLETE | | args pushed | . | */ -/* OBSOLETE | | | . | */ -/* OBSOLETE | | */ -/* OBSOLETE */ -/* OBSOLETE arg_slop: This area is so that when the call dummy adds 16 words to */ -/* OBSOLETE the msp, it won't end up larger than mfp_dummy (it is needed in the */ -/* OBSOLETE case where margs and struct_ret do not add up to at least 16 words). */ -/* OBSOLETE struct ret: This area is allocated by GDB if the return value is more */ -/* OBSOLETE than 16 words. struct ret_16 is not used on the a29k. */ -/* OBSOLETE margs: Pushed by GDB. The call dummy copies the first 16 words to */ -/* OBSOLETE args_out_dummy. */ -/* OBSOLETE retaddr_sproc: Contains the PC at the time we call the function. */ -/* OBSOLETE set by PUSH_DUMMY_FRAME and read by POP_FRAME. */ -/* OBSOLETE retaddr_dummy: This points to a breakpoint instruction in the dummy. */ */ -/* OBSOLETE /* *INDENT-ON* */ */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Rsize for dummy frame, in bytes. */ */ -/* OBSOLETE */ -/* OBSOLETE /* Bytes for outgoing args, lr1, and retaddr. */ */ -/* OBSOLETE #define DUMMY_ARG (2 * 4 + 16 * 4) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of special registers (sr128-) to save. */ */ -/* OBSOLETE #define DUMMY_SAVE_SR128 8 */ -/* OBSOLETE /* Number of special registers (sr160-) to save. */ */ -/* OBSOLETE #define DUMMY_SAVE_SR160 3 */ -/* OBSOLETE /* Number of general (gr96- or gr64-) registers to save. */ */ -/* OBSOLETE #define DUMMY_SAVE_GREGS 29 */ -/* OBSOLETE */ -/* OBSOLETE #define DUMMY_FRAME_RSIZE \ */ -/* OBSOLETE (4 /* mfp_dummy */ \ */ -/* OBSOLETE + 4 * 4 /* pc0, pc1, pc2, lr0 */ \ */ -/* OBSOLETE + DUMMY_SAVE_GREGS * 4 \ */ -/* OBSOLETE + DUMMY_SAVE_SR160 * 4 \ */ -/* OBSOLETE + DUMMY_SAVE_SR128 * 4 \ */ -/* OBSOLETE + DUMMY_ARG \ */ -/* OBSOLETE + 4 /* pad to doubleword */ ) */ -/* OBSOLETE */ -/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. */ */ -/* OBSOLETE */ -/* OBSOLETE #define PUSH_DUMMY_FRAME push_dummy_frame() */ -/* OBSOLETE extern void push_dummy_frame (); */ -/* OBSOLETE */ -/* OBSOLETE /* Discard from the stack the innermost frame, */ -/* OBSOLETE restoring all saved registers. */ */ -/* OBSOLETE */ -/* OBSOLETE #define POP_FRAME pop_frame() */ -/* OBSOLETE extern void pop_frame (); */ -/* OBSOLETE */ -/* OBSOLETE /* This sequence of words is the instructions */ -/* OBSOLETE mtsrim cr, 15 */ -/* OBSOLETE loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers */ -/* OBSOLETE add msp, msp, 16 * 4 ; point to the remaining arguments */ -/* OBSOLETE CONST_INSN: */ -/* OBSOLETE const lr0,inf ; (replaced by half of target addr) */ -/* OBSOLETE consth lr0,inf ; (replaced by other half of target addr) */ -/* OBSOLETE calli lr0, lr0 */ -/* OBSOLETE aseq 0x40,gr1,gr1 ; nop */ -/* OBSOLETE BREAKPT_INSN: */ -/* OBSOLETE asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn) */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE #error "This file is broken. GDB does not define HOST_BYTE_ORDER." */ -/* OBSOLETE #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER */ -/* OBSOLETE #define BS(const) const */ -/* OBSOLETE #else */ -/* OBSOLETE #define BS(const) (((const) & 0xff) << 24) | \ */ -/* OBSOLETE (((const) & 0xff00) << 8) | \ */ -/* OBSOLETE (((const) & 0xff0000) >> 8) | \ */ -/* OBSOLETE (((const) & 0xff000000) >> 24) */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Position of the "const" and blkt instructions within CALL_DUMMY in bytes. */ */ -/* OBSOLETE #define CONST_INSN (3 * 4) */ -/* OBSOLETE #define BREAKPT_INSN (7 * 4) */ -/* OBSOLETE #define CALL_DUMMY { \ */ -/* OBSOLETE BS(0x0400870f),\ */ -/* OBSOLETE BS(0x36008200|(MSP_HW_REGNUM)), \ */ -/* OBSOLETE BS(0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16)), \ */ -/* OBSOLETE BS(0x03ff80ff), \ */ -/* OBSOLETE BS(0x02ff80ff), \ */ -/* OBSOLETE BS(0xc8008080), \ */ -/* OBSOLETE BS(0x70400101), \ */ -/* OBSOLETE BS(0x72500101)} */ -/* OBSOLETE #define CALL_DUMMY_LENGTH (8 * 4) */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */ */ -/* OBSOLETE */ -/* OBSOLETE /* Helper macro for FIX_CALL_DUMMY. WORDP is a long * which points to a */ -/* OBSOLETE word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with */ -/* OBSOLETE bits 0-7 and 8-15 of DATA (which is in host byte order). */ */ -/* OBSOLETE */ -/* OBSOLETE #if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG */ -/* OBSOLETE #define STUFF_I16(WORDP, DATA) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE *((char *)(WORDP) + 3) = ((DATA) & 0xff);\ */ -/* OBSOLETE *((char *)(WORDP) + 1) = (((DATA) >> 8) & 0xff);\ */ -/* OBSOLETE } */ -/* OBSOLETE #else /* Target is little endian. */ */ -/* OBSOLETE #define STUFF_I16(WORDP, DATA) \ */ -/* OBSOLETE { */ -/* OBSOLETE *(char *) (WORDP) = ((DATA) & 0xff); */ -/* OBSOLETE *((char *) (WORDP) + 2) = (((DATA) >> 8) & 0xff); */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* Target is little endian. */ */ -/* 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 /* Currently this stuffs in the address of the function that we are calling. */ -/* OBSOLETE Since different a29k systems use different breakpoint instructions, it */ -/* OBSOLETE also stuffs BREAKPOINT in the right place (to avoid having to */ -/* OBSOLETE duplicate CALL_DUMMY in each tm-*.h file). */ */ -/* OBSOLETE */ -/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */ -/* OBSOLETE {\ */ -/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN, fun); \ */ -/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \ */ -/* OBSOLETE /* FIXME memcpy ((char *)(dummyname) + BREAKPT_INSN, break_insn, 4); */ \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* a29k architecture has separate data & instruction memories -- wired to */ -/* OBSOLETE different pins on the chip -- and can't execute the data memory. */ -/* OBSOLETE Also, there should be space after text_end; */ -/* OBSOLETE we won't get a SIGSEGV or scribble on data space. */ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_LOCATION AFTER_TEXT_END */ -/* OBSOLETE */ -/* OBSOLETE /* Because of this, we need (as a kludge) to know the addresses of the */ -/* OBSOLETE text section. */ */ -/* OBSOLETE */ -/* OBSOLETE #define NEED_TEXT_START_END 1 */ -/* OBSOLETE */ -/* OBSOLETE /* How to translate register numbers in the .stab's into gdb's internal register */ -/* OBSOLETE numbers. We don't translate them, but we warn if an invalid register */ -/* OBSOLETE number is seen. Note that FIXME, we use the value "sym" as an implicit */ -/* OBSOLETE argument in printing the error message. It happens to be available where */ -/* OBSOLETE this macro is used. (This macro definition appeared in a late revision */ -/* OBSOLETE of gdb-3.91.6 and is not well tested. Also, it should be a "complaint".) */ */ -/* OBSOLETE */ -/* OBSOLETE #define STAB_REG_TO_REGNUM(num) \ */ -/* OBSOLETE (((num) > LR0_REGNUM + 127) \ */ -/* OBSOLETE ? fprintf(stderr, \ */ -/* OBSOLETE "Invalid register number %d in symbol table entry for %s\n", \ */ -/* OBSOLETE (num), SYMBOL_SOURCE_NAME (sym)), (num) \ */ -/* OBSOLETE : (num)) */ -/* OBSOLETE */ -/* OBSOLETE extern enum a29k_processor_types */ -/* OBSOLETE { */ -/* OBSOLETE a29k_unknown, */ -/* OBSOLETE */ -/* OBSOLETE /* Bit 0x400 of the CPS does *not* identify freeze mode, i.e. 29000, */ -/* OBSOLETE 29030, etc. */ */ -/* OBSOLETE a29k_no_freeze_mode, */ -/* OBSOLETE */ -/* OBSOLETE /* Bit 0x400 of the CPS does identify freeze mode, i.e. 29050. */ */ -/* OBSOLETE a29k_freeze_mode */ -/* OBSOLETE } */ -/* OBSOLETE processor_type; */ -/* OBSOLETE */ -/* OBSOLETE /* We need three arguments for a general frame specification for the */ -/* OBSOLETE "frame" or "info frame" command. */ */ -/* OBSOLETE */ -/* OBSOLETE #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) */ -/* OBSOLETE extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); */ diff --git a/gdb/config/a29k/tm-vx29k.h b/gdb/config/a29k/tm-vx29k.h deleted file mode 100644 index 40c6689..0000000 --- a/gdb/config/a29k/tm-vx29k.h +++ /dev/null @@ -1,230 +0,0 @@ -/* OBSOLETE /* Target machine description for VxWorks on the 29k, for GDB, the GNU debugger. */ -/* OBSOLETE Copyright 1994, 1995, 1998, 1999, 2000 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 "regcache.h" */ -/* OBSOLETE #include "value.h" */ -/* OBSOLETE #include "a29k/tm-a29k.h" */ -/* OBSOLETE #include "tm-vxworks.h" */ -/* OBSOLETE */ -/* OBSOLETE /* Number of registers in a ptrace_getregs call. */ */ -/* OBSOLETE */ -/* OBSOLETE #define VX_NUM_REGS (NUM_REGS) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of registers in a ptrace_getfpregs call. */ */ -/* OBSOLETE */ -/* OBSOLETE /* #define VX_SIZE_FPREGS */ */ -/* OBSOLETE */ -/* OBSOLETE /* This is almost certainly the wrong place for this: */ */ -/* OBSOLETE #define LR2_REGNUM 34 */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Vxworks has its own CALL_DUMMY since it manages breakpoints in the kernel */ */ -/* OBSOLETE */ -/* OBSOLETE #undef CALL_DUMMY */ -/* OBSOLETE */ -/* OBSOLETE /* Replace the breakpoint instruction in the CALL_DUMMY with a nop. */ -/* OBSOLETE For Vxworks, the breakpoint is set and deleted by calls to */ -/* OBSOLETE CALL_DUMMY_BREAK_SET and CALL_DUMMY_BREAK_DELETE. */ */ -/* OBSOLETE */ -/* OBSOLETE #error "This file is broken. GDB does not define HOST_BYTE_ORDER." */ -/* OBSOLETE #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER */ -/* OBSOLETE #define CALL_DUMMY {0x0400870f,\ */ -/* OBSOLETE 0x36008200|(MSP_HW_REGNUM), \ */ -/* OBSOLETE 0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \ */ -/* OBSOLETE 0x03ff80ff, 0x02ff80ff, 0xc8008080, 0x70400101, 0x70400101} */ -/* OBSOLETE #else /* Byte order differs. */ */ -/* OBSOLETE #define CALL_DUMMY {0x0f870004,\ */ -/* OBSOLETE 0x00820036|(MSP_HW_REGNUM << 24), \ */ -/* OBSOLETE 0x40000015|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \ */ -/* OBSOLETE 0xff80ff03, 0xff80ff02, 0x808000c8, 0x01014070, 0x01014070} */ -/* OBSOLETE #endif /* Byte order differs. */ */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* For the basic CALL_DUMMY definitions, see "tm-29k.h." We use the */ -/* OBSOLETE same CALL_DUMMY code, but define FIX_CALL_DUMMY (and related macros) */ -/* OBSOLETE locally to handle remote debugging of VxWorks targets. The difference */ -/* OBSOLETE is in the setting and clearing of the breakpoint at the end of the */ -/* OBSOLETE CALL_DUMMY code fragment; under VxWorks, we can't simply insert a */ -/* OBSOLETE breakpoint instruction into the code, since that would interfere with */ -/* OBSOLETE the breakpoint management mechanism on the target. */ -/* OBSOLETE Note that CALL_DUMMY is a piece of code that is used to call any C function */ -/* OBSOLETE thru VxGDB */ */ -/* OBSOLETE */ -/* OBSOLETE /* The offset of the instruction within the CALL_DUMMY code where we */ -/* OBSOLETE want the inferior to stop after the function call has completed. */ -/* OBSOLETE call_function_by_hand () sets a breakpoint here (via CALL_DUMMY_BREAK_SET), */ -/* OBSOLETE which POP_FRAME later deletes (via CALL_DUMMY_BREAK_DELETE). */ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_STOP_OFFSET (7 * 4) */ -/* OBSOLETE */ -/* OBSOLETE /* The offset of the first instruction of the CALL_DUMMY code fragment */ -/* OBSOLETE relative to the frame pointer for a dummy frame. This is equal to */ -/* OBSOLETE the size of the CALL_DUMMY plus the arg_slop area size (see the diagram */ -/* OBSOLETE in "tm-29k.h"). */ */ -/* OBSOLETE /* PAD : the arg_slop area size doesn't appear to me to be useful since, the */ -/* OBSOLETE call dummy code no longer modify the msp. See below. This must be checked. */ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_OFFSET_IN_FRAME (CALL_DUMMY_LENGTH + 16 * 4) */ -/* OBSOLETE */ -/* OBSOLETE /* Insert the specified number of args and function address */ -/* OBSOLETE into a CALL_DUMMY sequence stored at DUMMYNAME, replace the third */ -/* OBSOLETE instruction (add msp, msp, 16*4) with a nop, and leave the final nop. */ -/* OBSOLETE We can't keep using a CALL_DUMMY that modify the msp since, for VxWorks, */ -/* OBSOLETE CALL_DUMMY is stored in the Memory Stack. Adding 16 words to the msp */ -/* OBSOLETE would then make possible for the inferior to overwrite the CALL_DUMMY code, */ -/* OBSOLETE thus creating a lot of trouble when exiting the inferior to come back in */ -/* OBSOLETE a CALL_DUMMY code that no longer exists... Furthermore, ESF are also stored */ -/* OBSOLETE from the msp in the memory stack. If msp is set higher than the dummy code, */ -/* OBSOLETE an ESF may clobber this code. */ */ -/* OBSOLETE */ -/* OBSOLETE #if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG */ -/* OBSOLETE #define NOP_INSTR 0x70400101 */ -/* OBSOLETE #else /* Target is little endian */ */ -/* OBSOLETE #define NOP_INSTR 0x01014070 */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE #undef FIX_CALL_DUMMY */ -/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE *(int *)((char *)dummyname + 8) = NOP_INSTR; \ */ -/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN, fun); \ */ -/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* For VxWorks, CALL_DUMMY must be stored in the stack of the task that is */ -/* OBSOLETE being debugged and executed "in the context of" this task */ */ -/* OBSOLETE */ -/* OBSOLETE #undef CALL_DUMMY_LOCATION */ -/* OBSOLETE #define CALL_DUMMY_LOCATION ON_STACK */ -/* OBSOLETE */ -/* OBSOLETE /* Set or delete a breakpoint at the location within a CALL_DUMMY code */ -/* OBSOLETE fragment where we want the target program to stop after the function */ -/* OBSOLETE call is complete. CALL_DUMMY_ADDR is the address of the first */ -/* OBSOLETE instruction in the CALL_DUMMY. DUMMY_FRAME_ADDR is the value of the */ -/* OBSOLETE frame pointer in the dummy frame. */ -/* OBSOLETE */ -/* OBSOLETE NOTE: in the both of the following definitions, we take advantage of */ -/* OBSOLETE knowledge of the implementation of the target breakpoint operation, */ -/* OBSOLETE in that we pass a null pointer as the second argument. It seems */ -/* OBSOLETE reasonable to assume that any target requiring the use of */ -/* OBSOLETE CALL_DUMMY_BREAK_{SET,DELETE} will not store the breakpoint */ -/* OBSOLETE shadow contents in GDB; in any case, this assumption is vaild */ -/* OBSOLETE for all VxWorks-related targets. */ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_BREAK_SET(call_dummy_addr) \ */ -/* OBSOLETE target_insert_breakpoint ((call_dummy_addr) + CALL_DUMMY_STOP_OFFSET, \ */ -/* OBSOLETE (char *) 0) */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_BREAK_DELETE(dummy_frame_addr) \ */ -/* OBSOLETE target_remove_breakpoint ((dummy_frame_addr) - (CALL_DUMMY_OFFSET_IN_FRAME \ */ -/* OBSOLETE - CALL_DUMMY_STOP_OFFSET), \ */ -/* OBSOLETE (char *) 0) */ -/* OBSOLETE */ -/* OBSOLETE /* Return nonzero if the pc is executing within a CALL_DUMMY frame. */ */ -/* OBSOLETE */ -/* OBSOLETE #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \ */ -/* OBSOLETE ((pc) >= (sp) \ */ -/* OBSOLETE && (pc) <= (sp) + CALL_DUMMY_OFFSET_IN_FRAME + CALL_DUMMY_LENGTH) */ -/* OBSOLETE */ -/* OBSOLETE /* Defining this prevents us from trying to pass a structure-valued argument */ -/* OBSOLETE to a function called via the CALL_DUMMY mechanism. This is not handled */ -/* OBSOLETE properly in call_function_by_hand (), and the fix might require re-writing */ -/* OBSOLETE the CALL_DUMMY handling for all targets (at least, a clean solution */ -/* OBSOLETE would probably require this). Arguably, this should go in "tm-29k.h" */ -/* OBSOLETE rather than here. */ */ -/* OBSOLETE */ -/* OBSOLETE #define STRUCT_VAL_ARGS_UNSUPPORTED */ -/* OBSOLETE */ -/* OBSOLETE #define BKPT_OFFSET (7 * 4) */ -/* OBSOLETE #define BKPT_INSTR 0x72500101 */ -/* OBSOLETE */ -/* OBSOLETE #undef FIX_CALL_DUMMY */ -/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */ -/* OBSOLETE {\ */ -/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN, fun);\ */ -/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\ */ -/* OBSOLETE *(int *)((char *)dummyname + BKPT_OFFSET) = BKPT_INSTR;\ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Offsets into jmp_buf. They are derived from VxWorks' REG_SET struct */ -/* OBSOLETE (see VxWorks' setjmp.h). Note that Sun2, Sun3 and SunOS4 and VxWorks have */ -/* OBSOLETE different REG_SET structs, hence different layouts for the jmp_buf struct. */ -/* OBSOLETE Only JB_PC is needed for getting the saved PC value. */ */ -/* OBSOLETE */ -/* OBSOLETE #define JB_ELEMENT_SIZE 4 /* size of each element in jmp_buf */ */ -/* OBSOLETE #define JB_PC 3 /* offset of pc (pc1) in jmp_buf */ */ -/* OBSOLETE */ -/* OBSOLETE /* Figure out where the longjmp will land. We expect that we have just entered */ -/* OBSOLETE longjmp and haven't yet setup the stack frame, so the args are still in the */ -/* OBSOLETE output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we */ -/* OBSOLETE extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. */ -/* OBSOLETE This routine returns true on success */ */ -/* OBSOLETE */ -/* OBSOLETE #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) */ -/* OBSOLETE extern int get_longjmp_target (CORE_ADDR *); */ -/* OBSOLETE */ -/* OBSOLETE /* VxWorks adjusts the PC after a breakpoint has been hit. */ */ -/* OBSOLETE */ -/* OBSOLETE #undef DECR_PC_AFTER_BREAK */ -/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */ -/* OBSOLETE */ -/* OBSOLETE /* Do whatever promotions are appropriate on a value being returned */ -/* OBSOLETE from a function. VAL is the user-supplied value, and FUNC_TYPE */ -/* OBSOLETE is the return type of the function if known, else 0. */ -/* OBSOLETE */ -/* OBSOLETE For the Am29k, as far as I understand, if the function return type is known, */ -/* OBSOLETE cast the value to that type; otherwise, ensure that integer return values */ -/* OBSOLETE fill all of gr96. */ -/* OBSOLETE */ -/* OBSOLETE This definition really belongs in "tm-29k.h", since it applies */ -/* OBSOLETE to most Am29K-based systems; but once moved into that file, it might */ -/* OBSOLETE need to be redefined for all Am29K-based targets that also redefine */ -/* OBSOLETE STORE_RETURN_VALUE. For now, to be safe, we define it here. */ */ -/* OBSOLETE */ -/* OBSOLETE #define PROMOTE_RETURN_VALUE(val, func_type) \ */ -/* OBSOLETE do { \ */ -/* OBSOLETE if (func_type) \ */ -/* OBSOLETE val = value_cast (func_type, val); \ */ -/* OBSOLETE if ((TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT \ */ -/* OBSOLETE || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_ENUM) \ */ -/* OBSOLETE && TYPE_LENGTH (VALUE_TYPE (val)) < REGISTER_RAW_SIZE (0)) \ */ -/* OBSOLETE val = value_cast (builtin_type_int, val); \ */ -/* OBSOLETE } while (0) */ -/* OBSOLETE */ -/* OBSOLETE extern int vx29k_frame_chain_valid (CORE_ADDR, struct frame_info *); */ -/* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) vx29k_frame_chain_valid (chain, thisframe) */ -/* OBSOLETE */ -/* OBSOLETE extern CORE_ADDR frame_saved_call_site (); */ -/* OBSOLETE */ -/* OBSOLETE #undef PREPARE_TO_INIT_FRAME_INFO */ -/* OBSOLETE #define PREPARE_TO_INIT_FRAME_INFO(fci) do { \ */ -/* OBSOLETE long current_msp = read_register (MSP_REGNUM); \ */ -/* OBSOLETE if (PC_IN_CALL_DUMMY (fci->pc, current_msp, 0)) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE fci->rsize = DUMMY_FRAME_RSIZE; \ */ -/* OBSOLETE fci->msize = 0; \ */ -/* OBSOLETE fci->saved_msp = \ */ -/* OBSOLETE read_register_stack_integer (fci->frame + DUMMY_FRAME_RSIZE - 4, 4); \ */ -/* OBSOLETE fci->flags |= (TRANSPARENT|MFP_USED); \ */ -/* OBSOLETE return; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } while (0) */ diff --git a/gdb/config/a29k/vx29k.mt b/gdb/config/a29k/vx29k.mt deleted file mode 100644 index 95a169e..0000000 --- a/gdb/config/a29k/vx29k.mt +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Target: AMD 29k running VxWorks -# OBSOLETE TDEPFILES= a29k-tdep.o remote-vx.o remote-vx29k.o xdr_ld.o xdr_ptrace.o xdr_rdb.o -# OBSOLETE TM_FILE= tm-vx29k.h -# OBSOLETE MT_CFLAGS = -DNO_HIF_SUPPORT diff --git a/gdb/config/i386/i386lynx.mh b/gdb/config/i386/i386lynx.mh index 0552b4d..edfb1b0 100644 --- a/gdb/config/i386/i386lynx.mh +++ b/gdb/config/i386/i386lynx.mh @@ -4,6 +4,3 @@ XM_CLIBS= -lbsd NAT_FILE= nm-i386lynx.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o - -## OBSOLETE ## GDBSERVER_LIBS= -lbsd -## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o diff --git a/gdb/config/i386/nbsd.mt b/gdb/config/i386/nbsd.mt index 8ab606e..b8fc668 100644 --- a/gdb/config/i386/nbsd.mt +++ b/gdb/config/i386/nbsd.mt @@ -1,5 +1,3 @@ # Target: Intel 386 running NetBSD TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o TM_FILE= tm-nbsd.h - -## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o diff --git a/gdb/config/i386/nbsdelf.mt b/gdb/config/i386/nbsdelf.mt index ab173d3..1bccd32 100644 --- a/gdb/config/i386/nbsdelf.mt +++ b/gdb/config/i386/nbsdelf.mt @@ -1,5 +1,3 @@ # Target: Intel 386 running NetBSD TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o TM_FILE= tm-nbsdelf.h - -## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o diff --git a/gdb/config/i386/x86-64linux.mt b/gdb/config/i386/x86-64linux.mt index 1f3a796..85f1972 100644 --- a/gdb/config/i386/x86-64linux.mt +++ b/gdb/config/i386/x86-64linux.mt @@ -1,5 +1,3 @@ # Target: AMD x86-64 running GNU/Linux TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o i387-tdep.o dwarf2cfi.o \ solib.o solib-svr4.o solib-legacy.o - -## OBSOLETE ## GDBSERVER_DEPFILES= low-linux.o diff --git a/gdb/config/m32r/m32r.mt b/gdb/config/m32r/m32r.mt index 2be2649..a200853 100644 --- a/gdb/config/m32r/m32r.mt +++ b/gdb/config/m32r/m32r.mt @@ -3,6 +3,3 @@ TDEPFILES= m32r-tdep.o monitor.o m32r-rom.o dsrec.o TM_FILE= tm-m32r.h SIM_OBS = remote-sim.o SIM = ../sim/m32r/libsim.a - -## OBSOLETE ## GDBSERVER_DEPFILES= low-sim.o -## OBSOLETE ## GDBSERVER_LIBS = ../../sim/m32r/libsim.a ../../bfd/libbfd.a ../../libiberty/libiberty.a ../../opcodes/libopcodes.a ../../intl/libintl.a diff --git a/gdb/config/m68k/m68klynx.mh b/gdb/config/m68k/m68klynx.mh index 803dac3..3838012 100644 --- a/gdb/config/m68k/m68klynx.mh +++ b/gdb/config/m68k/m68klynx.mh @@ -4,6 +4,3 @@ XM_CLIBS= -lbsd NAT_FILE= nm-m68klynx.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o - -## OBSOLETE ## GDBSERVER_LIBS= -lbsd -## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o diff --git a/gdb/config/m68k/nbsd.mt b/gdb/config/m68k/nbsd.mt index d83d91d..b6ac5a0 100644 --- a/gdb/config/m68k/nbsd.mt +++ b/gdb/config/m68k/nbsd.mt @@ -1,5 +1,3 @@ # Target: Motorola m68k running NetBSD TDEPFILES= m68k-tdep.o m68knbsd-tdep.o TM_FILE= tm-nbsd.h - -## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o diff --git a/gdb/config/m68k/sun3os4.mh b/gdb/config/m68k/sun3os4.mh index 4ed46a2..18b1f08 100644 --- a/gdb/config/m68k/sun3os4.mh +++ b/gdb/config/m68k/sun3os4.mh @@ -2,5 +2,3 @@ XM_FILE= xm-sun3os4.h NAT_FILE= nm-sun3.h NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o - -## OBSOLETE ## GDBSERVER_DEPFILES= low-sun3.o diff --git a/gdb/config/mips/vr5000.mt b/gdb/config/mips/vr5000.mt index f9811d0..7a4a915 100644 --- a/gdb/config/mips/vr5000.mt +++ b/gdb/config/mips/vr5000.mt @@ -3,6 +3,3 @@ TDEPFILES= mips-tdep.o remote-mips.o TM_FILE= tm-vr5000.h SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a - -## OBSOLETE ## GDBSERVER_DEPFILES= low-sim.o -## OBSOLETE ## GDBSERVER_LIBS = ../../sim/mips/libsim.a ../../bfd/libbfd.a ../../libiberty/libiberty.a -lm ../../intl/libintl.a diff --git a/gdb/config/ns32k/nbsd.mt b/gdb/config/ns32k/nbsd.mt index f677af1..14d37f9 100644 --- a/gdb/config/ns32k/nbsd.mt +++ b/gdb/config/ns32k/nbsd.mt @@ -1,5 +1,3 @@ # Target: PC532 running NetBSD TDEPFILES= ns32k-tdep.o TM_FILE= tm-nbsd.h - -## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o diff --git a/gdb/config/pa/hppabsd.mh b/gdb/config/pa/hppabsd.mh index 0f66bb6..d4a152d 100644 --- a/gdb/config/pa/hppabsd.mh +++ b/gdb/config/pa/hppabsd.mh @@ -2,5 +2,3 @@ XM_FILE= xm-hppab.h NAT_FILE= nm-hppab.h NATDEPFILES= hppab-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o - -## OBSOLETE ## GDBSERVER_DEPFILES= low-hppabsd.o diff --git a/gdb/config/pa/hppaosf.mh b/gdb/config/pa/hppaosf.mh index 95a689a..d6dd282 100644 --- a/gdb/config/pa/hppaosf.mh +++ b/gdb/config/pa/hppaosf.mh @@ -3,6 +3,3 @@ XM_FILE= xm-hppab.h NAT_FILE= nm-hppao.h NATDEPFILES= fork-child.o m3-nat.o hppam3-nat.o somread.o hpread.o somsolib.o NAT_CLIBS= -lmachid -lnetname -lmach - -## OBSOLETE ## GDBSERVER_DEPFILES= low-hppabsd.o - diff --git a/gdb/config/powerpc/nbsd.mt b/gdb/config/powerpc/nbsd.mt index 164abfe..40a2a99 100644 --- a/gdb/config/powerpc/nbsd.mt +++ b/gdb/config/powerpc/nbsd.mt @@ -2,7 +2,5 @@ TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o TM_FILE= tm-nbsd.h -## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o - SIM_OBS = remote-sim.o SIM = ../sim/ppc/libsim.a diff --git a/gdb/config/rs6000/rs6000lynx.mh b/gdb/config/rs6000/rs6000lynx.mh index 2ae49c2..096473f 100644 --- a/gdb/config/rs6000/rs6000lynx.mh +++ b/gdb/config/rs6000/rs6000lynx.mh @@ -4,6 +4,3 @@ XM_CLIBS= -lbsd NAT_FILE= nm-rs6000ly.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o xcoffread.o - -## OBSOLETE ## GDBSERVER_LIBS= -lbsd -## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o diff --git a/gdb/config/s390/s390.mt b/gdb/config/s390/s390.mt index 9095058..6b8d91f 100644 --- a/gdb/config/s390/s390.mt +++ b/gdb/config/s390/s390.mt @@ -4,5 +4,3 @@ TDEPFILES=s390-tdep.o solib.o # Post 5.0 tdep-files TDEPFILES+=solib-svr4.o solib-legacy.o GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL - -## OBSOLETE ## GDBSERVER_DEPFILES= low-linux.o s390-tdep.o s390-nat.o diff --git a/gdb/config/s390/s390x.mt b/gdb/config/s390/s390x.mt index 4df35a1..7b23cad 100644 --- a/gdb/config/s390/s390x.mt +++ b/gdb/config/s390/s390x.mt @@ -5,7 +5,5 @@ TDEPFILES=s390-tdep.o solib.o TDEPFILES+=solib-svr4.o solib-legacy.o GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL -## OBSOLETE ## GDBSERVER_DEPFILES= low-linux.o s390-tdep.o s390-nat.o - # needed for gdbserver. MT_CFLAGS= -DCONFIG_ARCH_S390X diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh index f2c26d5..4a2c41f 100644 --- a/gdb/config/sparc/linux.mh +++ b/gdb/config/sparc/linux.mh @@ -12,5 +12,3 @@ NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o \ LOADLIBES = -ldl -rdynamic HOST_IPC=-DBSD_IPC - -## OBSOLETE ## GDBSERVER_DEPFILES= low-sparc.o diff --git a/gdb/config/sparc/sparclynx.mh b/gdb/config/sparc/sparclynx.mh index b938b2f..c573604 100644 --- a/gdb/config/sparc/sparclynx.mh +++ b/gdb/config/sparc/sparclynx.mh @@ -4,6 +4,3 @@ XM_CLIBS= -lbsd NAT_FILE= nm-sparclynx.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o - -## OBSOLETE ## GDBSERVER_LIBS= -lbsd -## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o diff --git a/gdb/config/sparc/sun4os4.mh b/gdb/config/sparc/sun4os4.mh index 516be36..4e664d7 100644 --- a/gdb/config/sparc/sun4os4.mh +++ b/gdb/config/sparc/sun4os4.mh @@ -3,8 +3,6 @@ NAT_FILE= nm-sun4os4.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o HOST_IPC=-DBSD_IPC -## OBSOLETE ## GDBSERVER_DEPFILES= low-sparc.o - # Setting XM_CLIBS=-lresolv would let us use the DNS, but that would screw # anyone who wants to use NIS, which includes at least one Cygnus customer # (PR 3593). So leave it this way until/unless we find a resolver which can diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 07c8465..9b35547 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -37,15 +37,6 @@ esac case "${target}" in -# OBSOLETE a29k-*-aout*) gdb_target=a29k ;; -# OBSOLETE a29k-*-coff*) gdb_target=a29k ;; -# OBSOLETE a29k-*-elf*) gdb_target=a29k ;; -# OBSOLETE a29k-*-ebmon*) gdb_target=a29k ;; -# OBSOLETE a29k-*-kern*) gdb_target=a29k-kern ;; -# OBSOLETE a29k-*-none*) gdb_target=a29k ;; -# OBSOLETE a29k-*-udi*) gdb_target=a29k-udi ;; -# OBSOLETE a29k-*-vxworks*) gdb_target=vx29k ;; - alpha*-*-osf*) gdb_target=alpha-osf1 ;; alpha*-*-linux*) gdb_target=alpha-linux ;; alpha*-*-freebsd*) gdb_target=fbsd ;; diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index a0bad13..2c8cd33 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -262,14 +262,6 @@ linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h) linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h) linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h) -# OBSOLETE TARGETS -# OBSOLETE # low-lynx.o : ${srcdir}/low-lynx.c ${srcdir}/server.h -# OBSOLETE # low-nbsd.o : ${srcdir}/low-nbsd.c ${srcdir}/server.h -# OBSOLETE # low-sim.o : ${srcdir}/low-sim.c ${srcdir}/server.h -# OBSOLETE # low-sparc.o : $(srcdir)/low-sparc.c $(srcdir)/server.h -# OBSOLETE # low-sun3.o : $(srcdir)/low-sun3.c $(srcdir)/server.h -# OBSOLETE # low-hppabsd.o : $(srcdir)/low-hppabsd.c $(srcdir)/server.h - reg-arm.o : reg-arm.c $(regdef_h) reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh) sh $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c diff --git a/gdb/remote-adapt.c b/gdb/remote-adapt.c deleted file mode 100644 index 7e87360..0000000 --- a/gdb/remote-adapt.c +++ /dev/null @@ -1,1524 +0,0 @@ -/* OBSOLETE /* Remote debugging interface for AMD 290*0 Adapt Monitor Version 2.1d18. */ -/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */ -/* OBSOLETE 2001 Free Software Foundation, Inc. */ -/* OBSOLETE Contributed by David Wood at New York University (wood@lab.ultra.nyu.edu). */ -/* OBSOLETE Adapted from work done at Cygnus Support in remote-eb.c. */ -/* 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 /* This is like remote.c but is for an esoteric situation-- */ -/* OBSOLETE having a 29k board attached to an Adapt inline monitor. */ -/* OBSOLETE The monitor is connected via serial line to a unix machine */ -/* OBSOLETE running gdb. */ -/* OBSOLETE */ -/* OBSOLETE 3/91 - developed on Sun3 OS 4.1, by David Wood */ -/* OBSOLETE o - I can't get binary coff to load. */ -/* OBSOLETE o - I can't get 19200 baud rate to work. */ -/* OBSOLETE 7/91 o - Freeze mode tracing can be done on a 29050. */ */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE #include "defs.h" */ -/* OBSOLETE #include "gdb_string.h" */ -/* OBSOLETE #include "inferior.h" */ -/* OBSOLETE #include "value.h" */ -/* OBSOLETE #include <ctype.h> */ -/* OBSOLETE #include <fcntl.h> */ -/* OBSOLETE #include <signal.h> */ -/* OBSOLETE #include <errno.h> */ -/* OBSOLETE #include "terminal.h" */ -/* OBSOLETE #include "target.h" */ -/* OBSOLETE #include "gdbcore.h" */ -/* OBSOLETE #include "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE /* This processor is getting rusty but I am trying to keep it */ -/* OBSOLETE up to date at least with data structure changes. */ -/* OBSOLETE Activate this block to compile just this file. */ -/* OBSOLETE */ */ -/* OBSOLETE #define COMPILE_CHECK 0 */ -/* OBSOLETE #if COMPILE_CHECK */ -/* OBSOLETE #define Q_REGNUM 0 */ -/* OBSOLETE #define VAB_REGNUM 0 */ -/* OBSOLETE #define CPS_REGNUM 0 */ -/* OBSOLETE #define IPA_REGNUM 0 */ -/* OBSOLETE #define IPB_REGNUM 0 */ -/* OBSOLETE #define GR1_REGNUM 0 */ -/* OBSOLETE #define LR0_REGNUM 0 */ -/* OBSOLETE #define IPC_REGNUM 0 */ -/* OBSOLETE #define CR_REGNUM 0 */ -/* OBSOLETE #define BP_REGNUM 0 */ -/* OBSOLETE #define FC_REGNUM 0 */ -/* OBSOLETE #define INTE_REGNUM 0 */ -/* OBSOLETE #define EXO_REGNUM 0 */ -/* OBSOLETE #define GR96_REGNUM 0 */ -/* OBSOLETE #define NPC_REGNUM */ -/* OBSOLETE #define FPE_REGNUM 0 */ -/* OBSOLETE #define PC2_REGNUM 0 */ -/* OBSOLETE #define FPS_REGNUM 0 */ -/* OBSOLETE #define ALU_REGNUM 0 */ -/* OBSOLETE #define LRU_REGNUM 0 */ -/* OBSOLETE #define TERMINAL int */ -/* OBSOLETE #define RAW 1 */ -/* OBSOLETE #define ANYP 1 */ -/* OBSOLETE extern int a29k_freeze_mode; */ -/* OBSOLETE extern int processor_type; */ -/* OBSOLETE extern char *processor_name; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* External data declarations */ */ -/* OBSOLETE extern int stop_soon_quietly; /* for wait_for_inferior */ */ -/* OBSOLETE */ -/* OBSOLETE /* Forward data declarations */ */ -/* OBSOLETE extern struct target_ops adapt_ops; /* Forward declaration */ */ -/* OBSOLETE */ -/* OBSOLETE /* Forward function declarations */ */ -/* OBSOLETE static void adapt_fetch_registers (); */ -/* OBSOLETE static void adapt_store_registers (); */ -/* OBSOLETE static void adapt_close (); */ -/* OBSOLETE static int adapt_clear_breakpoints (); */ -/* OBSOLETE */ -/* OBSOLETE #define FREEZE_MODE (read_register(CPS_REGNUM) && 0x400) */ -/* OBSOLETE #define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE) */ -/* OBSOLETE */ -/* OBSOLETE /* Can't seem to get binary coff working */ */ -/* OBSOLETE #define ASCII_COFF /* Adapt will be downloaded with ascii coff */ */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME: Replace with `set remotedebug'. */ */ -/* OBSOLETE #define LOG_FILE "adapt.log" */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE FILE *log_file = NULL; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE static int timeout = 5; */ -/* OBSOLETE static char *dev_name; */ -/* OBSOLETE */ -/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */ -/* OBSOLETE adapt_open knows that we don't have a file open when the program */ -/* OBSOLETE starts. */ */ -/* OBSOLETE int adapt_desc = -1; */ -/* OBSOLETE */ -/* OBSOLETE /* stream which is fdopen'd from adapt_desc. Only valid when */ -/* OBSOLETE adapt_desc != -1. */ */ -/* OBSOLETE FILE *adapt_stream; */ -/* OBSOLETE */ -/* OBSOLETE #define ON 1 */ -/* OBSOLETE #define OFF 0 */ -/* OBSOLETE static void */ -/* OBSOLETE rawmode (int desc, int turnon) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE TERMINAL sg; */ -/* OBSOLETE */ -/* OBSOLETE if (desc < 0) */ -/* OBSOLETE return; */ -/* OBSOLETE */ -/* OBSOLETE ioctl (desc, TIOCGETP, &sg); */ -/* OBSOLETE */ -/* OBSOLETE if (turnon) */ -/* OBSOLETE { */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE sg.c_lflag &= ~(ICANON); */ -/* OBSOLETE #else */ -/* OBSOLETE sg.sg_flags |= RAW; */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE sg.c_lflag |= ICANON; */ -/* OBSOLETE #else */ -/* OBSOLETE sg.sg_flags &= ~(RAW); */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE ioctl (desc, TIOCSETP, &sg); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Suck up all the input from the adapt */ */ -/* OBSOLETE slurp_input (void) */ -/* OBSOLETE { */ -/* OBSOLETE char buf[8]; */ -/* OBSOLETE */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE /* termio does the timeout for us. */ */ -/* OBSOLETE while (read (adapt_desc, buf, 8) > 0); */ -/* OBSOLETE #else */ -/* OBSOLETE alarm (timeout); */ -/* OBSOLETE while (read (adapt_desc, buf, 8) > 0); */ -/* OBSOLETE alarm (0); */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Read a character from the remote system, doing all the fancy */ -/* OBSOLETE timeout stuff. */ */ -/* OBSOLETE static int */ -/* OBSOLETE readchar (void) */ -/* OBSOLETE { */ -/* OBSOLETE char buf; */ -/* OBSOLETE */ -/* OBSOLETE buf = '\0'; */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE /* termio does the timeout for us. */ */ -/* OBSOLETE read (adapt_desc, &buf, 1); */ -/* OBSOLETE #else */ -/* OBSOLETE alarm (timeout); */ -/* OBSOLETE if (read (adapt_desc, &buf, 1) < 0) */ -/* OBSOLETE { */ -/* OBSOLETE if (errno == EINTR) */ -/* OBSOLETE error ("Timeout reading from remote system."); */ -/* OBSOLETE else */ -/* OBSOLETE perror_with_name ("remote"); */ -/* OBSOLETE } */ -/* OBSOLETE alarm (0); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE if (buf == '\0') */ -/* OBSOLETE error ("Timeout reading from remote system."); */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE putc (buf & 0x7f, log_file); */ -/* OBSOLETE #endif */ -/* OBSOLETE return buf & 0x7f; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Keep discarding input from the remote system, until STRING is found. */ -/* OBSOLETE Let the user break out immediately. */ */ -/* OBSOLETE static void */ -/* OBSOLETE expect (char *string) */ -/* OBSOLETE { */ -/* OBSOLETE char *p = string; */ -/* OBSOLETE */ -/* OBSOLETE fflush (adapt_stream); */ -/* OBSOLETE immediate_quit++; */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE if (readchar () == *p) */ -/* OBSOLETE { */ -/* OBSOLETE p++; */ -/* OBSOLETE if (*p == '\0') */ -/* OBSOLETE { */ -/* OBSOLETE immediate_quit--; */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE p = string; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Keep discarding input until we see the adapt prompt. */ -/* OBSOLETE */ -/* OBSOLETE The convention for dealing with the prompt is that you */ -/* OBSOLETE o give your command */ -/* OBSOLETE o *then* wait for the prompt. */ -/* OBSOLETE */ -/* OBSOLETE Thus the last thing that a procedure does with the serial line */ -/* OBSOLETE will be an expect_prompt(). Exception: adapt_resume does not */ -/* OBSOLETE wait for the prompt, because the terminal is being handed over */ -/* OBSOLETE to the inferior. However, the next thing which happens after that */ -/* OBSOLETE is a adapt_wait which does wait for the prompt. */ -/* OBSOLETE Note that this includes abnormal exit, e.g. error(). This is */ -/* OBSOLETE necessary to prevent getting into states from which we can't */ -/* OBSOLETE recover. */ */ -/* OBSOLETE static void */ -/* OBSOLETE expect_prompt (void) */ -/* OBSOLETE { */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE /* This is a convenient place to do this. The idea is to do it often */ -/* OBSOLETE enough that we never lose much data if we terminate abnormally. */ */ -/* OBSOLETE fflush (log_file); */ -/* OBSOLETE #endif */ -/* OBSOLETE fflush (adapt_stream); */ -/* OBSOLETE expect ("\n# "); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Get a hex digit from the remote system & return its value. */ -/* OBSOLETE If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */ */ -/* OBSOLETE static int */ -/* OBSOLETE get_hex_digit (int ignore_space) */ -/* OBSOLETE { */ -/* OBSOLETE int ch; */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE ch = readchar (); */ -/* OBSOLETE if (ch >= '0' && ch <= '9') */ -/* OBSOLETE return ch - '0'; */ -/* OBSOLETE else if (ch >= 'A' && ch <= 'F') */ -/* OBSOLETE return ch - 'A' + 10; */ -/* OBSOLETE else if (ch >= 'a' && ch <= 'f') */ -/* OBSOLETE return ch - 'a' + 10; */ -/* OBSOLETE else if (ch == ' ' && ignore_space) */ -/* OBSOLETE ; */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE error ("Invalid hex digit from remote system."); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Get a byte from adapt_desc and put it in *BYT. Accept any number */ -/* OBSOLETE leading spaces. */ */ -/* OBSOLETE static void */ -/* OBSOLETE get_hex_byte (char *byt) */ -/* OBSOLETE { */ -/* OBSOLETE int val; */ -/* OBSOLETE */ -/* OBSOLETE val = get_hex_digit (1) << 4; */ -/* OBSOLETE val |= get_hex_digit (0); */ -/* OBSOLETE *byt = val; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Read a 32-bit hex word from the adapt, preceded by a space */ */ -/* OBSOLETE static long */ -/* OBSOLETE get_hex_word (void) */ -/* OBSOLETE { */ -/* OBSOLETE long val; */ -/* OBSOLETE int j; */ -/* OBSOLETE */ -/* OBSOLETE val = 0; */ -/* OBSOLETE for (j = 0; j < 8; j++) */ -/* OBSOLETE val = (val << 4) + get_hex_digit (j == 0); */ -/* OBSOLETE return val; */ -/* OBSOLETE } */ -/* OBSOLETE /* Get N 32-bit hex words from remote, each preceded by a space */ -/* OBSOLETE and put them in registers starting at REGNO. */ */ -/* OBSOLETE static void */ -/* OBSOLETE get_hex_regs (int n, int regno) */ -/* OBSOLETE { */ -/* OBSOLETE long val; */ -/* OBSOLETE while (n--) */ -/* OBSOLETE { */ -/* OBSOLETE val = get_hex_word (); */ -/* OBSOLETE supply_register (regno++, (char *) &val); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE /* Called when SIGALRM signal sent due to alarm() timeout. */ */ -/* OBSOLETE #ifndef HAVE_TERMIO */ -/* OBSOLETE */ -/* OBSOLETE volatile int n_alarms; */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE adapt_timer (void) */ -/* OBSOLETE { */ -/* OBSOLETE #if 0 */ -/* OBSOLETE if (kiodebug) */ -/* OBSOLETE printf ("adapt_timer called\n"); */ -/* OBSOLETE #endif */ -/* OBSOLETE n_alarms++; */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* malloc'd name of the program on the remote system. */ */ -/* OBSOLETE static char *prog_name = NULL; */ -/* OBSOLETE */ -/* OBSOLETE /* Number of SIGTRAPs we need to simulate. That is, the next */ -/* OBSOLETE NEED_ARTIFICIAL_TRAP calls to adapt_wait should just return */ -/* OBSOLETE SIGTRAP without actually waiting for anything. */ */ -/* OBSOLETE */ -/* OBSOLETE static int need_artificial_trap = 0; */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE adapt_kill (char *arg, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (adapt_stream, "K"); */ -/* OBSOLETE fprintf (adapt_stream, "\r"); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE /* */ -/* OBSOLETE * Download a file specified in 'args', to the adapt. */ -/* OBSOLETE * FIXME: Assumes the file to download is a binary coff file. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_load (char *args, int fromtty) */ -/* OBSOLETE { */ -/* OBSOLETE FILE *fp; */ -/* OBSOLETE int n; */ -/* OBSOLETE char buffer[1024]; */ -/* OBSOLETE */ -/* OBSOLETE if (!adapt_stream) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("Adapt not open. Use 'target' command to open adapt\n"); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* OK, now read in the file. Y=read, C=COFF, T=dTe port */ -/* OBSOLETE 0=start address. */ */ -/* OBSOLETE */ -/* OBSOLETE #ifdef ASCII_COFF /* Ascii coff */ */ -/* OBSOLETE fprintf (adapt_stream, "YA T,0\r"); */ -/* OBSOLETE fflush (adapt_stream); /* Just in case */ */ -/* OBSOLETE /* FIXME: should check args for only 1 argument */ */ -/* OBSOLETE sprintf (buffer, "cat %s | btoa > /tmp/#adapt-btoa", args); */ -/* OBSOLETE system (buffer); */ -/* OBSOLETE fp = fopen ("/tmp/#adapt-btoa", "r"); */ -/* OBSOLETE rawmode (adapt_desc, OFF); */ -/* OBSOLETE while (n = fread (buffer, 1, 1024, fp)) */ -/* OBSOLETE { */ -/* OBSOLETE do */ -/* OBSOLETE { */ -/* OBSOLETE n -= write (adapt_desc, buffer, n); */ -/* OBSOLETE } */ -/* OBSOLETE while (n > 0); */ -/* OBSOLETE if (n < 0) */ -/* OBSOLETE { */ -/* OBSOLETE perror ("writing ascii coff"); */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE fclose (fp); */ -/* OBSOLETE rawmode (adapt_desc, ON); */ -/* OBSOLETE system ("rm /tmp/#adapt-btoa"); */ -/* OBSOLETE #else /* Binary coff - can't get it to work . */ */ -/* OBSOLETE fprintf (adapt_stream, "YC T,0\r"); */ -/* OBSOLETE fflush (adapt_stream); /* Just in case */ */ -/* OBSOLETE if (!(fp = fopen (args, "r"))) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("Can't open %s\n", args); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE while (n = fread (buffer, 1, 512, fp)) */ -/* OBSOLETE { */ -/* OBSOLETE do */ -/* OBSOLETE { */ -/* OBSOLETE n -= write (adapt_desc, buffer, n); */ -/* OBSOLETE } */ -/* OBSOLETE while (n > 0); */ -/* OBSOLETE if (n < 0) */ -/* OBSOLETE { */ -/* OBSOLETE perror ("writing ascii coff"); */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE fclose (fp); */ -/* OBSOLETE #endif */ -/* OBSOLETE expect_prompt (); /* Skip garbage that comes out */ */ -/* OBSOLETE fprintf (adapt_stream, "\r"); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* This is called not only when we first attach, but also when the */ -/* OBSOLETE user types "run" after having attached. */ */ -/* OBSOLETE void */ -/* OBSOLETE adapt_create_inferior (char *execfile, char *args, char **env) */ -/* OBSOLETE { */ -/* OBSOLETE int entry_pt; */ -/* OBSOLETE */ -/* OBSOLETE if (args && *args) */ -/* OBSOLETE error ("Can't pass arguments to remote adapt 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 if (adapt_stream) */ -/* OBSOLETE { */ -/* OBSOLETE adapt_kill (NULL, NULL); */ -/* OBSOLETE adapt_clear_breakpoints (); */ -/* OBSOLETE init_wait_for_inferior (); */ -/* OBSOLETE /* Clear the input because what the adapt sends back is different */ -/* OBSOLETE * depending on whether it was running or not. */ -/* OBSOLETE */ */ -/* OBSOLETE slurp_input (); /* After this there should be a prompt */ */ -/* OBSOLETE fprintf (adapt_stream, "\r"); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE printf_filtered ("Do you want to download '%s' (y/n)? [y] : ", prog_name); */ -/* OBSOLETE { */ -/* OBSOLETE char buffer[10]; */ -/* OBSOLETE gets (buffer); */ -/* OBSOLETE if (*buffer != 'n') */ -/* OBSOLETE { */ -/* OBSOLETE adapt_load (prog_name, 0); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #ifdef NOTDEF */ -/* OBSOLETE /* Set the PC and wait for a go/cont */ */ -/* OBSOLETE fprintf (adapt_stream, "G %x,N\r", entry_pt); */ -/* OBSOLETE printf_filtered ("Now use the 'continue' command to start.\n"); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE #else */ -/* OBSOLETE insert_breakpoints (); /* Needed to get correct instruction in cache */ */ -/* OBSOLETE proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("Adapt not open yet.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Translate baud rates from integers to damn B_codes. Unix should */ -/* OBSOLETE have outgrown this crap years ago, but even POSIX wouldn't buck it. */ */ -/* OBSOLETE */ -/* OBSOLETE #ifndef B19200 */ -/* OBSOLETE #define B19200 EXTA */ -/* OBSOLETE #endif */ -/* OBSOLETE #ifndef B38400 */ -/* OBSOLETE #define B38400 EXTB */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE static struct */ -/* OBSOLETE { */ -/* OBSOLETE int rate, damn_b; */ -/* OBSOLETE } */ -/* OBSOLETE baudtab[] = */ -/* OBSOLETE { */ -/* OBSOLETE { */ -/* OBSOLETE 0, B0 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 50, B50 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 75, B75 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 110, B110 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 134, B134 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 150, B150 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 200, B200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 300, B300 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 600, B600 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 1200, B1200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 1800, B1800 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 2400, B2400 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 4800, B4800 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 9600, B9600 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 19200, B19200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 38400, B38400 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE -1, -1 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE }; */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE damn_b (int rate) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; baudtab[i].rate != -1; i++) */ -/* OBSOLETE if (rate == baudtab[i].rate) */ -/* OBSOLETE return baudtab[i].damn_b; */ -/* OBSOLETE return B38400; /* Random */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Open a connection to a remote debugger. */ -/* OBSOLETE NAME is the filename used for communication, then a space, */ -/* OBSOLETE then the baud rate. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE static int baudrate = 9600; */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_open (char *name, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE TERMINAL sg; */ -/* OBSOLETE unsigned int prl; */ -/* OBSOLETE char *p; */ -/* OBSOLETE */ -/* OBSOLETE /* Find the first whitespace character, it separates dev_name from */ -/* OBSOLETE prog_name. */ */ -/* OBSOLETE if (name == 0) */ -/* OBSOLETE goto erroid; */ -/* OBSOLETE */ -/* OBSOLETE for (p = name; */ -/* OBSOLETE *p != '\0' && !isspace (*p); p++) */ -/* OBSOLETE ; */ -/* OBSOLETE if (*p == '\0') */ -/* OBSOLETE erroid: */ -/* OBSOLETE error ("\ */ -/* OBSOLETE Please include the name of the device for the serial port,\n\ */ -/* OBSOLETE the baud rate, and the name of the program to run on the remote system."); */ -/* OBSOLETE dev_name = (char *) xmalloc (p - name + 1); */ -/* OBSOLETE strncpy (dev_name, name, p - name); */ -/* OBSOLETE dev_name[p - name] = '\0'; */ -/* OBSOLETE */ -/* OBSOLETE /* Skip over the whitespace after dev_name */ */ -/* OBSOLETE for (; isspace (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE */ -/* OBSOLETE if (1 != sscanf (p, "%d ", &baudrate)) */ -/* OBSOLETE goto erroid; */ -/* OBSOLETE */ -/* OBSOLETE /* Skip the number and then the spaces */ */ -/* OBSOLETE for (; isdigit (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE for (; isspace (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE */ -/* OBSOLETE if (prog_name != NULL) */ -/* OBSOLETE xfree (prog_name); */ -/* OBSOLETE prog_name = savestring (p, strlen (p)); */ -/* OBSOLETE */ -/* OBSOLETE adapt_close (0); */ -/* OBSOLETE */ -/* OBSOLETE adapt_desc = open (dev_name, O_RDWR); */ -/* OBSOLETE if (adapt_desc < 0) */ -/* OBSOLETE perror_with_name (dev_name); */ -/* OBSOLETE ioctl (adapt_desc, TIOCGETP, &sg); */ -/* OBSOLETE #if ! defined(COMPILE_CHECK) */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE sg.c_cc[VMIN] = 0; /* read with timeout. */ */ -/* OBSOLETE sg.c_cc[VTIME] = timeout * 10; */ -/* OBSOLETE sg.c_lflag &= ~(ICANON | ECHO); */ -/* OBSOLETE sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate); */ -/* OBSOLETE #else */ -/* OBSOLETE sg.sg_ispeed = damn_b (baudrate); */ -/* OBSOLETE sg.sg_ospeed = damn_b (baudrate); */ -/* OBSOLETE sg.sg_flags |= RAW | ANYP; */ -/* OBSOLETE sg.sg_flags &= ~ECHO; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE ioctl (adapt_desc, TIOCSETP, &sg); */ -/* OBSOLETE adapt_stream = fdopen (adapt_desc, "r+"); */ -/* OBSOLETE #endif /* compile_check */ */ -/* OBSOLETE push_target (&adapt_ops); */ -/* OBSOLETE */ -/* OBSOLETE #ifndef HAVE_TERMIO */ -/* OBSOLETE #ifndef NO_SIGINTERRUPT */ -/* OBSOLETE /* Cause SIGALRM's to make reads fail with EINTR instead of resuming */ -/* OBSOLETE the read. */ */ -/* OBSOLETE if (siginterrupt (SIGALRM, 1) != 0) */ -/* OBSOLETE perror ("adapt_open: error in siginterrupt"); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Set up read timeout timer. */ */ -/* OBSOLETE if ((void (*)) signal (SIGALRM, adapt_timer) == (void (*)) -1) */ -/* OBSOLETE perror ("adapt_open: error in signal"); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE log_file = fopen (LOG_FILE, "w"); */ -/* OBSOLETE if (log_file == NULL) */ -/* OBSOLETE perror_with_name (LOG_FILE); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Put this port into NORMAL mode, send the 'normal' character */ */ -/* OBSOLETE write (adapt_desc, "", 1); /* Control A */ */ -/* OBSOLETE write (adapt_desc, "\r", 1); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE /* Hello? Are you there? */ */ -/* OBSOLETE write (adapt_desc, "\r", 1); */ -/* OBSOLETE */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE /* Clear any break points */ */ -/* OBSOLETE adapt_clear_breakpoints (); */ -/* OBSOLETE */ -/* OBSOLETE /* Print out some stuff, letting the user now what's going on */ */ -/* OBSOLETE printf_filtered ("Connected to an Adapt via %s.\n", dev_name); */ -/* OBSOLETE /* FIXME: can this restriction be removed? */ */ -/* OBSOLETE printf_filtered ("Remote debugging using virtual addresses works only\n"); */ -/* OBSOLETE printf_filtered ("\twhen virtual addresses map 1:1 to physical addresses.\n"); */ -/* OBSOLETE if (processor_type != a29k_freeze_mode) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf_filtered (gdb_stderr, */ -/* OBSOLETE "Freeze-mode debugging not available, and can only be done on an A29050.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Close out all files and local state before this target loses control. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_close (int quitting) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE /* Clear any break points */ */ -/* OBSOLETE adapt_clear_breakpoints (); */ -/* OBSOLETE */ -/* OBSOLETE /* Put this port back into REMOTE mode */ */ -/* OBSOLETE if (adapt_stream) */ -/* OBSOLETE { */ -/* OBSOLETE fflush (adapt_stream); */ -/* OBSOLETE sleep (1); /* Let any output make it all the way back */ */ -/* OBSOLETE write (adapt_desc, "R\r", 2); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Due to a bug in Unix, fclose closes not only the stdio stream, */ -/* OBSOLETE but also the file descriptor. So we don't actually close */ -/* OBSOLETE adapt_desc. */ */ -/* OBSOLETE if (adapt_stream) */ -/* OBSOLETE fclose (adapt_stream); /* This also closes adapt_desc */ */ -/* OBSOLETE if (adapt_desc >= 0) */ -/* OBSOLETE /* close (adapt_desc); */ */ -/* OBSOLETE */ -/* OBSOLETE /* Do not try to close adapt_desc again, later in the program. */ */ -/* OBSOLETE adapt_stream = NULL; */ -/* OBSOLETE adapt_desc = -1; */ -/* OBSOLETE */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE if (log_file) */ -/* OBSOLETE { */ -/* OBSOLETE if (ferror (log_file)) */ -/* OBSOLETE printf_filtered ("Error writing log file.\n"); */ -/* OBSOLETE if (fclose (log_file) != 0) */ -/* OBSOLETE printf_filtered ("Error closing log file.\n"); */ -/* OBSOLETE log_file = NULL; */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Attach to the target that is already loaded and possibly running */ */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_attach (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf_filtered ("Attaching to remote program %s.\n", prog_name); */ -/* OBSOLETE */ -/* OBSOLETE /* Send the adapt a kill. It is ok if it is not already running */ */ -/* OBSOLETE fprintf (adapt_stream, "K\r"); */ -/* OBSOLETE fflush (adapt_stream); */ -/* OBSOLETE expect_prompt (); /* Slurp the echo */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Terminate the open connection to the remote debugger. */ -/* OBSOLETE Use this when you want to detach and do something else */ -/* OBSOLETE with your gdb. */ */ -/* OBSOLETE void */ -/* OBSOLETE adapt_detach (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE if (adapt_stream) */ -/* OBSOLETE { /* Send it on its way (tell it to continue) */ */ -/* OBSOLETE adapt_clear_breakpoints (); */ -/* OBSOLETE fprintf (adapt_stream, "G\r"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE pop_target (); /* calls adapt_close to do the real work */ */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf_filtered ("Ending remote %s debugging\n", target_shortname); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Tell the remote machine to resume. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE adapt_resume (ptid_t ptid, int step, enum target_signal sig) */ -/* OBSOLETE { */ -/* OBSOLETE if (step) */ -/* OBSOLETE { */ -/* OBSOLETE write (adapt_desc, "t 1,s\r", 6); */ -/* OBSOLETE /* Wait for the echo. */ */ -/* OBSOLETE expect ("t 1,s\r\n"); */ -/* OBSOLETE /* Then comes a line containing the instruction we stepped to. */ */ -/* OBSOLETE expect ("@"); */ -/* OBSOLETE /* Then we get the prompt. */ */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE /* Force the next adapt_wait to return a trap. Not doing anything */ -/* OBSOLETE about I/O from the target means that the user has to type */ -/* OBSOLETE "continue" to see any. FIXME, this should be fixed. */ */ -/* OBSOLETE need_artificial_trap = 1; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE write (adapt_desc, "G\r", 2); */ -/* OBSOLETE /* Swallow the echo. */ */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Wait until the remote machine stops, then return, */ -/* OBSOLETE storing status in STATUS just as `wait' would. */ */ -/* OBSOLETE */ -/* OBSOLETE ptid_t */ -/* OBSOLETE adapt_wait (ptid_t ptid, struct target_waitstatus *status) */ -/* OBSOLETE { */ -/* OBSOLETE /* Strings to look for. '?' means match any single character. */ -/* OBSOLETE Note that with the algorithm we use, the initial character */ -/* OBSOLETE of the string cannot recur in the string, or we will not */ -/* OBSOLETE find some cases of the string in the input. */ */ -/* OBSOLETE */ -/* OBSOLETE static char bpt[] = "@"; */ -/* OBSOLETE /* It would be tempting to look for "\n[__exit + 0x8]\n" */ -/* OBSOLETE but that requires loading symbols with "yc i" and even if */ -/* OBSOLETE we did do that we don't know that the file has symbols. */ */ -/* OBSOLETE static char exitmsg[] = "@????????I JMPTI GR121,LR0"; */ -/* OBSOLETE char *bp = bpt; */ -/* OBSOLETE char *ep = exitmsg; */ -/* OBSOLETE */ -/* OBSOLETE /* Large enough for either sizeof (bpt) or sizeof (exitmsg) chars. */ */ -/* OBSOLETE char swallowed[50]; */ -/* OBSOLETE /* Current position in swallowed. */ */ -/* OBSOLETE char *swallowed_p = swallowed; */ -/* OBSOLETE */ -/* OBSOLETE int ch; */ -/* OBSOLETE int ch_handled; */ -/* OBSOLETE int old_timeout = timeout; */ -/* OBSOLETE int old_immediate_quit = immediate_quit; */ -/* OBSOLETE */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE */ -/* OBSOLETE if (need_artificial_trap != 0) */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE need_artificial_trap--; */ -/* OBSOLETE return inferior_ptid; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE timeout = 0; /* Don't time out -- user program is running. */ */ -/* OBSOLETE immediate_quit = 1; /* Helps ability to QUIT */ */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE QUIT; /* Let user quit and leave process running */ */ -/* OBSOLETE ch_handled = 0; */ -/* OBSOLETE ch = readchar (); */ -/* OBSOLETE if (ch == *bp) */ -/* OBSOLETE { */ -/* OBSOLETE bp++; */ -/* OBSOLETE if (*bp == '\0') */ -/* OBSOLETE break; */ -/* OBSOLETE ch_handled = 1; */ -/* OBSOLETE */ -/* OBSOLETE *swallowed_p++ = ch; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE bp = bpt; */ -/* OBSOLETE if (ch == *ep || *ep == '?') */ -/* OBSOLETE { */ -/* OBSOLETE ep++; */ -/* OBSOLETE if (*ep == '\0') */ -/* OBSOLETE break; */ -/* OBSOLETE */ -/* OBSOLETE if (!ch_handled) */ -/* OBSOLETE *swallowed_p++ = ch; */ -/* OBSOLETE ch_handled = 1; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE ep = exitmsg; */ -/* OBSOLETE if (!ch_handled) */ -/* OBSOLETE { */ -/* OBSOLETE char *p; */ -/* OBSOLETE /* Print out any characters which have been swallowed. */ */ -/* OBSOLETE for (p = swallowed; p < swallowed_p; ++p) */ -/* OBSOLETE putc (*p, stdout); */ -/* OBSOLETE swallowed_p = swallowed; */ -/* OBSOLETE putc (ch, stdout); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE if (*bp == '\0') */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE } */ -/* OBSOLETE timeout = old_timeout; */ -/* OBSOLETE immediate_quit = old_immediate_quit; */ -/* OBSOLETE return inferior_ptid; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Return the name of register number REGNO */ -/* OBSOLETE in the form input and output by adapt. */ -/* OBSOLETE */ -/* OBSOLETE Returns a pointer to a static buffer containing the answer. */ */ -/* OBSOLETE static char * */ -/* OBSOLETE get_reg_name (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE static char buf[80]; */ -/* OBSOLETE if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */ -/* OBSOLETE sprintf (buf, "GR%03d", regno - GR96_REGNUM + 96); */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */ -/* OBSOLETE sprintf (buf, "GR%03d", regno - GR64_REGNUM + 64); */ -/* OBSOLETE #endif */ -/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */ -/* OBSOLETE sprintf (buf, "LR%03d", regno - LR0_REGNUM); */ -/* OBSOLETE else if (regno == Q_REGNUM) */ -/* OBSOLETE strcpy (buf, "SR131"); */ -/* OBSOLETE else if (regno >= BP_REGNUM && regno <= CR_REGNUM) */ -/* OBSOLETE sprintf (buf, "SR%03d", regno - BP_REGNUM + 133); */ -/* OBSOLETE else if (regno == ALU_REGNUM) */ -/* OBSOLETE strcpy (buf, "SR132"); */ -/* OBSOLETE else if (regno >= IPC_REGNUM && regno <= IPB_REGNUM) */ -/* OBSOLETE sprintf (buf, "SR%03d", regno - IPC_REGNUM + 128); */ -/* OBSOLETE else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE /* When a 29050 is in freeze-mode, read shadow pcs instead */ */ -/* OBSOLETE if ((regno >= NPC_REGNUM && regno <= PC2_REGNUM) && USE_SHADOW_PC) */ -/* OBSOLETE sprintf (buf, "SR%03d", regno - NPC_REGNUM + 20); */ -/* OBSOLETE else */ -/* OBSOLETE sprintf (buf, "SR%03d", regno - VAB_REGNUM); */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno == GR1_REGNUM) */ -/* OBSOLETE strcpy (buf, "GR001"); */ -/* OBSOLETE return buf; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Read the remote registers. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_fetch_registers (void) */ -/* OBSOLETE { */ -/* OBSOLETE int reg_index; */ -/* OBSOLETE int regnum_index; */ -/* OBSOLETE char tempbuf[10]; */ -/* OBSOLETE int sreg_buf[16]; */ -/* OBSOLETE int i, j; */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Global registers */ -/* OBSOLETE */ */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE write (adapt_desc, "dw gr64,gr95\r", 13); */ -/* OBSOLETE for (reg_index = 64, regnum_index = GR64_REGNUM; */ -/* OBSOLETE reg_index < 96; */ -/* OBSOLETE reg_index += 4, regnum_index += 4) */ -/* OBSOLETE { */ -/* OBSOLETE sprintf (tempbuf, "GR%03d ", reg_index); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE get_hex_regs (4, regnum_index); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE write (adapt_desc, "dw gr96,gr127\r", 14); */ -/* OBSOLETE for (reg_index = 96, regnum_index = GR96_REGNUM; */ -/* OBSOLETE reg_index < 128; */ -/* OBSOLETE reg_index += 4, regnum_index += 4) */ -/* OBSOLETE { */ -/* OBSOLETE sprintf (tempbuf, "GR%03d ", reg_index); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE get_hex_regs (4, regnum_index); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Local registers */ -/* OBSOLETE */ */ -/* OBSOLETE for (i = 0; i < 128; i += 32) */ -/* OBSOLETE { */ -/* OBSOLETE /* The PC has a tendency to hang if we get these */ -/* OBSOLETE all in one fell swoop ("dw lr0,lr127"). */ */ -/* OBSOLETE sprintf (tempbuf, "dw lr%d\r", i); */ -/* OBSOLETE write (adapt_desc, tempbuf, strlen (tempbuf)); */ -/* OBSOLETE for (reg_index = i, regnum_index = LR0_REGNUM + i; */ -/* OBSOLETE reg_index < i + 32; */ -/* OBSOLETE reg_index += 4, regnum_index += 4) */ -/* OBSOLETE { */ -/* OBSOLETE sprintf (tempbuf, "LR%03d ", reg_index); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE get_hex_regs (4, regnum_index); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Special registers */ -/* OBSOLETE */ */ -/* OBSOLETE sprintf (tempbuf, "dw sr0\r"); */ -/* OBSOLETE write (adapt_desc, tempbuf, strlen (tempbuf)); */ -/* OBSOLETE for (i = 0; i < 4; i++) */ -/* OBSOLETE { /* SR0 - SR14 */ */ -/* OBSOLETE sprintf (tempbuf, "SR%3d", i * 4); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE for (j = 0; j < (i == 3 ? 3 : 4); j++) */ -/* OBSOLETE sreg_buf[i * 4 + j] = get_hex_word (); */ -/* OBSOLETE } */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE /* */ -/* OBSOLETE * Read the pcs individually if we are in freeze mode. */ -/* OBSOLETE * See get_reg_name(), it translates the register names for the pcs to */ -/* OBSOLETE * the names of the shadow pcs. */ -/* OBSOLETE */ */ -/* OBSOLETE if (USE_SHADOW_PC) */ -/* OBSOLETE { */ -/* OBSOLETE sreg_buf[10] = read_register (NPC_REGNUM); /* pc0 */ */ -/* OBSOLETE sreg_buf[11] = read_register (PC_REGNUM); /* pc1 */ */ -/* OBSOLETE sreg_buf[12] = read_register (PC2_REGNUM); /* pc2 */ */ -/* OBSOLETE } */ -/* OBSOLETE for (i = 0; i < 14; i++) /* Supply vab -> lru */ */ -/* OBSOLETE supply_register (VAB_REGNUM + i, (char *) &sreg_buf[i]); */ -/* OBSOLETE sprintf (tempbuf, "dw sr128\r"); */ -/* OBSOLETE write (adapt_desc, tempbuf, strlen (tempbuf)); */ -/* OBSOLETE for (i = 0; i < 2; i++) */ -/* OBSOLETE { /* SR128 - SR135 */ */ -/* OBSOLETE sprintf (tempbuf, "SR%3d", 128 + i * 4); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE for (j = 0; j < 4; j++) */ -/* OBSOLETE sreg_buf[i * 4 + j] = get_hex_word (); */ -/* OBSOLETE } */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE supply_register (IPC_REGNUM, (char *) &sreg_buf[0]); */ -/* OBSOLETE supply_register (IPA_REGNUM, (char *) &sreg_buf[1]); */ -/* OBSOLETE supply_register (IPB_REGNUM, (char *) &sreg_buf[2]); */ -/* OBSOLETE supply_register (Q_REGNUM, (char *) &sreg_buf[3]); */ -/* OBSOLETE /* Skip ALU */ */ -/* OBSOLETE supply_register (BP_REGNUM, (char *) &sreg_buf[5]); */ -/* OBSOLETE supply_register (FC_REGNUM, (char *) &sreg_buf[6]); */ -/* OBSOLETE supply_register (CR_REGNUM, (char *) &sreg_buf[7]); */ -/* OBSOLETE */ -/* OBSOLETE /* There doesn't seem to be any way to get these. */ */ -/* OBSOLETE { */ -/* OBSOLETE int val = -1; */ -/* OBSOLETE supply_register (FPE_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (INTE_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (FPS_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (EXO_REGNUM, (char *) &val); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE write (adapt_desc, "dw gr1,gr1\r", 11); */ -/* OBSOLETE expect ("GR001 "); */ -/* OBSOLETE get_hex_regs (1, GR1_REGNUM); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Fetch register REGNO, or all registers if REGNO is -1. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_fetch_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE if (regno == -1) */ -/* OBSOLETE adapt_fetch_registers (); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE char *name = get_reg_name (regno); */ -/* OBSOLETE fprintf (adapt_stream, "dw %s,%s\r", name, name); */ -/* OBSOLETE expect (name); */ -/* OBSOLETE expect (" "); */ -/* OBSOLETE get_hex_regs (1, regno); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Store the remote registers from the contents of the block REGS. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_store_registers (void) */ -/* OBSOLETE { */ -/* OBSOLETE int i, j; */ -/* OBSOLETE */ -/* OBSOLETE fprintf (adapt_stream, "s gr1,%x\r", read_register (GR1_REGNUM)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE for (j = 0; j < 32; j += 16) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (adapt_stream, "s gr%d,", j + 64); */ -/* OBSOLETE for (i = 0; i < 15; ++i) */ -/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (GR64_REGNUM + j + i)); */ -/* OBSOLETE fprintf (adapt_stream, "%x\r", read_register (GR64_REGNUM + j + 15)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE for (j = 0; j < 32; j += 16) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (adapt_stream, "s gr%d,", j + 96); */ -/* OBSOLETE for (i = 0; i < 15; ++i) */ -/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (GR96_REGNUM + j + i)); */ -/* OBSOLETE fprintf (adapt_stream, "%x\r", read_register (GR96_REGNUM + j + 15)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE for (j = 0; j < 128; j += 16) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (adapt_stream, "s lr%d,", j); */ -/* OBSOLETE for (i = 0; i < 15; ++i) */ -/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (LR0_REGNUM + j + i)); */ -/* OBSOLETE fprintf (adapt_stream, "%x\r", read_register (LR0_REGNUM + j + 15)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE fprintf (adapt_stream, "s sr128,%x,%x,%x\r", read_register (IPC_REGNUM), */ -/* OBSOLETE read_register (IPA_REGNUM), read_register (IPB_REGNUM)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE fprintf (adapt_stream, "s sr133,%x,%x,%x\r", read_register (BP_REGNUM), */ -/* OBSOLETE read_register (FC_REGNUM), read_register (CR_REGNUM)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE fprintf (adapt_stream, "s sr131,%x\r", read_register (Q_REGNUM)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE fprintf (adapt_stream, "s sr0,"); */ -/* OBSOLETE for (i = 0; i < 7; ++i) */ -/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE fprintf (adapt_stream, "s sr7,"); */ -/* OBSOLETE for (i = 7; i < 14; ++i) */ -/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Store register REGNO, or all if REGNO == -1. */ -/* OBSOLETE Return errno value. */ */ -/* OBSOLETE void */ -/* OBSOLETE adapt_store_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE /* printf("adapt_store_register() called.\n"); fflush(stdout); /* */ */ -/* OBSOLETE if (regno == -1) */ -/* OBSOLETE adapt_store_registers (); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE char *name = get_reg_name (regno); */ -/* OBSOLETE fprintf (adapt_stream, "s %s,%x\r", name, read_register (regno)); */ -/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so */ -/* OBSOLETE invalidate the register cache. Do this *after* calling */ -/* OBSOLETE read_register, because we want read_register to return the */ -/* OBSOLETE value that write_register has just stuffed into the registers */ -/* OBSOLETE array, not the value of the register fetched from the */ -/* OBSOLETE inferior. */ */ -/* OBSOLETE if (regno == GR1_REGNUM) */ -/* OBSOLETE registers_changed (); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Get ready to modify the registers array. On machines which store */ -/* OBSOLETE individual registers, this doesn't need to do anything. On machines */ -/* OBSOLETE which store all the registers in one fell swoop, this makes sure */ -/* OBSOLETE that registers contains all the registers from the program being */ -/* OBSOLETE debugged. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE adapt_prepare_to_store (void) */ -/* OBSOLETE { */ -/* OBSOLETE /* Do nothing, since we can store individual regs */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static CORE_ADDR */ -/* OBSOLETE translate_addr (CORE_ADDR addr) */ -/* OBSOLETE { */ -/* OBSOLETE #if defined(KERNEL_DEBUGGING) */ -/* OBSOLETE /* Check for a virtual address in the kernel */ */ -/* OBSOLETE /* Assume physical address of ublock is in paddr_u register */ */ -/* OBSOLETE if (addr >= UVADDR) */ -/* OBSOLETE { */ -/* OBSOLETE /* PADDR_U register holds the physical address of the ublock */ */ -/* OBSOLETE CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM); */ -/* OBSOLETE return (i + addr - (CORE_ADDR) UVADDR); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE return (addr); */ -/* OBSOLETE } */ -/* OBSOLETE #else */ -/* OBSOLETE return (addr); */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME! Merge these two. */ */ -/* OBSOLETE int */ -/* OBSOLETE adapt_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */ -/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */ -/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE memaddr = translate_addr (memaddr); */ -/* OBSOLETE */ -/* OBSOLETE if (write) */ -/* OBSOLETE return adapt_write_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE else */ -/* OBSOLETE return adapt_read_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE adapt_files_info (void) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("\tAttached to %s at %d baud and running program %s\n", */ -/* OBSOLETE dev_name, baudrate, prog_name); */ -/* OBSOLETE printf_filtered ("\ton an %s processor.\n", processor_name[processor_type]); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Copy LEN bytes of data from debugger memory at MYADDR */ -/* OBSOLETE to inferior's memory at MEMADDR. Returns errno value. */ -/* OBSOLETE * sb/sh instructions don't work on unaligned addresses, when TU=1. */ -/* OBSOLETE */ */ -/* OBSOLETE int */ -/* OBSOLETE adapt_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE unsigned int cps; */ -/* OBSOLETE */ -/* OBSOLETE /* Turn TU bit off so we can do 'sb' commands */ */ -/* OBSOLETE cps = read_register (CPS_REGNUM); */ -/* OBSOLETE if (cps & 0x00000800) */ -/* OBSOLETE write_register (CPS_REGNUM, cps & ~(0x00000800)); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < len; i++) */ -/* OBSOLETE { */ -/* OBSOLETE if ((i % 16) == 0) */ -/* OBSOLETE fprintf (adapt_stream, "sb %x,", memaddr + i); */ -/* OBSOLETE if ((i % 16) == 15 || i == len - 1) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (adapt_stream, "%x\r", ((unsigned char *) myaddr)[i]); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE fprintf (adapt_stream, "%x,", ((unsigned char *) myaddr)[i]); */ -/* OBSOLETE } */ -/* OBSOLETE /* Restore the old value of cps if the TU bit was on */ */ -/* OBSOLETE if (cps & 0x00000800) */ -/* OBSOLETE write_register (CPS_REGNUM, cps); */ -/* OBSOLETE return len; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Read LEN bytes from inferior memory at MEMADDR. Put the result */ -/* OBSOLETE at debugger address MYADDR. Returns errno value. */ */ -/* OBSOLETE int */ -/* OBSOLETE adapt_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes read so far. */ */ -/* OBSOLETE int count; */ -/* OBSOLETE */ -/* OBSOLETE /* Starting address of this pass. */ */ -/* OBSOLETE unsigned long startaddr; */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes to read in this pass. */ */ -/* OBSOLETE int len_this_pass; */ -/* OBSOLETE */ -/* OBSOLETE /* Note that this code works correctly if startaddr is just less */ -/* OBSOLETE than UINT_MAX (well, really CORE_ADDR_MAX if there was such a */ -/* OBSOLETE thing). That is, something like */ -/* OBSOLETE adapt_read_bytes (CORE_ADDR_MAX - 4, foo, 4) */ -/* OBSOLETE works--it never adds len to memaddr and gets 0. */ */ -/* OBSOLETE /* However, something like */ -/* OBSOLETE adapt_read_bytes (CORE_ADDR_MAX - 3, foo, 4) */ -/* OBSOLETE doesn't need to work. Detect it and give up if there's an attempt */ -/* OBSOLETE to do that. */ */ -/* OBSOLETE */ -/* OBSOLETE if (((memaddr - 1) + len) < memaddr) */ -/* OBSOLETE return EIO; */ -/* OBSOLETE */ -/* OBSOLETE startaddr = memaddr; */ -/* OBSOLETE count = 0; */ -/* OBSOLETE while (count < len) */ -/* OBSOLETE { */ -/* OBSOLETE len_this_pass = 16; */ -/* OBSOLETE if ((startaddr % 16) != 0) */ -/* OBSOLETE len_this_pass -= startaddr % 16; */ -/* OBSOLETE if (len_this_pass > (len - count)) */ -/* OBSOLETE len_this_pass = (len - count); */ -/* OBSOLETE */ -/* OBSOLETE fprintf (adapt_stream, "db %x,%x\r", startaddr, */ -/* OBSOLETE (startaddr - 1) + len_this_pass); */ -/* OBSOLETE */ -/* OBSOLETE #ifdef NOTDEF /* Why do this */ */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE /* Look for 8 hex digits. */ */ -/* OBSOLETE i = 0; */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE if (isxdigit (readchar ())) */ -/* OBSOLETE ++i; */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE error ("Hex digit expected from remote system."); */ -/* OBSOLETE } */ -/* OBSOLETE if (i >= 8) */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* NOTDEF */ */ -/* OBSOLETE */ -/* OBSOLETE expect (" "); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < len_this_pass; i++) */ -/* OBSOLETE get_hex_byte (&myaddr[count++]); */ -/* OBSOLETE */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE startaddr += len_this_pass; */ -/* OBSOLETE } */ -/* OBSOLETE return count; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #define MAX_BREAKS 8 */ -/* OBSOLETE static int num_brkpts = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* Insert a breakpoint at ADDR. SAVE is normally the address of the */ -/* OBSOLETE pattern buffer where the instruction that the breakpoint overwrites */ -/* OBSOLETE is saved. It is unused here since the Adapt Monitor is responsible */ -/* OBSOLETE for saving/restoring the original instruction. */ */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE adapt_insert_breakpoint (CORE_ADDR addr, char *save) */ -/* OBSOLETE { */ -/* OBSOLETE if (num_brkpts < MAX_BREAKS) */ -/* OBSOLETE { */ -/* OBSOLETE num_brkpts++; */ -/* OBSOLETE fprintf (adapt_stream, "B %x", addr); */ -/* OBSOLETE fprintf (adapt_stream, "\r"); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE return (0); /* Success */ */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE fprintf_filtered (gdb_stderr, */ -/* OBSOLETE "Too many break points, break point not installed\n"); */ -/* OBSOLETE return (1); /* Failure */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Remove a breakpoint at ADDR. SAVE is normally the previously */ -/* OBSOLETE saved pattern, but is unused here as the Adapt Monitor is */ -/* OBSOLETE responsible for saving/restoring instructions. */ */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE adapt_remove_breakpoint (CORE_ADDR addr, char *save) */ -/* OBSOLETE { */ -/* OBSOLETE if (num_brkpts > 0) */ -/* OBSOLETE { */ -/* OBSOLETE num_brkpts--; */ -/* OBSOLETE fprintf (adapt_stream, "BR %x", addr); */ -/* OBSOLETE fprintf (adapt_stream, "\r"); */ -/* OBSOLETE fflush (adapt_stream); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE return (0); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Clear the adapts notion of what the break points are */ */ -/* OBSOLETE static int */ -/* OBSOLETE adapt_clear_breakpoints (void) */ -/* OBSOLETE { */ -/* OBSOLETE if (adapt_stream) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (adapt_stream, "BR"); /* Clear all break points */ */ -/* OBSOLETE fprintf (adapt_stream, "\r"); */ -/* OBSOLETE fflush (adapt_stream); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE num_brkpts = 0; */ -/* OBSOLETE } */ -/* OBSOLETE static void */ -/* OBSOLETE adapt_mourn (void) */ -/* OBSOLETE { */ -/* OBSOLETE adapt_clear_breakpoints (); */ -/* OBSOLETE pop_target (); /* Pop back to no-child state */ */ -/* OBSOLETE generic_mourn_inferior (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Display everthing we read in from the adapt until we match/see the */ -/* OBSOLETE * specified string */ -/* OBSOLETE */ */ -/* OBSOLETE static int */ -/* OBSOLETE display_until (char *str) */ -/* OBSOLETE { */ -/* OBSOLETE int i = 0, j, c; */ -/* OBSOLETE */ -/* OBSOLETE while (c = readchar ()) */ -/* OBSOLETE { */ -/* OBSOLETE if (c == str[i]) */ -/* OBSOLETE { */ -/* OBSOLETE i++; */ -/* OBSOLETE if (i == strlen (str)) */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE if (i) */ -/* OBSOLETE { */ -/* OBSOLETE for (j = 0; j < i; j++) /* Put everthing we matched */ */ -/* OBSOLETE putchar (str[j]); */ -/* OBSOLETE i = 0; */ -/* OBSOLETE } */ -/* OBSOLETE putchar (c); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Put a command string, in args, out to the adapt. The adapt is assumed to */ -/* OBSOLETE be in raw mode, all writing/reading done through adapt_desc. */ -/* OBSOLETE Ouput from the adapt is placed on the users terminal until the */ -/* OBSOLETE prompt from the adapt is seen. */ -/* OBSOLETE FIXME: Can't handle commands that take input. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE adapt_com (char *args, int fromtty) */ -/* OBSOLETE { */ -/* OBSOLETE if (!adapt_stream) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("Adapt not open. Use the 'target' command to open.\n"); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Clear all input so only command relative output is displayed */ */ -/* OBSOLETE slurp_input (); */ -/* OBSOLETE */ -/* OBSOLETE switch (islower (args[0]) ? toupper (args[0]) : args[0]) */ -/* OBSOLETE { */ -/* OBSOLETE default: */ -/* OBSOLETE printf_filtered ("Unknown/Unimplemented adapt command '%s'\n", args); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'G': /* Go, begin execution */ */ -/* OBSOLETE write (adapt_desc, args, strlen (args)); */ -/* OBSOLETE write (adapt_desc, "\r", 1); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'B': /* Break points, B or BR */ */ -/* OBSOLETE case 'C': /* Check current 29k status (running/halted) */ */ -/* OBSOLETE case 'D': /* Display data/registers */ */ -/* OBSOLETE case 'I': /* Input from i/o space */ */ -/* OBSOLETE case 'J': /* Jam an instruction */ */ -/* OBSOLETE case 'K': /* Kill, stop execution */ */ -/* OBSOLETE case 'L': /* Disassemble */ */ -/* OBSOLETE case 'O': /* Output to i/o space */ */ -/* OBSOLETE case 'T': /* Trace */ */ -/* OBSOLETE case 'P': /* Pulse an input line */ */ -/* OBSOLETE case 'X': /* Examine special purpose registers */ */ -/* OBSOLETE case 'Z': /* Display trace buffer */ */ -/* OBSOLETE write (adapt_desc, args, strlen (args)); */ -/* OBSOLETE write (adapt_desc, "\r", 1); */ -/* OBSOLETE expect (args); /* Don't display the command */ */ -/* OBSOLETE display_until ("# "); */ -/* OBSOLETE break; */ -/* OBSOLETE /* Begin commands that take input in the form 'c x,y[,z...]' */ */ -/* OBSOLETE case 'S': /* Set memory or register */ */ -/* OBSOLETE if (strchr (args, ',')) */ -/* OBSOLETE { /* Assume it is properly formatted */ */ -/* OBSOLETE write (adapt_desc, args, strlen (args)); */ -/* OBSOLETE write (adapt_desc, "\r", 1); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Define the target subroutine names */ */ -/* OBSOLETE */ -/* OBSOLETE struct target_ops adapt_ops; */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE init_adapt_ops (void) */ -/* OBSOLETE { */ -/* OBSOLETE adapt_ops.to_shortname = "adapt"; */ -/* OBSOLETE adapt_ops.to_longname = "Remote AMD `Adapt' target"; */ -/* OBSOLETE adapt_ops.to_doc = "Remote debug an AMD 290*0 using an `Adapt' monitor via RS232"; */ -/* OBSOLETE adapt_ops.to_open = adapt_open; */ -/* OBSOLETE adapt_ops.to_close = adapt_close; */ -/* OBSOLETE adapt_ops.to_attach = adapt_attach; */ -/* OBSOLETE adapt_ops.to_post_attach = NULL; */ -/* OBSOLETE adapt_ops.to_require_attach = NULL; */ -/* OBSOLETE adapt_ops.to_detach = adapt_detach; */ -/* OBSOLETE adapt_ops.to_require_detach = NULL; */ -/* OBSOLETE adapt_ops.to_resume = adapt_resume; */ -/* OBSOLETE adapt_ops.to_wait = adapt_wait; */ -/* OBSOLETE adapt_ops.to_post_wait = NULL; */ -/* OBSOLETE adapt_ops.to_fetch_registers = adapt_fetch_register; */ -/* OBSOLETE adapt_ops.to_store_registers = adapt_store_register; */ -/* OBSOLETE adapt_ops.to_prepare_to_store = adapt_prepare_to_store; */ -/* OBSOLETE adapt_ops.to_xfer_memory = adapt_xfer_inferior_memory; */ -/* OBSOLETE adapt_ops.to_files_info = adapt_files_info; */ -/* OBSOLETE adapt_ops.to_insert_breakpoint = adapt_insert_breakpoint; */ -/* OBSOLETE adapt_ops.to_remove_breakpoint = adapt_remove_breakpoint; */ -/* OBSOLETE adapt_ops.to_terminal_init = 0; */ -/* OBSOLETE adapt_ops.to_terminal_inferior = 0; */ -/* OBSOLETE adapt_ops.to_terminal_ours_for_output = 0; */ -/* OBSOLETE adapt_ops.to_terminal_ours = 0; */ -/* OBSOLETE adapt_ops.to_terminal_info = 0; */ -/* OBSOLETE adapt_ops.to_kill = adapt_kill; */ -/* OBSOLETE adapt_ops.to_load = adapt_load; */ -/* OBSOLETE adapt_ops.to_lookup_symbol = 0; */ -/* OBSOLETE adapt_ops.to_create_inferior = adapt_create_inferior; */ -/* OBSOLETE adapt_ops.to_post_startup_inferior = NULL; */ -/* OBSOLETE adapt_ops.to_acknowledge_created_inferior = NULL; */ -/* OBSOLETE adapt_ops.to_clone_and_follow_inferior = NULL; */ -/* OBSOLETE adapt_ops.to_post_follow_inferior_by_clone = NULL; */ -/* OBSOLETE adapt_ops.to_insert_fork_catchpoint = NULL; */ -/* OBSOLETE adapt_ops.to_remove_fork_catchpoint = NULL; */ -/* OBSOLETE adapt_ops.to_insert_vfork_catchpoint = NULL; */ -/* OBSOLETE adapt_ops.to_remove_vfork_catchpoint = NULL; */ -/* OBSOLETE adapt_ops.to_has_forked = NULL; */ -/* OBSOLETE adapt_ops.to_has_vforked = NULL; */ -/* OBSOLETE adapt_ops.to_can_follow_vfork_prior_to_exec = NULL; */ -/* OBSOLETE adapt_ops.to_post_follow_vfork = NULL; */ -/* OBSOLETE adapt_ops.to_insert_exec_catchpoint = NULL; */ -/* OBSOLETE adapt_ops.to_remove_exec_catchpoint = NULL; */ -/* OBSOLETE adapt_ops.to_has_execd = NULL; */ -/* OBSOLETE adapt_ops.to_reported_exec_events_per_exec_call = NULL; */ -/* OBSOLETE adapt_ops.to_has_exited = NULL; */ -/* OBSOLETE adapt_ops.to_mourn_inferior = adapt_mourn; */ -/* OBSOLETE adapt_ops.to_can_run = 0; */ -/* OBSOLETE adapt_ops.to_notice_signals = 0; */ -/* OBSOLETE adapt_ops.to_thread_alive = 0; */ -/* OBSOLETE adapt_ops.to_stop = 0; /* process_stratum; */ */ -/* OBSOLETE adapt_ops.to_pid_to_exec_file = NULL; */ -/* OBSOLETE adapt_ops.to_stratum = 0; */ -/* OBSOLETE adapt_ops.DONT_USE = 0; */ -/* OBSOLETE adapt_ops.to_has_all_memory = 1; */ -/* OBSOLETE adapt_ops.to_has_memory = 1; */ -/* OBSOLETE adapt_ops.to_has_stack = 1; */ -/* OBSOLETE adapt_ops.to_has_registers = 1; */ -/* OBSOLETE adapt_ops.to_has_execution = 0; */ -/* OBSOLETE adapt_ops.to_sections = 0; */ -/* OBSOLETE adapt_ops.to_sections_end = 0; */ -/* OBSOLETE adapt_ops.to_magic = OPS_MAGIC; */ -/* OBSOLETE } /* init_adapt_ops */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE _initialize_remote_adapt (void) */ -/* OBSOLETE { */ -/* OBSOLETE init_adapt_ops (); */ -/* OBSOLETE add_target (&adapt_ops); */ -/* OBSOLETE add_com ("adapt <command>", class_obscure, adapt_com, */ -/* OBSOLETE "Send a command to the AMD Adapt remote monitor."); */ -/* OBSOLETE } */ diff --git a/gdb/remote-eb.c b/gdb/remote-eb.c deleted file mode 100644 index dcee345..0000000 --- a/gdb/remote-eb.c +++ /dev/null @@ -1,1088 +0,0 @@ -/* OBSOLETE /* Remote debugging interface for AMD 29000 EBMON on IBM PC, for GDB. */ -/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001 */ -/* OBSOLETE Free Software Foundation, Inc. */ -/* OBSOLETE Contributed by Cygnus Support. Written by Jim Kingdon for 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 /* This is like remote.c but is for an esoteric situation-- */ -/* OBSOLETE having a a29k board in a PC hooked up to a unix machine with */ -/* OBSOLETE a serial line, and running ctty com1 on the PC, through which */ -/* OBSOLETE the unix machine can run ebmon. Not to mention that the PC */ -/* OBSOLETE has PC/NFS, so it can access the same executables that gdb can, */ -/* OBSOLETE over the net in real time. */ */ -/* OBSOLETE */ -/* OBSOLETE #include "defs.h" */ -/* OBSOLETE #include "gdb_string.h" */ -/* OBSOLETE #include "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE #include "inferior.h" */ -/* OBSOLETE #include "bfd.h" */ -/* OBSOLETE #include "symfile.h" */ -/* OBSOLETE #include "value.h" */ -/* OBSOLETE #include <ctype.h> */ -/* OBSOLETE #include <fcntl.h> */ -/* OBSOLETE #include <signal.h> */ -/* OBSOLETE #include <errno.h> */ -/* OBSOLETE #include "terminal.h" */ -/* OBSOLETE #include "target.h" */ -/* OBSOLETE #include "gdbcore.h" */ -/* OBSOLETE */ -/* OBSOLETE extern struct target_ops eb_ops; /* Forward declaration */ */ -/* OBSOLETE */ -/* OBSOLETE static void eb_close (); */ -/* OBSOLETE */ -/* OBSOLETE #define LOG_FILE "eb.log" */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE FILE *log_file; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE static int timeout = 24; */ -/* OBSOLETE */ -/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */ -/* OBSOLETE eb_open knows that we don't have a file open when the program */ -/* OBSOLETE starts. */ */ -/* OBSOLETE int eb_desc = -1; */ -/* OBSOLETE */ -/* OBSOLETE /* stream which is fdopen'd from eb_desc. Only valid when */ -/* OBSOLETE eb_desc != -1. */ */ -/* OBSOLETE FILE *eb_stream; */ -/* OBSOLETE */ -/* OBSOLETE /* Read a character from the remote system, doing all the fancy */ -/* OBSOLETE timeout stuff. */ */ -/* OBSOLETE static int */ -/* OBSOLETE readchar (void) */ -/* OBSOLETE { */ -/* OBSOLETE char buf; */ -/* OBSOLETE */ -/* OBSOLETE buf = '\0'; */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE /* termio does the timeout for us. */ */ -/* OBSOLETE read (eb_desc, &buf, 1); */ -/* OBSOLETE #else */ -/* OBSOLETE alarm (timeout); */ -/* OBSOLETE if (read (eb_desc, &buf, 1) < 0) */ -/* OBSOLETE { */ -/* OBSOLETE if (errno == EINTR) */ -/* OBSOLETE error ("Timeout reading from remote system."); */ -/* OBSOLETE else */ -/* OBSOLETE perror_with_name ("remote"); */ -/* OBSOLETE } */ -/* OBSOLETE alarm (0); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE if (buf == '\0') */ -/* OBSOLETE error ("Timeout reading from remote system."); */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE putc (buf & 0x7f, log_file); */ -/* OBSOLETE #endif */ -/* OBSOLETE return buf & 0x7f; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Keep discarding input from the remote system, until STRING is found. */ -/* OBSOLETE Let the user break out immediately. */ */ -/* OBSOLETE static void */ -/* OBSOLETE expect (char *string) */ -/* OBSOLETE { */ -/* OBSOLETE char *p = string; */ -/* OBSOLETE */ -/* OBSOLETE immediate_quit++; */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE if (readchar () == *p) */ -/* OBSOLETE { */ -/* OBSOLETE p++; */ -/* OBSOLETE if (*p == '\0') */ -/* OBSOLETE { */ -/* OBSOLETE immediate_quit--; */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE p = string; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Keep discarding input until we see the ebmon prompt. */ -/* OBSOLETE */ -/* OBSOLETE The convention for dealing with the prompt is that you */ -/* OBSOLETE o give your command */ -/* OBSOLETE o *then* wait for the prompt. */ -/* OBSOLETE */ -/* OBSOLETE Thus the last thing that a procedure does with the serial line */ -/* OBSOLETE will be an expect_prompt(). Exception: eb_resume does not */ -/* OBSOLETE wait for the prompt, because the terminal is being handed over */ -/* OBSOLETE to the inferior. However, the next thing which happens after that */ -/* OBSOLETE is a eb_wait which does wait for the prompt. */ -/* OBSOLETE Note that this includes abnormal exit, e.g. error(). This is */ -/* OBSOLETE necessary to prevent getting into states from which we can't */ -/* OBSOLETE recover. */ */ -/* OBSOLETE static void */ -/* OBSOLETE expect_prompt (void) */ -/* OBSOLETE { */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE /* This is a convenient place to do this. The idea is to do it often */ -/* OBSOLETE enough that we never lose much data if we terminate abnormally. */ */ -/* OBSOLETE fflush (log_file); */ -/* OBSOLETE #endif */ -/* OBSOLETE expect ("\n# "); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Get a hex digit from the remote system & return its value. */ -/* OBSOLETE If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */ */ -/* OBSOLETE static int */ -/* OBSOLETE get_hex_digit (int ignore_space) */ -/* OBSOLETE { */ -/* OBSOLETE int ch; */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE ch = readchar (); */ -/* OBSOLETE if (ch >= '0' && ch <= '9') */ -/* OBSOLETE return ch - '0'; */ -/* OBSOLETE else if (ch >= 'A' && ch <= 'F') */ -/* OBSOLETE return ch - 'A' + 10; */ -/* OBSOLETE else if (ch >= 'a' && ch <= 'f') */ -/* OBSOLETE return ch - 'a' + 10; */ -/* OBSOLETE else if (ch == ' ' && ignore_space) */ -/* OBSOLETE ; */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE error ("Invalid hex digit from remote system."); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Get a byte from eb_desc and put it in *BYT. Accept any number */ -/* OBSOLETE leading spaces. */ */ -/* OBSOLETE static void */ -/* OBSOLETE get_hex_byte (char *byt) */ -/* OBSOLETE { */ -/* OBSOLETE int val; */ -/* OBSOLETE */ -/* OBSOLETE val = get_hex_digit (1) << 4; */ -/* OBSOLETE val |= get_hex_digit (0); */ -/* OBSOLETE *byt = val; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Get N 32-bit words from remote, each preceded by a space, */ -/* OBSOLETE and put them in registers starting at REGNO. */ */ -/* OBSOLETE static void */ -/* OBSOLETE get_hex_regs (int n, int regno) */ -/* OBSOLETE { */ -/* OBSOLETE long val; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < n; i++) */ -/* OBSOLETE { */ -/* OBSOLETE int j; */ -/* OBSOLETE */ -/* OBSOLETE val = 0; */ -/* OBSOLETE for (j = 0; j < 8; j++) */ -/* OBSOLETE val = (val << 4) + get_hex_digit (j == 0); */ -/* OBSOLETE supply_register (regno++, (char *) &val); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Called when SIGALRM signal sent due to alarm() timeout. */ */ -/* OBSOLETE #ifndef HAVE_TERMIO */ -/* OBSOLETE */ -/* OBSOLETE volatile int n_alarms; */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE eb_timer (void) */ -/* OBSOLETE { */ -/* OBSOLETE #if 0 */ -/* OBSOLETE if (kiodebug) */ -/* OBSOLETE printf ("eb_timer called\n"); */ -/* OBSOLETE #endif */ -/* OBSOLETE n_alarms++; */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* malloc'd name of the program on the remote system. */ */ -/* OBSOLETE static char *prog_name = NULL; */ -/* OBSOLETE */ -/* OBSOLETE /* Nonzero if we have loaded the file ("yc") and not yet issued a "gi" */ -/* OBSOLETE command. "gi" is supposed to happen exactly once for each "yc". */ */ -/* OBSOLETE static int need_gi = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* Number of SIGTRAPs we need to simulate. That is, the next */ -/* OBSOLETE NEED_ARTIFICIAL_TRAP calls to eb_wait should just return */ -/* OBSOLETE SIGTRAP without actually waiting for anything. */ */ -/* OBSOLETE */ -/* OBSOLETE static int need_artificial_trap = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* This is called not only when we first attach, but also when the */ -/* OBSOLETE user types "run" after having attached. */ */ -/* OBSOLETE static void */ -/* OBSOLETE eb_create_inferior (char *execfile, char *args, char **env) */ -/* OBSOLETE { */ -/* OBSOLETE int entry_pt; */ -/* OBSOLETE */ -/* OBSOLETE if (args && *args) */ -/* OBSOLETE error ("Can't pass arguments to remote EBMON 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 { */ -/* OBSOLETE /* OK, now read in the file. Y=read, C=COFF, D=no symbols */ -/* OBSOLETE 0=start address, %s=filename. */ */ -/* OBSOLETE */ -/* OBSOLETE fprintf (eb_stream, "YC D,0:%s", prog_name); */ -/* OBSOLETE */ -/* OBSOLETE if (args != NULL) */ -/* OBSOLETE fprintf (eb_stream, " %s", args); */ -/* OBSOLETE */ -/* OBSOLETE fprintf (eb_stream, "\n"); */ -/* OBSOLETE fflush (eb_stream); */ -/* OBSOLETE */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE need_gi = 1; */ -/* OBSOLETE } */ -/* 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 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 proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); /* Let 'er rip... */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Translate baud rates from integers to damn B_codes. Unix should */ -/* OBSOLETE have outgrown this crap years ago, but even POSIX wouldn't buck it. */ */ -/* OBSOLETE */ -/* OBSOLETE #ifndef B19200 */ -/* OBSOLETE #define B19200 EXTA */ -/* OBSOLETE #endif */ -/* OBSOLETE #ifndef B38400 */ -/* OBSOLETE #define B38400 EXTB */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE struct */ -/* OBSOLETE { */ -/* OBSOLETE int rate, damn_b; */ -/* OBSOLETE } */ -/* OBSOLETE baudtab[] = */ -/* OBSOLETE { */ -/* OBSOLETE { */ -/* OBSOLETE 0, B0 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 50, B50 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 75, B75 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 110, B110 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 134, B134 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 150, B150 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 200, B200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 300, B300 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 600, B600 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 1200, B1200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 1800, B1800 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 2400, B2400 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 4800, B4800 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 9600, B9600 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 19200, B19200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 38400, B38400 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE -1, -1 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE }; */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE damn_b (int rate) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; baudtab[i].rate != -1; i++) */ -/* OBSOLETE if (rate == baudtab[i].rate) */ -/* OBSOLETE return baudtab[i].damn_b; */ -/* OBSOLETE return B38400; /* Random */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Open a connection to a remote debugger. */ -/* OBSOLETE NAME is the filename used for communication, then a space, */ -/* OBSOLETE then the name of the program as we should name it to EBMON. */ */ -/* OBSOLETE */ -/* OBSOLETE static int baudrate = 9600; */ -/* OBSOLETE static char *dev_name; */ -/* OBSOLETE void */ -/* OBSOLETE eb_open (char *name, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE TERMINAL sg; */ -/* OBSOLETE */ -/* OBSOLETE char *p; */ -/* OBSOLETE */ -/* OBSOLETE target_preopen (from_tty); */ -/* OBSOLETE */ -/* OBSOLETE /* Find the first whitespace character, it separates dev_name from */ -/* OBSOLETE prog_name. */ */ -/* OBSOLETE if (name == 0) */ -/* OBSOLETE goto erroid; */ -/* OBSOLETE */ -/* OBSOLETE for (p = name; */ -/* OBSOLETE *p != '\0' && !isspace (*p); p++) */ -/* OBSOLETE ; */ -/* OBSOLETE if (*p == '\0') */ -/* OBSOLETE erroid: */ -/* OBSOLETE error ("\ */ -/* OBSOLETE Please include the name of the device for the serial port,\n\ */ -/* OBSOLETE the baud rate, and the name of the program to run on the remote system."); */ -/* OBSOLETE dev_name = alloca (p - name + 1); */ -/* OBSOLETE strncpy (dev_name, name, p - name); */ -/* OBSOLETE dev_name[p - name] = '\0'; */ -/* OBSOLETE */ -/* OBSOLETE /* Skip over the whitespace after dev_name */ */ -/* OBSOLETE for (; isspace (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE */ -/* OBSOLETE if (1 != sscanf (p, "%d ", &baudrate)) */ -/* OBSOLETE goto erroid; */ -/* OBSOLETE */ -/* OBSOLETE /* Skip the number and then the spaces */ */ -/* OBSOLETE for (; isdigit (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE for (; isspace (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE */ -/* OBSOLETE if (prog_name != NULL) */ -/* OBSOLETE xfree (prog_name); */ -/* OBSOLETE prog_name = savestring (p, strlen (p)); */ -/* OBSOLETE */ -/* OBSOLETE eb_close (0); */ -/* OBSOLETE */ -/* OBSOLETE eb_desc = open (dev_name, O_RDWR); */ -/* OBSOLETE if (eb_desc < 0) */ -/* OBSOLETE perror_with_name (dev_name); */ -/* OBSOLETE ioctl (eb_desc, TIOCGETP, &sg); */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE sg.c_cc[VMIN] = 0; /* read with timeout. */ */ -/* OBSOLETE sg.c_cc[VTIME] = timeout * 10; */ -/* OBSOLETE sg.c_lflag &= ~(ICANON | ECHO); */ -/* OBSOLETE sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate); */ -/* OBSOLETE #else */ -/* OBSOLETE sg.sg_ispeed = damn_b (baudrate); */ -/* OBSOLETE sg.sg_ospeed = damn_b (baudrate); */ -/* OBSOLETE sg.sg_flags |= RAW | ANYP; */ -/* OBSOLETE sg.sg_flags &= ~ECHO; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE ioctl (eb_desc, TIOCSETP, &sg); */ -/* OBSOLETE eb_stream = fdopen (eb_desc, "r+"); */ -/* OBSOLETE */ -/* OBSOLETE push_target (&eb_ops); */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf ("Remote %s debugging %s using %s\n", target_shortname, */ -/* OBSOLETE prog_name, dev_name); */ -/* OBSOLETE */ -/* OBSOLETE #ifndef HAVE_TERMIO */ -/* OBSOLETE #ifndef NO_SIGINTERRUPT */ -/* OBSOLETE /* Cause SIGALRM's to make reads fail with EINTR instead of resuming */ -/* OBSOLETE the read. */ */ -/* OBSOLETE if (siginterrupt (SIGALRM, 1) != 0) */ -/* OBSOLETE perror ("eb_open: error in siginterrupt"); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Set up read timeout timer. */ */ -/* OBSOLETE if ((void (*)) signal (SIGALRM, eb_timer) == (void (*)) -1) */ -/* OBSOLETE perror ("eb_open: error in signal"); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE log_file = fopen (LOG_FILE, "w"); */ -/* OBSOLETE if (log_file == NULL) */ -/* OBSOLETE perror_with_name (LOG_FILE); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Hello? Are you there? */ */ -/* OBSOLETE write (eb_desc, "\n", 1); */ -/* OBSOLETE */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Close out all files and local state before this target loses control. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE eb_close (int quitting) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE /* Due to a bug in Unix, fclose closes not only the stdio stream, */ -/* OBSOLETE but also the file descriptor. So we don't actually close */ -/* OBSOLETE eb_desc. */ */ -/* OBSOLETE if (eb_stream) */ -/* OBSOLETE fclose (eb_stream); /* This also closes eb_desc */ */ -/* OBSOLETE if (eb_desc >= 0) */ -/* OBSOLETE /* close (eb_desc); */ */ -/* OBSOLETE */ -/* OBSOLETE /* Do not try to close eb_desc again, later in the program. */ */ -/* OBSOLETE eb_stream = NULL; */ -/* OBSOLETE eb_desc = -1; */ -/* OBSOLETE */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE if (log_file) */ -/* OBSOLETE { */ -/* OBSOLETE if (ferror (log_file)) */ -/* OBSOLETE printf ("Error writing log file.\n"); */ -/* OBSOLETE if (fclose (log_file) != 0) */ -/* OBSOLETE printf ("Error closing log file.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Terminate the open connection to the remote debugger. */ -/* OBSOLETE Use this when you want to detach and do something else */ -/* OBSOLETE with your gdb. */ */ -/* OBSOLETE void */ -/* OBSOLETE eb_detach (int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE pop_target (); /* calls eb_close to do the real work */ */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf ("Ending remote %s debugging\n", target_shortname); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Tell the remote machine to resume. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE eb_resume (ptid_t ptid, int step, enum target_signal sig) */ -/* OBSOLETE { */ -/* OBSOLETE if (step) */ -/* OBSOLETE { */ -/* OBSOLETE write (eb_desc, "t 1,s\n", 6); */ -/* OBSOLETE /* Wait for the echo. */ */ -/* OBSOLETE expect ("t 1,s\r"); */ -/* OBSOLETE /* Then comes a line containing the instruction we stepped to. */ */ -/* OBSOLETE expect ("\n@"); */ -/* OBSOLETE /* Then we get the prompt. */ */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE /* Force the next eb_wait to return a trap. Not doing anything */ -/* OBSOLETE about I/O from the target means that the user has to type */ -/* OBSOLETE "continue" to see any. This should be fixed. */ */ -/* OBSOLETE need_artificial_trap = 1; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE if (need_gi) */ -/* OBSOLETE { */ -/* OBSOLETE need_gi = 0; */ -/* OBSOLETE write (eb_desc, "gi\n", 3); */ -/* OBSOLETE */ -/* OBSOLETE /* Swallow the echo of "gi". */ */ -/* OBSOLETE expect ("gi\r"); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE write (eb_desc, "GR\n", 3); */ -/* OBSOLETE /* Swallow the echo. */ */ -/* OBSOLETE expect ("GR\r"); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Wait until the remote machine stops, then return, */ -/* OBSOLETE storing status in STATUS just as `wait' would. */ */ -/* OBSOLETE */ -/* OBSOLETE ptid_t */ -/* OBSOLETE eb_wait (ptid_t ptid, struct target_waitstatus *status) */ -/* OBSOLETE { */ -/* OBSOLETE /* Strings to look for. '?' means match any single character. */ -/* OBSOLETE Note that with the algorithm we use, the initial character */ -/* OBSOLETE of the string cannot recur in the string, or we will not */ -/* OBSOLETE find some cases of the string in the input. */ */ -/* OBSOLETE */ -/* OBSOLETE static char bpt[] = "Invalid interrupt taken - #0x50 - "; */ -/* OBSOLETE /* It would be tempting to look for "\n[__exit + 0x8]\n" */ -/* OBSOLETE but that requires loading symbols with "yc i" and even if */ -/* OBSOLETE we did do that we don't know that the file has symbols. */ */ -/* OBSOLETE static char exitmsg[] = "\n@????????I JMPTI GR121,LR0"; */ -/* OBSOLETE char *bp = bpt; */ -/* OBSOLETE char *ep = exitmsg; */ -/* OBSOLETE */ -/* OBSOLETE /* Large enough for either sizeof (bpt) or sizeof (exitmsg) chars. */ */ -/* OBSOLETE char swallowed[50]; */ -/* OBSOLETE /* Current position in swallowed. */ */ -/* OBSOLETE char *swallowed_p = swallowed; */ -/* OBSOLETE */ -/* OBSOLETE int ch; */ -/* OBSOLETE int ch_handled; */ -/* OBSOLETE */ -/* OBSOLETE int old_timeout = timeout; */ -/* OBSOLETE */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE */ -/* OBSOLETE if (need_artificial_trap != 0) */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE need_artificial_trap--; */ -/* OBSOLETE return 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE timeout = 0; /* Don't time out -- user program is running. */ */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE ch_handled = 0; */ -/* OBSOLETE ch = readchar (); */ -/* OBSOLETE if (ch == *bp) */ -/* OBSOLETE { */ -/* OBSOLETE bp++; */ -/* OBSOLETE if (*bp == '\0') */ -/* OBSOLETE break; */ -/* OBSOLETE ch_handled = 1; */ -/* OBSOLETE */ -/* OBSOLETE *swallowed_p++ = ch; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE bp = bpt; */ -/* OBSOLETE */ -/* OBSOLETE if (ch == *ep || *ep == '?') */ -/* OBSOLETE { */ -/* OBSOLETE ep++; */ -/* OBSOLETE if (*ep == '\0') */ -/* OBSOLETE break; */ -/* OBSOLETE */ -/* OBSOLETE if (!ch_handled) */ -/* OBSOLETE *swallowed_p++ = ch; */ -/* OBSOLETE ch_handled = 1; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE ep = exitmsg; */ -/* OBSOLETE */ -/* OBSOLETE if (!ch_handled) */ -/* OBSOLETE { */ -/* OBSOLETE char *p; */ -/* OBSOLETE */ -/* OBSOLETE /* Print out any characters which have been swallowed. */ */ -/* OBSOLETE for (p = swallowed; p < swallowed_p; ++p) */ -/* OBSOLETE putc (*p, stdout); */ -/* OBSOLETE swallowed_p = swallowed; */ -/* OBSOLETE */ -/* OBSOLETE putc (ch, stdout); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE if (*bp == '\0') */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE } */ -/* OBSOLETE timeout = old_timeout; */ -/* OBSOLETE */ -/* OBSOLETE return 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Return the name of register number REGNO */ -/* OBSOLETE in the form input and output by EBMON. */ -/* OBSOLETE */ -/* OBSOLETE Returns a pointer to a static buffer containing the answer. */ */ -/* OBSOLETE static char * */ -/* OBSOLETE get_reg_name (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE static char buf[80]; */ -/* OBSOLETE if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */ -/* OBSOLETE sprintf (buf, "GR%03d", regno - GR96_REGNUM + 96); */ -/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */ -/* OBSOLETE sprintf (buf, "LR%03d", regno - LR0_REGNUM); */ -/* OBSOLETE else if (regno == Q_REGNUM) */ -/* OBSOLETE strcpy (buf, "SR131"); */ -/* OBSOLETE else if (regno >= BP_REGNUM && regno <= CR_REGNUM) */ -/* OBSOLETE sprintf (buf, "SR%03d", regno - BP_REGNUM + 133); */ -/* OBSOLETE else if (regno == ALU_REGNUM) */ -/* OBSOLETE strcpy (buf, "SR132"); */ -/* OBSOLETE else if (regno >= IPC_REGNUM && regno <= IPB_REGNUM) */ -/* OBSOLETE sprintf (buf, "SR%03d", regno - IPC_REGNUM + 128); */ -/* OBSOLETE else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM) */ -/* OBSOLETE sprintf (buf, "SR%03d", regno - VAB_REGNUM); */ -/* OBSOLETE else if (regno == GR1_REGNUM) */ -/* OBSOLETE strcpy (buf, "GR001"); */ -/* OBSOLETE return buf; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Read the remote registers into the block REGS. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE eb_fetch_registers (void) */ -/* OBSOLETE { */ -/* OBSOLETE int reg_index; */ -/* OBSOLETE int regnum_index; */ -/* OBSOLETE char tempbuf[10]; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE #if 0 */ -/* OBSOLETE /* This should not be necessary, because one is supposed to read the */ -/* OBSOLETE registers only when the inferior is stopped (at least with */ -/* OBSOLETE ptrace() and why not make it the same for remote?). */ */ -/* OBSOLETE /* ^A is the "normal character" used to make sure we are talking to EBMON */ -/* OBSOLETE and not to the program being debugged. */ */ -/* OBSOLETE write (eb_desc, "\001\n"); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE write (eb_desc, "dw gr96,gr127\n", 14); */ -/* OBSOLETE for (reg_index = 96, regnum_index = GR96_REGNUM; */ -/* OBSOLETE reg_index < 128; */ -/* OBSOLETE reg_index += 4, regnum_index += 4) */ -/* OBSOLETE { */ -/* OBSOLETE sprintf (tempbuf, "GR%03d ", reg_index); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE get_hex_regs (4, regnum_index); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < 128; i += 32) */ -/* OBSOLETE { */ -/* OBSOLETE /* The PC has a tendency to hang if we get these */ -/* OBSOLETE all in one fell swoop ("dw lr0,lr127"). */ */ -/* OBSOLETE sprintf (tempbuf, "dw lr%d\n", i); */ -/* OBSOLETE write (eb_desc, tempbuf, strlen (tempbuf)); */ -/* OBSOLETE for (reg_index = i, regnum_index = LR0_REGNUM + i; */ -/* OBSOLETE reg_index < i + 32; */ -/* OBSOLETE reg_index += 4, regnum_index += 4) */ -/* OBSOLETE { */ -/* OBSOLETE sprintf (tempbuf, "LR%03d ", reg_index); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE get_hex_regs (4, regnum_index); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE write (eb_desc, "dw sr133,sr133\n", 15); */ -/* OBSOLETE expect ("SR133 "); */ -/* OBSOLETE get_hex_regs (1, BP_REGNUM); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE write (eb_desc, "dw sr134,sr134\n", 15); */ -/* OBSOLETE expect ("SR134 "); */ -/* OBSOLETE get_hex_regs (1, FC_REGNUM); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE write (eb_desc, "dw sr135,sr135\n", 15); */ -/* OBSOLETE expect ("SR135 "); */ -/* OBSOLETE get_hex_regs (1, CR_REGNUM); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE write (eb_desc, "dw sr131,sr131\n", 15); */ -/* OBSOLETE expect ("SR131 "); */ -/* OBSOLETE get_hex_regs (1, Q_REGNUM); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE write (eb_desc, "dw sr0,sr14\n", 12); */ -/* OBSOLETE for (reg_index = 0, regnum_index = VAB_REGNUM; */ -/* OBSOLETE regnum_index <= LRU_REGNUM; */ -/* OBSOLETE regnum_index += 4, reg_index += 4) */ -/* OBSOLETE { */ -/* OBSOLETE sprintf (tempbuf, "SR%03d ", reg_index); */ -/* OBSOLETE expect (tempbuf); */ -/* OBSOLETE get_hex_regs (reg_index == 12 ? 3 : 4, regnum_index); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* There doesn't seem to be any way to get these. */ */ -/* OBSOLETE { */ -/* OBSOLETE int val = -1; */ -/* OBSOLETE supply_register (FPE_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (INTE_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (FPS_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (EXO_REGNUM, (char *) &val); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE write (eb_desc, "dw gr1,gr1\n", 11); */ -/* OBSOLETE expect ("GR001 "); */ -/* OBSOLETE get_hex_regs (1, GR1_REGNUM); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Fetch register REGNO, or all registers if REGNO is -1. */ -/* OBSOLETE Returns errno value. */ */ -/* OBSOLETE void */ -/* OBSOLETE eb_fetch_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE if (regno == -1) */ -/* OBSOLETE eb_fetch_registers (); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE char *name = get_reg_name (regno); */ -/* OBSOLETE fprintf (eb_stream, "dw %s,%s\n", name, name); */ -/* OBSOLETE expect (name); */ -/* OBSOLETE expect (" "); */ -/* OBSOLETE get_hex_regs (1, regno); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Store the remote registers from the contents of the block REGS. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE eb_store_registers (void) */ -/* OBSOLETE { */ -/* OBSOLETE int i, j; */ -/* OBSOLETE fprintf (eb_stream, "s gr1,%x\n", read_register (GR1_REGNUM)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE for (j = 0; j < 32; j += 16) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (eb_stream, "s gr%d,", j + 96); */ -/* OBSOLETE for (i = 0; i < 15; ++i) */ -/* OBSOLETE fprintf (eb_stream, "%x,", read_register (GR96_REGNUM + j + i)); */ -/* OBSOLETE fprintf (eb_stream, "%x\n", read_register (GR96_REGNUM + j + 15)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE for (j = 0; j < 128; j += 16) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (eb_stream, "s lr%d,", j); */ -/* OBSOLETE for (i = 0; i < 15; ++i) */ -/* OBSOLETE fprintf (eb_stream, "%x,", read_register (LR0_REGNUM + j + i)); */ -/* OBSOLETE fprintf (eb_stream, "%x\n", read_register (LR0_REGNUM + j + 15)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE fprintf (eb_stream, "s sr133,%x,%x,%x\n", read_register (BP_REGNUM), */ -/* OBSOLETE read_register (FC_REGNUM), read_register (CR_REGNUM)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE fprintf (eb_stream, "s sr131,%x\n", read_register (Q_REGNUM)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE fprintf (eb_stream, "s sr0,"); */ -/* OBSOLETE for (i = 0; i < 11; ++i) */ -/* OBSOLETE fprintf (eb_stream, "%x,", read_register (VAB_REGNUM + i)); */ -/* OBSOLETE fprintf (eb_stream, "%x\n", read_register (VAB_REGNUM + 11)); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Store register REGNO, or all if REGNO == 0. */ -/* OBSOLETE Return errno value. */ */ -/* OBSOLETE void */ -/* OBSOLETE eb_store_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE if (regno == -1) */ -/* OBSOLETE eb_store_registers (); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE char *name = get_reg_name (regno); */ -/* OBSOLETE fprintf (eb_stream, "s %s,%x\n", name, read_register (regno)); */ -/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so */ -/* OBSOLETE invalidate the register cache. Do this *after* calling */ -/* OBSOLETE read_register, because we want read_register to return the */ -/* OBSOLETE value that write_register has just stuffed into the registers */ -/* OBSOLETE array, not the value of the register fetched from the */ -/* OBSOLETE inferior. */ */ -/* OBSOLETE if (regno == GR1_REGNUM) */ -/* OBSOLETE registers_changed (); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Get ready to modify the registers array. On machines which store */ -/* OBSOLETE individual registers, this doesn't need to do anything. On machines */ -/* OBSOLETE which store all the registers in one fell swoop, this makes sure */ -/* OBSOLETE that registers contains all the registers from the program being */ -/* OBSOLETE debugged. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE eb_prepare_to_store (void) */ -/* OBSOLETE { */ -/* OBSOLETE /* Do nothing, since we can store individual regs */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Transfer LEN bytes between GDB address MYADDR and target address */ -/* OBSOLETE MEMADDR. If WRITE is non-zero, transfer them to the target, */ -/* OBSOLETE otherwise transfer them from the target. TARGET is unused. */ -/* OBSOLETE */ -/* OBSOLETE Returns the number of bytes transferred. */ */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE eb_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */ -/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */ -/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */ -/* OBSOLETE { */ -/* OBSOLETE if (write) */ -/* OBSOLETE return eb_write_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE else */ -/* OBSOLETE return eb_read_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE eb_files_info (void) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("\tAttached to %s at %d baud and running program %s.\n", */ -/* OBSOLETE dev_name, baudrate, prog_name); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Copy LEN bytes of data from debugger memory at MYADDR */ -/* OBSOLETE to inferior's memory at MEMADDR. Returns length moved. */ */ -/* OBSOLETE int */ -/* OBSOLETE eb_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < len; i++) */ -/* OBSOLETE { */ -/* OBSOLETE if ((i % 16) == 0) */ -/* OBSOLETE fprintf (eb_stream, "sb %x,", memaddr + i); */ -/* OBSOLETE if ((i % 16) == 15 || i == len - 1) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (eb_stream, "%x\n", ((unsigned char *) myaddr)[i]); */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE fprintf (eb_stream, "%x,", ((unsigned char *) myaddr)[i]); */ -/* OBSOLETE } */ -/* OBSOLETE return len; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Read LEN bytes from inferior memory at MEMADDR. Put the result */ -/* OBSOLETE at debugger address MYADDR. Returns length moved. */ */ -/* OBSOLETE int */ -/* OBSOLETE eb_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes read so far. */ */ -/* OBSOLETE int count; */ -/* OBSOLETE */ -/* OBSOLETE /* Starting address of this pass. */ */ -/* OBSOLETE unsigned long startaddr; */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes to read in this pass. */ */ -/* OBSOLETE int len_this_pass; */ -/* OBSOLETE */ -/* OBSOLETE /* Note that this code works correctly if startaddr is just less */ -/* OBSOLETE than UINT_MAX (well, really CORE_ADDR_MAX if there was such a */ -/* OBSOLETE thing). That is, something like */ -/* OBSOLETE eb_read_bytes (CORE_ADDR_MAX - 4, foo, 4) */ -/* OBSOLETE works--it never adds len to memaddr and gets 0. */ */ -/* OBSOLETE /* However, something like */ -/* OBSOLETE eb_read_bytes (CORE_ADDR_MAX - 3, foo, 4) */ -/* OBSOLETE doesn't need to work. Detect it and give up if there's an attempt */ -/* OBSOLETE to do that. */ */ -/* OBSOLETE if (((memaddr - 1) + len) < memaddr) */ -/* OBSOLETE { */ -/* OBSOLETE errno = EIO; */ -/* OBSOLETE return 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE startaddr = memaddr; */ -/* OBSOLETE count = 0; */ -/* OBSOLETE while (count < len) */ -/* OBSOLETE { */ -/* OBSOLETE len_this_pass = 16; */ -/* OBSOLETE if ((startaddr % 16) != 0) */ -/* OBSOLETE len_this_pass -= startaddr % 16; */ -/* OBSOLETE if (len_this_pass > (len - count)) */ -/* OBSOLETE len_this_pass = (len - count); */ -/* OBSOLETE */ -/* OBSOLETE fprintf (eb_stream, "db %x,%x\n", startaddr, */ -/* OBSOLETE (startaddr - 1) + len_this_pass); */ -/* OBSOLETE expect ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE /* Look for 8 hex digits. */ */ -/* OBSOLETE i = 0; */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE if (isxdigit (readchar ())) */ -/* OBSOLETE ++i; */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE error ("Hex digit expected from remote system."); */ -/* OBSOLETE } */ -/* OBSOLETE if (i >= 8) */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE expect (" "); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < len_this_pass; i++) */ -/* OBSOLETE get_hex_byte (&myaddr[count++]); */ -/* OBSOLETE */ -/* OBSOLETE expect_prompt (); */ -/* OBSOLETE */ -/* OBSOLETE startaddr += len_this_pass; */ -/* OBSOLETE } */ -/* OBSOLETE return len; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE eb_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 eb_mourn_inferior (void) */ -/* OBSOLETE { */ -/* OBSOLETE remove_breakpoints (); */ -/* OBSOLETE unpush_target (&eb_ops); */ -/* OBSOLETE generic_mourn_inferior (); /* Do all the proper things now */ */ -/* OBSOLETE } */ -/* OBSOLETE /* Define the target subroutine names */ */ -/* OBSOLETE */ -/* OBSOLETE struct target_ops eb_ops; */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE init_eb_ops (void) */ -/* OBSOLETE { */ -/* OBSOLETE eb_ops.to_shortname = "amd-eb"; */ -/* OBSOLETE eb_ops.to_longname = "Remote serial AMD EBMON target"; */ -/* OBSOLETE eb_ops.to_doc = "Use a remote computer running EBMON connected by a serial line.\n\ */ -/* OBSOLETE Arguments are the name of the device for the serial line,\n\ */ -/* OBSOLETE the speed to connect at in bits per second, and the filename of the\n\ */ -/* OBSOLETE executable as it exists on the remote computer. For example,\n\ */ -/* OBSOLETE target amd-eb /dev/ttya 9600 demo", */ -/* OBSOLETE eb_ops.to_open = eb_open; */ -/* OBSOLETE eb_ops.to_close = eb_close; */ -/* OBSOLETE eb_ops.to_attach = 0; */ -/* OBSOLETE eb_ops.to_post_attach = NULL; */ -/* OBSOLETE eb_ops.to_require_attach = NULL; */ -/* OBSOLETE eb_ops.to_detach = eb_detach; */ -/* OBSOLETE eb_ops.to_require_detach = NULL; */ -/* OBSOLETE eb_ops.to_resume = eb_resume; */ -/* OBSOLETE eb_ops.to_wait = eb_wait; */ -/* OBSOLETE eb_ops.to_post_wait = NULL; */ -/* OBSOLETE eb_ops.to_fetch_registers = eb_fetch_register; */ -/* OBSOLETE eb_ops.to_store_registers = eb_store_register; */ -/* OBSOLETE eb_ops.to_prepare_to_store = eb_prepare_to_store; */ -/* OBSOLETE eb_ops.to_xfer_memory = eb_xfer_inferior_memory; */ -/* OBSOLETE eb_ops.to_files_info = eb_files_info; */ -/* OBSOLETE eb_ops.to_insert_breakpoint = 0; */ -/* OBSOLETE eb_ops.to_remove_breakpoint = 0; /* Breakpoints */ */ -/* OBSOLETE eb_ops.to_terminal_init = 0; */ -/* OBSOLETE eb_ops.to_terminal_inferior = 0; */ -/* OBSOLETE eb_ops.to_terminal_ours_for_output = 0; */ -/* OBSOLETE eb_ops.to_terminal_ours = 0; */ -/* OBSOLETE eb_ops.to_terminal_info = 0; /* Terminal handling */ */ -/* OBSOLETE eb_ops.to_kill = eb_kill; */ -/* OBSOLETE eb_ops.to_load = generic_load; /* load */ */ -/* OBSOLETE eb_ops.to_lookup_symbol = 0; /* lookup_symbol */ */ -/* OBSOLETE eb_ops.to_create_inferior = eb_create_inferior; */ -/* OBSOLETE eb_ops.to_post_startup_inferior = NULL; */ -/* OBSOLETE eb_ops.to_acknowledge_created_inferior = NULL; */ -/* OBSOLETE eb_ops.to_clone_and_follow_inferior = NULL; */ -/* OBSOLETE eb_ops.to_post_follow_inferior_by_clone = NULL; */ -/* OBSOLETE eb_ops.to_insert_fork_catchpoint = NULL; */ -/* OBSOLETE eb_ops.to_remove_fork_catchpoint = NULL; */ -/* OBSOLETE eb_ops.to_insert_vfork_catchpoint = NULL; */ -/* OBSOLETE eb_ops.to_remove_vfork_catchpoint = NULL; */ -/* OBSOLETE eb_ops.to_has_forked = NULL; */ -/* OBSOLETE eb_ops.to_has_vforked = NULL; */ -/* OBSOLETE eb_ops.to_can_follow_vfork_prior_to_exec = NULL; */ -/* OBSOLETE eb_ops.to_post_follow_vfork = NULL; */ -/* OBSOLETE eb_ops.to_insert_exec_catchpoint = NULL; */ -/* OBSOLETE eb_ops.to_remove_exec_catchpoint = NULL; */ -/* OBSOLETE eb_ops.to_has_execd = NULL; */ -/* OBSOLETE eb_ops.to_reported_exec_events_per_exec_call = NULL; */ -/* OBSOLETE eb_ops.to_has_exited = NULL; */ -/* OBSOLETE eb_ops.to_mourn_inferior = eb_mourn_inferior; */ -/* OBSOLETE eb_ops.to_can_run = 0; /* can_run */ */ -/* OBSOLETE eb_ops.to_notice_signals = 0; /* notice_signals */ */ -/* OBSOLETE eb_ops.to_thread_alive = 0; /* thread-alive */ */ -/* OBSOLETE eb_ops.to_stop = 0; /* to_stop */ */ -/* OBSOLETE eb_ops.to_pid_to_exec_file = NULL; */ -/* OBSOLETE eb_ops.to_stratum = process_stratum; */ -/* OBSOLETE eb_ops.DONT_USE = 0; /* next */ */ -/* OBSOLETE eb_ops.to_has_all_memory = 1; */ -/* OBSOLETE eb_ops.to_has_memory = 1; */ -/* OBSOLETE eb_ops.to_has_stack = 1; */ -/* OBSOLETE eb_ops.to_has_registers = 1; */ -/* OBSOLETE eb_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */ */ -/* OBSOLETE eb_ops.to_sections = 0; /* sections */ */ -/* OBSOLETE eb_ops.to_sections_end = 0; /* sections end */ */ -/* OBSOLETE eb_ops.to_magic = OPS_MAGIC; /* Always the last thing */ */ -/* OBSOLETE }; */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE _initialize_remote_eb (void) */ -/* OBSOLETE { */ -/* OBSOLETE init_eb_ops (); */ -/* OBSOLETE add_target (&eb_ops); */ -/* OBSOLETE } */ diff --git a/gdb/remote-mm.c b/gdb/remote-mm.c deleted file mode 100644 index 1cd630e..0000000 --- a/gdb/remote-mm.c +++ /dev/null @@ -1,1848 +0,0 @@ -/* OBSOLETE /* Remote debugging interface for Am290*0 running MiniMON monitor, for GDB. */ -/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */ -/* OBSOLETE 2001 Free Software Foundation, Inc. */ -/* OBSOLETE Originally written by Daniel Mann at AMD. */ -/* 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 /* This is like remote.c but ecpects MiniMON to be running on the Am29000 */ -/* OBSOLETE target hardware. */ -/* OBSOLETE - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this */ -/* OBSOLETE file to gdb 3.95. I was unable to get this working on sun3os4 */ -/* OBSOLETE with termio, only with sgtty. Because we are only attempting to */ -/* OBSOLETE use this module to debug our kernel, which is already loaded when */ -/* OBSOLETE gdb is started up, I did not code up the file downloading facilities. */ -/* OBSOLETE As a result this module has only the stubs to download files. */ -/* OBSOLETE You should get tagged at compile time if you need to make any */ -/* OBSOLETE changes/additions. */ */ -/* OBSOLETE */ -/* OBSOLETE #include "defs.h" */ -/* OBSOLETE #include "inferior.h" */ -/* OBSOLETE #include "value.h" */ -/* OBSOLETE #include <ctype.h> */ -/* OBSOLETE #include <fcntl.h> */ -/* OBSOLETE #include <signal.h> */ -/* OBSOLETE #include <errno.h> */ -/* OBSOLETE #include "gdb_string.h" */ -/* OBSOLETE #include "terminal.h" */ -/* OBSOLETE #include "minimon.h" */ -/* OBSOLETE #include "target.h" */ -/* OBSOLETE #include "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE /* Offset of member MEMBER in a struct of type TYPE. */ */ -/* OBSOLETE #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) */ -/* OBSOLETE */ -/* OBSOLETE #define DRAIN_INPUT() (msg_recv_serial((union msg_t*)0)) */ -/* OBSOLETE */ -/* OBSOLETE extern int stop_soon_quietly; /* for wait_for_inferior */ */ -/* OBSOLETE */ -/* OBSOLETE static void mm_resume (ptid_t ptid, int step, enum target_signal sig) */ -/* OBSOLETE static void mm_fetch_registers (); */ -/* OBSOLETE static int fetch_register (); */ -/* OBSOLETE static void mm_store_registers (); */ -/* OBSOLETE static int store_register (); */ -/* OBSOLETE static int regnum_to_srnum (); */ -/* OBSOLETE static void mm_close (); */ -/* OBSOLETE static char *msg_str (); */ -/* OBSOLETE static char *error_msg_str (); */ -/* OBSOLETE static int expect_msg (); */ -/* OBSOLETE static void init_target_mm (); */ -/* OBSOLETE static int mm_memory_space (); */ -/* OBSOLETE */ -/* OBSOLETE #define FREEZE_MODE (read_register(CPS_REGNUM) && 0x400) */ -/* OBSOLETE #define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE) */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME: Replace with `set remotedebug'. */ */ -/* OBSOLETE #define LLOG_FILE "minimon.log" */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE FILE *log_file; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Size of message buffers. I couldn't get memory reads to work when */ -/* OBSOLETE * the byte_count was larger than 512 (it may be a baud rate problem). */ -/* OBSOLETE */ */ -/* OBSOLETE #define BUFER_SIZE 512 */ -/* OBSOLETE /* */ -/* OBSOLETE * Size of data area in message buffer on the TARGET (remote system). */ -/* OBSOLETE */ */ -/* OBSOLETE #define MAXDATA_T (target_config.max_msg_size - \ */ -/* OBSOLETE offsetof(struct write_r_msg_t,data[0])) */ -/* OBSOLETE /* */ -/* OBSOLETE * Size of data area in message buffer on the HOST (gdb). */ -/* OBSOLETE */ */ -/* OBSOLETE #define MAXDATA_H (BUFER_SIZE - offsetof(struct write_r_msg_t,data[0])) */ -/* OBSOLETE /* */ -/* OBSOLETE * Defined as the minimum size of data areas of the two message buffers */ -/* OBSOLETE */ */ -/* OBSOLETE #define MAXDATA (MAXDATA_H < MAXDATA_T ? MAXDATA_H : MAXDATA_T) */ -/* OBSOLETE */ -/* OBSOLETE static char out_buf[BUFER_SIZE]; */ -/* OBSOLETE static char in_buf[BUFER_SIZE]; */ -/* OBSOLETE */ -/* OBSOLETE int msg_recv_serial (); */ -/* OBSOLETE int msg_send_serial (); */ -/* OBSOLETE */ -/* OBSOLETE #define MAX_RETRIES 5000 */ -/* OBSOLETE extern struct target_ops mm_ops; /* Forward declaration */ */ -/* OBSOLETE struct config_msg_t target_config; /* HIF needs this */ */ -/* OBSOLETE union msg_t *out_msg_buf = (union msg_t *) out_buf; */ -/* OBSOLETE union msg_t *in_msg_buf = (union msg_t *) in_buf; */ -/* OBSOLETE */ -/* OBSOLETE static int timeout = 5; */ -/* OBSOLETE */ -/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */ -/* OBSOLETE mm_open knows that we don't have a file open when the program */ -/* OBSOLETE starts. */ */ -/* OBSOLETE int mm_desc = -1; */ -/* OBSOLETE */ -/* OBSOLETE /* stream which is fdopen'd from mm_desc. Only valid when */ -/* OBSOLETE mm_desc != -1. */ */ -/* OBSOLETE FILE *mm_stream; */ -/* OBSOLETE */ -/* OBSOLETE /* Called when SIGALRM signal sent due to alarm() timeout. */ */ -/* OBSOLETE #ifndef HAVE_TERMIO */ -/* OBSOLETE */ -/* OBSOLETE volatile int n_alarms; */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE mm_timer (void) */ -/* OBSOLETE { */ -/* OBSOLETE #if 0 */ -/* OBSOLETE if (kiodebug) */ -/* OBSOLETE printf ("mm_timer called\n"); */ -/* OBSOLETE #endif */ -/* OBSOLETE n_alarms++; */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* HAVE_TERMIO */ */ -/* OBSOLETE */ -/* OBSOLETE /* malloc'd name of the program on the remote system. */ */ -/* OBSOLETE static char *prog_name = NULL; */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Number of SIGTRAPs we need to simulate. That is, the next */ -/* OBSOLETE NEED_ARTIFICIAL_TRAP calls to mm_wait should just return */ -/* OBSOLETE SIGTRAP without actually waiting for anything. */ */ -/* OBSOLETE */ -/* OBSOLETE /**************************************************** REMOTE_CREATE_INFERIOR */ */ -/* OBSOLETE /* This is called not only when we first attach, but also when the */ -/* OBSOLETE user types "run" after having attached. */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_create_inferior (char *execfile, char *args, char **env) */ -/* OBSOLETE { */ -/* OBSOLETE #define MAX_TOKENS 25 */ -/* OBSOLETE #define BUFFER_SIZE 256 */ -/* OBSOLETE int token_count; */ -/* OBSOLETE int result; */ -/* OBSOLETE char *token[MAX_TOKENS]; */ -/* OBSOLETE char cmd_line[BUFFER_SIZE]; */ -/* OBSOLETE */ -/* OBSOLETE if (args && *args) */ -/* OBSOLETE error ("Can't pass arguments to remote mm process (yet)."); */ -/* OBSOLETE */ -/* OBSOLETE if (execfile == 0 /* || exec_bfd == 0 */ ) */ -/* OBSOLETE error ("No executable file specified"); */ -/* OBSOLETE */ -/* OBSOLETE if (!mm_stream) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Minimon not open yet.\n"); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* On ultra3 (NYU) we assume the kernel is already running so there is */ -/* OBSOLETE no file to download. */ -/* OBSOLETE FIXME: Fixed required here -> load your program, possibly with mm_load(). */ -/* OBSOLETE */ */ -/* OBSOLETE printf_filtered ("\n\ */ -/* OBSOLETE Assuming you are at NYU debuging a kernel, i.e., no need to download.\n\n"); */ -/* OBSOLETE */ -/* OBSOLETE /* We will get a task spawn event immediately. */ */ -/* OBSOLETE init_wait_for_inferior (); */ -/* OBSOLETE clear_proceed_status (); */ -/* OBSOLETE stop_soon_quietly = 1; */ -/* OBSOLETE proceed (-1, TARGET_SIGNAL_DEFAULT, 0); */ -/* OBSOLETE normal_stop (); */ -/* OBSOLETE } */ -/* OBSOLETE /**************************************************** REMOTE_MOURN_INFERIOR */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_mourn (void) */ -/* OBSOLETE { */ -/* OBSOLETE pop_target (); /* Pop back to no-child state */ */ -/* OBSOLETE generic_mourn_inferior (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************************** damn_b */ -/* OBSOLETE */ */ -/* OBSOLETE /* Translate baud rates from integers to damn B_codes. Unix should */ -/* OBSOLETE have outgrown this crap years ago, but even POSIX wouldn't buck it. */ */ -/* OBSOLETE */ -/* OBSOLETE #ifndef B19200 */ -/* OBSOLETE #define B19200 EXTA */ -/* OBSOLETE #endif */ -/* OBSOLETE #ifndef B38400 */ -/* OBSOLETE #define B38400 EXTB */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE static struct */ -/* OBSOLETE { */ -/* OBSOLETE int rate, damn_b; */ -/* OBSOLETE } */ -/* OBSOLETE baudtab[] = */ -/* OBSOLETE { */ -/* OBSOLETE { */ -/* OBSOLETE 0, B0 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 50, B50 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 75, B75 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 110, B110 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 134, B134 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 150, B150 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 200, B200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 300, B300 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 600, B600 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 1200, B1200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 1800, B1800 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 2400, B2400 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 4800, B4800 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 9600, B9600 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 19200, B19200 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE 38400, B38400 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE { */ -/* OBSOLETE -1, -1 */ -/* OBSOLETE } */ -/* OBSOLETE , */ -/* OBSOLETE }; */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE damn_b (int rate) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; baudtab[i].rate != -1; i++) */ -/* OBSOLETE if (rate == baudtab[i].rate) */ -/* OBSOLETE return baudtab[i].damn_b; */ -/* OBSOLETE return B38400; /* Random */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /***************************************************************** REMOTE_OPEN */ -/* OBSOLETE ** Open a connection to remote minimon. */ -/* OBSOLETE NAME is the filename used for communication, then a space, */ -/* OBSOLETE then the baud rate. */ -/* OBSOLETE 'target adapt /dev/ttya 9600 [prognam]' for example. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE static char *dev_name; */ -/* OBSOLETE int baudrate = 9600; */ -/* OBSOLETE static void */ -/* OBSOLETE mm_open (char *name, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE TERMINAL sg; */ -/* OBSOLETE unsigned int prl; */ -/* OBSOLETE char *p; */ -/* OBSOLETE */ -/* OBSOLETE /* Find the first whitespace character, it separates dev_name from */ -/* OBSOLETE prog_name. */ */ -/* OBSOLETE for (p = name; */ -/* OBSOLETE p && *p && !isspace (*p); p++) */ -/* OBSOLETE ; */ -/* OBSOLETE if (p == 0 || *p == '\0') */ -/* OBSOLETE erroid: */ -/* OBSOLETE error ("Usage : <command> <serial-device> <baud-rate> [progname]"); */ -/* OBSOLETE dev_name = (char *) xmalloc (p - name + 1); */ -/* OBSOLETE strncpy (dev_name, name, p - name); */ -/* OBSOLETE dev_name[p - name] = '\0'; */ -/* OBSOLETE */ -/* OBSOLETE /* Skip over the whitespace after dev_name */ */ -/* OBSOLETE for (; isspace (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE */ -/* OBSOLETE if (1 != sscanf (p, "%d ", &baudrate)) */ -/* OBSOLETE goto erroid; */ -/* OBSOLETE */ -/* OBSOLETE /* Skip the number and then the spaces */ */ -/* OBSOLETE for (; isdigit (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE for (; isspace (*p); p++) */ -/* OBSOLETE /*EMPTY */ ; */ -/* OBSOLETE */ -/* OBSOLETE if (prog_name != NULL) */ -/* OBSOLETE xfree (prog_name); */ -/* OBSOLETE prog_name = savestring (p, strlen (p)); */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE if (mm_desc >= 0) */ -/* OBSOLETE close (mm_desc); */ -/* OBSOLETE */ -/* OBSOLETE mm_desc = open (dev_name, O_RDWR); */ -/* OBSOLETE if (mm_desc < 0) */ -/* OBSOLETE perror_with_name (dev_name); */ -/* OBSOLETE ioctl (mm_desc, TIOCGETP, &sg); */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE sg.c_cc[VMIN] = 0; /* read with timeout. */ */ -/* OBSOLETE sg.c_cc[VTIME] = timeout * 10; */ -/* OBSOLETE sg.c_lflag &= ~(ICANON | ECHO); */ -/* OBSOLETE sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate); */ -/* OBSOLETE #else */ -/* OBSOLETE sg.sg_ispeed = damn_b (baudrate); */ -/* OBSOLETE sg.sg_ospeed = damn_b (baudrate); */ -/* OBSOLETE sg.sg_flags |= RAW; */ -/* OBSOLETE sg.sg_flags |= ANYP; */ -/* OBSOLETE sg.sg_flags &= ~ECHO; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE ioctl (mm_desc, TIOCSETP, &sg); */ -/* OBSOLETE mm_stream = fdopen (mm_desc, "r+"); */ -/* OBSOLETE */ -/* OBSOLETE push_target (&mm_ops); */ -/* OBSOLETE */ -/* OBSOLETE #ifndef HAVE_TERMIO */ -/* OBSOLETE #ifndef NO_SIGINTERRUPT */ -/* OBSOLETE /* Cause SIGALRM's to make reads fail with EINTR instead of resuming */ -/* OBSOLETE the read. */ */ -/* OBSOLETE if (siginterrupt (SIGALRM, 1) != 0) */ -/* OBSOLETE perror ("mm_open: error in siginterrupt"); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Set up read timeout timer. */ */ -/* OBSOLETE if ((void (*)) signal (SIGALRM, mm_timer) == (void (*)) -1) */ -/* OBSOLETE perror ("mm_open: error in signal"); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE log_file = fopen (LOG_FILE, "w"); */ -/* OBSOLETE if (log_file == NULL) */ -/* OBSOLETE perror_with_name (LOG_FILE); */ -/* OBSOLETE #endif */ -/* OBSOLETE /* */ -/* OBSOLETE ** Initialize target configuration structure (global) */ -/* OBSOLETE */ */ -/* OBSOLETE DRAIN_INPUT (); */ -/* OBSOLETE out_msg_buf->config_req_msg.code = CONFIG_REQ; */ -/* OBSOLETE out_msg_buf->config_req_msg.length = 4 * 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); /* send config request message */ */ -/* OBSOLETE */ -/* OBSOLETE expect_msg (CONFIG, in_msg_buf, 1); */ -/* OBSOLETE */ -/* OBSOLETE a29k_get_processor_type (); */ -/* OBSOLETE */ -/* OBSOLETE /* Print out some stuff, letting the user now what's going on */ */ -/* OBSOLETE printf_filtered ("Connected to MiniMon via %s.\n", dev_name); */ -/* OBSOLETE /* FIXME: can this restriction be removed? */ */ -/* OBSOLETE printf_filtered ("Remote debugging using virtual addresses works only\n"); */ -/* OBSOLETE printf_filtered ("\twhen virtual addresses map 1:1 to physical addresses.\n") */ -/* OBSOLETE ; */ -/* OBSOLETE if (processor_type != a29k_freeze_mode) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf_filtered (gdb_stderr, */ -/* OBSOLETE "Freeze-mode debugging not available, and can only be done on an A29050.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE target_config.code = CONFIG; */ -/* OBSOLETE target_config.length = 0; */ -/* OBSOLETE target_config.processor_id = in_msg_buf->config_msg.processor_id; */ -/* OBSOLETE target_config.version = in_msg_buf->config_msg.version; */ -/* OBSOLETE target_config.I_mem_start = in_msg_buf->config_msg.I_mem_start; */ -/* OBSOLETE target_config.I_mem_size = in_msg_buf->config_msg.I_mem_size; */ -/* OBSOLETE target_config.D_mem_start = in_msg_buf->config_msg.D_mem_start; */ -/* OBSOLETE target_config.D_mem_size = in_msg_buf->config_msg.D_mem_size; */ -/* OBSOLETE target_config.ROM_start = in_msg_buf->config_msg.ROM_start; */ -/* OBSOLETE target_config.ROM_size = in_msg_buf->config_msg.ROM_size; */ -/* OBSOLETE target_config.max_msg_size = in_msg_buf->config_msg.max_msg_size; */ -/* OBSOLETE target_config.max_bkpts = in_msg_buf->config_msg.max_bkpts; */ -/* OBSOLETE target_config.coprocessor = in_msg_buf->config_msg.coprocessor; */ -/* OBSOLETE target_config.reserved = in_msg_buf->config_msg.reserved; */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Connected to MiniMON :\n"); */ -/* OBSOLETE printf (" Debugcore version %d.%d\n", */ -/* OBSOLETE 0x0f & (target_config.version >> 4), */ -/* OBSOLETE 0x0f & (target_config.version)); */ -/* OBSOLETE printf (" Configuration version %d.%d\n", */ -/* OBSOLETE 0x0f & (target_config.version >> 12), */ -/* OBSOLETE 0x0f & (target_config.version >> 8)); */ -/* OBSOLETE printf (" Message system version %d.%d\n", */ -/* OBSOLETE 0x0f & (target_config.version >> 20), */ -/* OBSOLETE 0x0f & (target_config.version >> 16)); */ -/* OBSOLETE printf (" Communication driver version %d.%d\n", */ -/* OBSOLETE 0x0f & (target_config.version >> 28), */ -/* OBSOLETE 0x0f & (target_config.version >> 24)); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Leave the target running... */ -/* OBSOLETE * The above message stopped the target in the dbg core (MiniMon), */ -/* OBSOLETE * so restart the target out of MiniMon, */ -/* OBSOLETE */ */ -/* OBSOLETE out_msg_buf->go_msg.code = GO; */ -/* OBSOLETE out_msg_buf->go_msg.length = 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE /* No message to expect after a GO */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /**************************************************************** REMOTE_CLOSE */ -/* OBSOLETE ** Close the open connection to the minimon debugger. */ -/* OBSOLETE Use this when you want to detach and do something else */ -/* OBSOLETE with your gdb. */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_close ( /*FIXME: how is quitting used */ */ -/* OBSOLETE int quitting) */ -/* OBSOLETE { */ -/* OBSOLETE if (mm_desc < 0) */ -/* OBSOLETE error ("Can't close remote connection: not debugging remotely."); */ -/* OBSOLETE */ -/* OBSOLETE /* We should never get here if there isn't something valid in */ -/* OBSOLETE mm_desc and mm_stream. */ -/* OBSOLETE */ -/* OBSOLETE Due to a bug in Unix, fclose closes not only the stdio stream, */ -/* OBSOLETE but also the file descriptor. So we don't actually close */ -/* OBSOLETE mm_desc. */ */ -/* OBSOLETE DRAIN_INPUT (); */ -/* OBSOLETE fclose (mm_stream); */ -/* OBSOLETE /* close (mm_desc); */ */ -/* OBSOLETE */ -/* OBSOLETE /* Do not try to close mm_desc again, later in the program. */ */ -/* OBSOLETE mm_stream = NULL; */ -/* OBSOLETE mm_desc = -1; */ -/* OBSOLETE */ -/* OBSOLETE #if defined (LOG_FILE) */ -/* OBSOLETE if (ferror (log_file)) */ -/* OBSOLETE printf ("Error writing log file.\n"); */ -/* OBSOLETE if (fclose (log_file) != 0) */ -/* OBSOLETE printf ("Error closing log file.\n"); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE printf ("Ending remote debugging\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /************************************************************* REMOTE_ATACH */ */ -/* OBSOLETE /* Attach to a program that is already loaded and running */ -/* OBSOLETE * Upon exiting the process's execution is stopped. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_attach (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE if (!mm_stream) */ -/* OBSOLETE error ("MiniMon not opened yet, use the 'target minimon' command.\n"); */ -/* OBSOLETE */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf ("Attaching to remote program %s...\n", prog_name); */ -/* OBSOLETE */ -/* OBSOLETE /* Make sure the target is currently running, it is supposed to be. */ */ -/* OBSOLETE /* FIXME: is it ok to send MiniMon a BREAK if it is already stopped in */ -/* OBSOLETE * the dbg core. If so, we don't need to send this GO. */ -/* OBSOLETE */ */ -/* OBSOLETE out_msg_buf->go_msg.code = GO; */ -/* OBSOLETE out_msg_buf->go_msg.length = 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE sleep (2); /* At the worst it will stop, receive a message, continue */ */ -/* OBSOLETE */ -/* OBSOLETE /* Send the mm a break. */ */ -/* OBSOLETE out_msg_buf->break_msg.code = BREAK; */ -/* OBSOLETE out_msg_buf->break_msg.length = 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE } */ -/* OBSOLETE /********************************************************** REMOTE_DETACH */ */ -/* OBSOLETE /* Terminate the open connection to the remote debugger. */ -/* OBSOLETE Use this when you want to detach and do something else */ -/* OBSOLETE with your gdb. Leave remote process running (with no breakpoints set). */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_detach (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE remove_breakpoints (); /* Just in case there were any left in */ */ -/* OBSOLETE out_msg_buf->go_msg.code = GO; */ -/* OBSOLETE out_msg_buf->go_msg.length = 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE pop_target (); /* calls mm_close to do the real work */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /*************************************************************** REMOTE_RESUME */ -/* OBSOLETE ** Tell the remote machine to resume. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE mm_resume (ptid_t ptid, int step, enum target_signal sig) */ -/* OBSOLETE { */ -/* OBSOLETE if (sig != TARGET_SIGNAL_0) */ -/* OBSOLETE warning ("Can't send signals to a remote MiniMon system."); */ -/* OBSOLETE */ -/* OBSOLETE if (step) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->step_msg.code = STEP; */ -/* OBSOLETE out_msg_buf->step_msg.length = 1 * 4; */ -/* OBSOLETE out_msg_buf->step_msg.count = 1; /* step 1 instruction */ */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->go_msg.code = GO; */ -/* OBSOLETE out_msg_buf->go_msg.length = 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /***************************************************************** REMOTE_WAIT */ -/* OBSOLETE ** Wait until the remote machine stops, then return, */ -/* OBSOLETE storing status in STATUS just as `wait' would. */ */ -/* OBSOLETE */ -/* OBSOLETE static ptid_t */ -/* OBSOLETE mm_wait (ptid_t ptid, struct target_waitstatus *status) */ -/* OBSOLETE { */ -/* OBSOLETE int i, result; */ -/* OBSOLETE int old_timeout = timeout; */ -/* OBSOLETE int old_immediate_quit = immediate_quit; */ -/* OBSOLETE */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* wait for message to arrive. It should be: */ -/* OBSOLETE - A HIF service request. */ -/* OBSOLETE - A HIF exit service request. */ -/* OBSOLETE - A CHANNEL0_ACK. */ -/* OBSOLETE - A CHANNEL1 request. */ -/* OBSOLETE - a debugcore HALT message. */ -/* OBSOLETE HIF services must be responded too, and while-looping continued. */ -/* OBSOLETE If the target stops executing, mm_wait() should return. */ -/* OBSOLETE */ */ -/* OBSOLETE timeout = 0; /* Wait indefinetly for a message */ */ -/* OBSOLETE immediate_quit = 1; /* Helps ability to QUIT */ */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE while (msg_recv_serial (in_msg_buf)) */ -/* OBSOLETE { */ -/* OBSOLETE QUIT; /* Let user quit if they want */ */ -/* OBSOLETE } */ -/* OBSOLETE switch (in_msg_buf->halt_msg.code) */ -/* OBSOLETE { */ -/* OBSOLETE case HIF_CALL: */ -/* OBSOLETE i = in_msg_buf->hif_call_rtn_msg.service_number; */ -/* OBSOLETE result = service_HIF (in_msg_buf); */ -/* OBSOLETE if (i == 1) /* EXIT */ */ -/* OBSOLETE goto exit; */ -/* OBSOLETE if (result) */ -/* OBSOLETE printf ("Warning: failure during HIF service %d\n", i); */ -/* OBSOLETE break; */ -/* OBSOLETE case CHANNEL0_ACK: */ -/* OBSOLETE service_HIF (in_msg_buf); */ -/* OBSOLETE break; */ -/* OBSOLETE case CHANNEL1: */ -/* OBSOLETE i = in_msg_buf->channel1_msg.length; */ -/* OBSOLETE in_msg_buf->channel1_msg.data[i] = '\0'; */ -/* OBSOLETE printf ("%s", in_msg_buf->channel1_msg.data); */ -/* OBSOLETE gdb_flush (gdb_stdout); */ -/* OBSOLETE /* Send CHANNEL1_ACK message */ */ -/* OBSOLETE out_msg_buf->channel1_ack_msg.code = CHANNEL1_ACK; */ -/* OBSOLETE out_msg_buf->channel1_ack_msg.length = 0; */ -/* OBSOLETE result = msg_send_serial (out_msg_buf); */ -/* OBSOLETE break; */ -/* OBSOLETE case HALT: */ -/* OBSOLETE goto halted; */ -/* OBSOLETE default: */ -/* OBSOLETE goto halted; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE halted: */ -/* OBSOLETE /* FIXME, these printfs should not be here. This is a source level */ -/* OBSOLETE debugger, guys! */ */ -/* OBSOLETE if (in_msg_buf->halt_msg.trap_number == 0) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d (break point)\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 1) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_BUS; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 3 */ -/* OBSOLETE || in_msg_buf->halt_msg.trap_number == 4) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_FPE; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 5) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number >= 6 */ -/* OBSOLETE && in_msg_buf->halt_msg.trap_number <= 11) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_SEGV; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 12 */ -/* OBSOLETE || in_msg_buf->halt_msg.trap_number == 13) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 14) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ALRM; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 15) */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number >= 16 */ -/* OBSOLETE && in_msg_buf->halt_msg.trap_number <= 21) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_INT; */ -/* OBSOLETE } */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 22) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Am290*0 received vector number %d\n", */ -/* OBSOLETE in_msg_buf->halt_msg.trap_number); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */ -/* OBSOLETE } /* BREAK message was sent */ */ -/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 75) */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE exit: */ -/* OBSOLETE { */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE timeout = old_timeout; /* Restore original timeout value */ */ -/* OBSOLETE immediate_quit = old_immediate_quit; */ -/* OBSOLETE return inferior_ptid; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************* REMOTE_FETCH_REGISTERS */ -/* OBSOLETE * Read a remote register 'regno'. */ -/* OBSOLETE * If regno==-1 then read all the registers. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_fetch_registers (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE INT32 *data_p; */ -/* OBSOLETE */ -/* OBSOLETE if (regno >= 0) */ -/* OBSOLETE { */ -/* OBSOLETE fetch_register (regno); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Gr1/rsp */ */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 1; */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = 1; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */ -/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */ -/* OBSOLETE supply_register (GR1_REGNUM, data_p); */ -/* OBSOLETE */ -/* OBSOLETE #if defined(GR64_REGNUM) /* Read gr64-127 */ */ -/* OBSOLETE /* Global Registers gr64-gr95 */ */ -/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */ -/* OBSOLETE out_msg_buf->read_req_msg.length = 4 * 3; */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 32; */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = 64; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */ -/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */ -/* OBSOLETE */ -/* OBSOLETE for (regno = GR64_REGNUM; regno < GR64_REGNUM + 32; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE supply_register (regno, data_p++); */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE */ -/* OBSOLETE /* Global Registers gr96-gr127 */ */ -/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */ -/* OBSOLETE out_msg_buf->read_req_msg.length = 4 * 3; */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 32; */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = 96; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */ -/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */ -/* OBSOLETE */ -/* OBSOLETE for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE supply_register (regno, data_p++); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Local Registers */ */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * (128); */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = LOCAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */ -/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */ -/* OBSOLETE */ -/* OBSOLETE for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE supply_register (regno, data_p++); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Protected Special Registers */ */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 15; */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = SPECIAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = 0; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */ -/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */ -/* OBSOLETE */ -/* OBSOLETE for (regno = 0; regno <= 14; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE supply_register (SR_REGNUM (regno), data_p++); */ -/* OBSOLETE } */ -/* OBSOLETE if (USE_SHADOW_PC) */ -/* OBSOLETE { /* Let regno_to_srnum() handle the register number */ */ -/* OBSOLETE fetch_register (NPC_REGNUM); */ -/* OBSOLETE fetch_register (PC_REGNUM); */ -/* OBSOLETE fetch_register (PC2_REGNUM); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Unprotected Special Registers */ */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 8; */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = SPECIAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = 128; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */ -/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */ -/* OBSOLETE */ -/* OBSOLETE for (regno = 128; regno <= 135; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE supply_register (SR_REGNUM (regno), data_p++); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* There doesn't seem to be any way to get these. */ */ -/* OBSOLETE { */ -/* OBSOLETE int val = -1; */ -/* OBSOLETE supply_register (FPE_REGNUM, &val); */ -/* OBSOLETE supply_register (INTE_REGNUM, &val); */ -/* OBSOLETE supply_register (FPS_REGNUM, &val); */ -/* OBSOLETE supply_register (EXO_REGNUM, &val); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /****************************************************** REMOTE_STORE_REGISTERS */ -/* OBSOLETE * Store register regno into the target. */ -/* OBSOLETE * If regno==-1 then store all the registers. */ -/* OBSOLETE * Result is 0 for success, -1 for failure. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE mm_store_registers (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE int result; */ -/* OBSOLETE */ -/* OBSOLETE if (regno >= 0) */ -/* OBSOLETE { */ -/* OBSOLETE store_register (regno); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE result = 0; */ -/* OBSOLETE */ -/* OBSOLETE out_msg_buf->write_r_msg.code = WRITE_REQ; */ -/* OBSOLETE */ -/* OBSOLETE /* Gr1/rsp */ */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 1; */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE out_msg_buf->write_r_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 1; */ -/* OBSOLETE out_msg_buf->write_r_msg.data[0] = read_register (GR1_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE /* Global registers gr64-gr95 */ */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * (32); */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 64; */ -/* OBSOLETE */ -/* OBSOLETE for (regno = GR64_REGNUM; regno < GR64_REGNUM + 32; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_r_msg.data[regno - GR64_REGNUM] = read_register (regno); */ -/* OBSOLETE } */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE */ -/* OBSOLETE /* Global registers gr96-gr127 */ */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * (32); */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 96; */ -/* OBSOLETE for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_r_msg.data[regno - GR96_REGNUM] = read_register (regno); */ -/* OBSOLETE } */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Local Registers */ */ -/* OBSOLETE out_msg_buf->write_r_msg.memory_space = LOCAL_REG; */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 128; */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 0; */ -/* OBSOLETE */ -/* OBSOLETE for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_r_msg.data[regno - LR0_REGNUM] = read_register (regno); */ -/* OBSOLETE } */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Protected Special Registers */ */ -/* OBSOLETE /* VAB through TMR */ */ -/* OBSOLETE out_msg_buf->write_r_msg.memory_space = SPECIAL_REG; */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 10; */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 0; */ -/* OBSOLETE for (regno = 0; regno <= 9; regno++) /* VAB through TMR */ */ -/* OBSOLETE out_msg_buf->write_r_msg.data[regno] = read_register (SR_REGNUM (regno)); */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* PC0, PC1, PC2 possibly as shadow registers */ */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 3; */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE for (regno = 10; regno <= 12; regno++) /* LRU and MMU */ */ -/* OBSOLETE out_msg_buf->write_r_msg.data[regno - 10] = read_register (SR_REGNUM (regno)); */ -/* OBSOLETE if (USE_SHADOW_PC) */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 20; /* SPC0 */ */ -/* OBSOLETE else */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 10; /* PC0 */ */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* LRU and MMU */ */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 2; */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 13; */ -/* OBSOLETE for (regno = 13; regno <= 14; regno++) /* LRU and MMU */ */ -/* OBSOLETE out_msg_buf->write_r_msg.data[regno - 13] = read_register (SR_REGNUM (regno)); */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Unprotected Special Registers */ */ -/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 8; */ -/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */ -/* OBSOLETE out_msg_buf->write_r_msg.address = 128; */ -/* OBSOLETE for (regno = 128; regno <= 135; regno++) */ -/* OBSOLETE out_msg_buf->write_r_msg.data[regno - 128] = read_register (SR_REGNUM (regno)); */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE registers_changed (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /*************************************************** REMOTE_PREPARE_TO_STORE */ */ -/* OBSOLETE /* Get ready to modify the registers array. On machines which store */ -/* OBSOLETE individual registers, this doesn't need to do anything. On machines */ -/* OBSOLETE which store all the registers in one fell swoop, this makes sure */ -/* OBSOLETE that registers contains all the registers from the program being */ -/* OBSOLETE debugged. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE mm_prepare_to_store (void) */ -/* OBSOLETE { */ -/* OBSOLETE /* Do nothing, since we can store individual regs */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************* REMOTE_XFER_MEMORY */ */ -/* OBSOLETE static CORE_ADDR */ -/* OBSOLETE translate_addr (CORE_ADDR addr) */ -/* OBSOLETE { */ -/* OBSOLETE #if defined(KERNEL_DEBUGGING) */ -/* OBSOLETE /* Check for a virtual address in the kernel */ */ -/* OBSOLETE /* Assume physical address of ublock is in paddr_u register */ */ -/* OBSOLETE /* FIXME: doesn't work for user virtual addresses */ */ -/* OBSOLETE if (addr >= UVADDR) */ -/* OBSOLETE { */ -/* OBSOLETE /* PADDR_U register holds the physical address of the ublock */ */ -/* OBSOLETE CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM); */ -/* OBSOLETE return (i + addr - (CORE_ADDR) UVADDR); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE return (addr); */ -/* OBSOLETE } */ -/* OBSOLETE #else */ -/* OBSOLETE return (addr); */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************* REMOTE_FILES_INFO */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_files_info (void) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("\tAttached to %s at %d baud and running program %s.\n", */ -/* OBSOLETE dev_name, baudrate, prog_name); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /************************************************* REMOTE_INSERT_BREAKPOINT */ */ -/* OBSOLETE static int */ -/* OBSOLETE mm_insert_breakpoint (CORE_ADDR addr, char *contents_cache) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.code = BKPT_SET; */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.length = 4 * 4; */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.memory_space = I_MEM; */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.bkpt_addr = (ADDR32) addr; */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.pass_count = 1; */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.bkpt_type = -1; /* use illop for 29000 */ */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (expect_msg (BKPT_SET_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE return 0; /* Success */ */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE return 1; /* Failure */ */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /************************************************* REMOTE_DELETE_BREAKPOINT */ */ -/* OBSOLETE static int */ -/* OBSOLETE mm_remove_breakpoint (CORE_ADDR addr, char *contents_cache) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->bkpt_rm_msg.code = BKPT_RM; */ -/* OBSOLETE out_msg_buf->bkpt_rm_msg.length = 4 * 3; */ -/* OBSOLETE out_msg_buf->bkpt_rm_msg.memory_space = I_MEM; */ -/* OBSOLETE out_msg_buf->bkpt_rm_msg.bkpt_addr = (ADDR32) addr; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE if (expect_msg (BKPT_RM_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE return 0; /* Success */ */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE return 1; /* Failure */ */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************* REMOTE_KILL */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_kill (char *arg, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE char buf[4]; */ -/* OBSOLETE */ -/* OBSOLETE #if defined(KERNEL_DEBUGGING) */ -/* OBSOLETE /* We don't ever kill the kernel */ */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Kernel not killed, but left in current state.\n"); */ -/* OBSOLETE printf ("Use detach to leave kernel running.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE #else */ -/* OBSOLETE out_msg_buf->break_msg.code = BREAK; */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.length = 4 * 0; */ -/* OBSOLETE expect_msg (HALT, in_msg_buf, from_tty); */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Target has been stopped."); */ -/* OBSOLETE printf ("Would you like to do a hardware reset (y/n) [n] "); */ -/* OBSOLETE fgets (buf, 3, stdin); */ -/* OBSOLETE if (buf[0] == 'y') */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->reset_msg.code = RESET; */ -/* OBSOLETE out_msg_buf->bkpt_set_msg.length = 4 * 0; */ -/* OBSOLETE expect_msg (RESET_ACK, in_msg_buf, from_tty); */ -/* OBSOLETE printf ("Target has been reset."); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE pop_target (); */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /***************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Load a program into the target. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE mm_load (char *arg_string, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE dont_repeat (); */ -/* OBSOLETE */ -/* OBSOLETE #if defined(KERNEL_DEBUGGING) */ -/* OBSOLETE printf ("The kernel had better be loaded already! Loading not done.\n"); */ -/* OBSOLETE #else */ -/* OBSOLETE if (arg_string == 0) */ -/* OBSOLETE error ("The load command takes a file name"); */ -/* OBSOLETE */ -/* OBSOLETE arg_string = tilde_expand (arg_string); */ -/* OBSOLETE make_cleanup (xfree, arg_string); */ -/* OBSOLETE QUIT; */ -/* OBSOLETE immediate_quit++; */ -/* OBSOLETE error ("File loading is not yet supported for MiniMon."); */ -/* OBSOLETE /* FIXME, code to load your file here... */ */ -/* OBSOLETE /* You may need to do an init_target_mm() */ */ -/* OBSOLETE /* init_target_mm(?,?,?,?,?,?,?,?); */ */ -/* OBSOLETE immediate_quit--; */ -/* OBSOLETE /* symbol_file_add (arg_string, from_tty, text_addr, 0, 0); */ */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /************************************************ REMOTE_WRITE_INFERIOR_MEMORY */ -/* OBSOLETE ** Copy LEN bytes of data from debugger memory at MYADDR */ -/* OBSOLETE to inferior's memory at MEMADDR. Returns number of bytes written. */ */ -/* OBSOLETE static int */ -/* OBSOLETE mm_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int i, nwritten; */ -/* OBSOLETE */ -/* OBSOLETE out_msg_buf->write_req_msg.code = WRITE_REQ; */ -/* OBSOLETE out_msg_buf->write_req_msg.memory_space = mm_memory_space (memaddr); */ -/* OBSOLETE */ -/* OBSOLETE nwritten = 0; */ -/* OBSOLETE while (nwritten < len) */ -/* OBSOLETE { */ -/* OBSOLETE int num_to_write = len - nwritten; */ -/* OBSOLETE if (num_to_write > MAXDATA) */ -/* OBSOLETE num_to_write = MAXDATA; */ -/* OBSOLETE for (i = 0; i < num_to_write; i++) */ -/* OBSOLETE out_msg_buf->write_req_msg.data[i] = myaddr[i + nwritten]; */ -/* OBSOLETE out_msg_buf->write_req_msg.byte_count = num_to_write; */ -/* OBSOLETE out_msg_buf->write_req_msg.length = 3 * 4 + num_to_write; */ -/* OBSOLETE out_msg_buf->write_req_msg.address = memaddr + nwritten; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE */ -/* OBSOLETE if (expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE nwritten += in_msg_buf->write_ack_msg.byte_count; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE return (nwritten); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /************************************************* REMOTE_READ_INFERIOR_MEMORY */ -/* OBSOLETE ** Read LEN bytes from inferior memory at MEMADDR. Put the result */ -/* OBSOLETE at debugger address MYADDR. Returns number of bytes read. */ */ -/* OBSOLETE static int */ -/* OBSOLETE mm_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int i, nread; */ -/* OBSOLETE */ -/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = mm_memory_space (memaddr); */ -/* OBSOLETE */ -/* OBSOLETE nread = 0; */ -/* OBSOLETE while (nread < len) */ -/* OBSOLETE { */ -/* OBSOLETE int num_to_read = (len - nread); */ -/* OBSOLETE if (num_to_read > MAXDATA) */ -/* OBSOLETE num_to_read = MAXDATA; */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = num_to_read; */ -/* OBSOLETE out_msg_buf->read_req_msg.length = 3 * 4 + num_to_read; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = memaddr + nread; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE */ -/* OBSOLETE if (expect_msg (READ_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE for (i = 0; i < in_msg_buf->read_ack_msg.byte_count; i++) */ -/* OBSOLETE myaddr[i + nread] = in_msg_buf->read_ack_msg.data[i]; */ -/* OBSOLETE nread += in_msg_buf->read_ack_msg.byte_count; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE return (nread); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME! Merge these two. */ */ -/* OBSOLETE static int */ -/* OBSOLETE mm_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */ -/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */ -/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE memaddr = translate_addr (memaddr); */ -/* OBSOLETE */ -/* OBSOLETE if (write) */ -/* OBSOLETE return mm_write_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE else */ -/* OBSOLETE return mm_read_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************** MSG_SEND_SERIAL */ -/* OBSOLETE ** This function is used to send a message over the */ -/* OBSOLETE ** serial line. */ -/* OBSOLETE ** */ -/* OBSOLETE ** If the message is successfully sent, a zero is */ -/* OBSOLETE ** returned. If the message was not sendable, a -1 */ -/* OBSOLETE ** is returned. This function blocks. That is, it */ -/* OBSOLETE ** does not return until the message is completely */ -/* OBSOLETE ** sent, or until an error is encountered. */ -/* OBSOLETE ** */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE msg_send_serial (union msg_t *msg_ptr) */ -/* OBSOLETE { */ -/* OBSOLETE INT32 message_size; */ -/* OBSOLETE int byte_count; */ -/* OBSOLETE int result; */ -/* OBSOLETE char c; */ -/* OBSOLETE */ -/* OBSOLETE /* Send message header */ */ -/* OBSOLETE byte_count = 0; */ -/* OBSOLETE message_size = msg_ptr->generic_msg.length + (2 * sizeof (INT32)); */ -/* OBSOLETE do */ -/* OBSOLETE { */ -/* OBSOLETE c = *((char *) msg_ptr + byte_count); */ -/* OBSOLETE result = write (mm_desc, &c, 1); */ -/* OBSOLETE if (result == 1) */ -/* OBSOLETE { */ -/* OBSOLETE byte_count = byte_count + 1; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE while ((byte_count < message_size)); */ -/* OBSOLETE */ -/* OBSOLETE return (0); */ -/* OBSOLETE } /* end msg_send_serial() */ */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************** MSG_RECV_SERIAL */ -/* OBSOLETE ** This function is used to receive a message over a */ -/* OBSOLETE ** serial line. */ -/* OBSOLETE ** */ -/* OBSOLETE ** If the message is waiting in the buffer, a zero is */ -/* OBSOLETE ** returned and the buffer pointed to by msg_ptr is filled */ -/* OBSOLETE ** in. If no message was available, a -1 is returned. */ -/* OBSOLETE ** If timeout==0, wait indefinetly for a character. */ -/* OBSOLETE ** */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE msg_recv_serial (union msg_t *msg_ptr) */ -/* OBSOLETE { */ -/* OBSOLETE static INT32 length = 0; */ -/* OBSOLETE static INT32 byte_count = 0; */ -/* OBSOLETE int result; */ -/* OBSOLETE char c; */ -/* OBSOLETE if (msg_ptr == 0) /* re-sync request */ */ -/* OBSOLETE { */ -/* OBSOLETE length = 0; */ -/* OBSOLETE byte_count = 0; */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE /* The timeout here is the prevailing timeout set with VTIME */ */ -/* OBSOLETE ->"timeout==0 semantics not supported" */ -/* OBSOLETE read (mm_desc, in_buf, BUFER_SIZE); */ -/* OBSOLETE #else */ -/* OBSOLETE alarm (1); */ -/* OBSOLETE read (mm_desc, in_buf, BUFER_SIZE); */ -/* OBSOLETE alarm (0); */ -/* OBSOLETE #endif */ -/* OBSOLETE return (0); */ -/* OBSOLETE } */ -/* OBSOLETE /* Receive message */ */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE /* Timeout==0, help support the mm_wait() routine */ */ -/* OBSOLETE ->"timeout==0 semantics not supported (and its nice if they are)" */ -/* OBSOLETE result = read (mm_desc, &c, 1); */ -/* OBSOLETE #else */ -/* OBSOLETE alarm (timeout); */ -/* OBSOLETE result = read (mm_desc, &c, 1); */ -/* OBSOLETE alarm (0); */ -/* OBSOLETE #endif */ -/* OBSOLETE if (result < 0) */ -/* OBSOLETE { */ -/* OBSOLETE if (errno == EINTR) */ -/* OBSOLETE { */ -/* OBSOLETE error ("Timeout reading from remote system."); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE perror_with_name ("remote"); */ -/* OBSOLETE } */ -/* OBSOLETE else if (result == 1) */ -/* OBSOLETE { */ -/* OBSOLETE *((char *) msg_ptr + byte_count) = c; */ -/* OBSOLETE byte_count = byte_count + 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Message header received. Save message length. */ */ -/* OBSOLETE if (byte_count == (2 * sizeof (INT32))) */ -/* OBSOLETE length = msg_ptr->generic_msg.length; */ -/* OBSOLETE */ -/* OBSOLETE if (byte_count >= (length + (2 * sizeof (INT32)))) */ -/* OBSOLETE { */ -/* OBSOLETE /* Message received */ */ -/* OBSOLETE byte_count = 0; */ -/* OBSOLETE return (0); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE return (-1); */ -/* OBSOLETE */ -/* OBSOLETE } /* end msg_recv_serial() */ */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************************* KBD_RAW */ -/* OBSOLETE ** This function is used to put the keyboard in "raw" */ -/* OBSOLETE ** mode for BSD Unix. The original status is saved */ -/* OBSOLETE ** so that it may be restored later. */ -/* OBSOLETE */ */ -/* OBSOLETE TERMINAL kbd_tbuf; */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE kbd_raw (void) */ -/* OBSOLETE { */ -/* OBSOLETE int result; */ -/* OBSOLETE TERMINAL tbuf; */ -/* OBSOLETE */ -/* OBSOLETE /* Get keyboard termio (to save to restore original modes) */ */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE result = ioctl (0, TCGETA, &kbd_tbuf); */ -/* OBSOLETE #else */ -/* OBSOLETE result = ioctl (0, TIOCGETP, &kbd_tbuf); */ -/* OBSOLETE #endif */ -/* OBSOLETE if (result == -1) */ -/* OBSOLETE return (errno); */ -/* OBSOLETE */ -/* OBSOLETE /* Get keyboard TERMINAL (for modification) */ */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE result = ioctl (0, TCGETA, &tbuf); */ -/* OBSOLETE #else */ -/* OBSOLETE result = ioctl (0, TIOCGETP, &tbuf); */ -/* OBSOLETE #endif */ -/* OBSOLETE if (result == -1) */ -/* OBSOLETE return (errno); */ -/* OBSOLETE */ -/* OBSOLETE /* Set up new parameters */ */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE tbuf.c_iflag = tbuf.c_iflag & */ -/* OBSOLETE ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON | BRKINT); */ -/* OBSOLETE tbuf.c_lflag = tbuf.c_lflag & ~(ICANON | ISIG | ECHO); */ -/* OBSOLETE tbuf.c_cc[4] = 0; /* MIN */ */ -/* OBSOLETE tbuf.c_cc[5] = 0; /* TIME */ */ -/* OBSOLETE #else */ -/* OBSOLETE /* FIXME: not sure if this is correct (matches HAVE_TERMIO). */ */ -/* OBSOLETE tbuf.sg_flags |= RAW; */ -/* OBSOLETE tbuf.sg_flags |= ANYP; */ -/* OBSOLETE tbuf.sg_flags &= ~ECHO; */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Set keyboard termio to new mode (RAW) */ */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE result = ioctl (0, TCSETAF, &tbuf); */ -/* OBSOLETE #else */ -/* OBSOLETE result = ioctl (0, TIOCSETP, &tbuf); */ -/* OBSOLETE #endif */ -/* OBSOLETE if (result == -1) */ -/* OBSOLETE return (errno); */ -/* OBSOLETE */ -/* OBSOLETE return (0); */ -/* OBSOLETE } /* end kbd_raw() */ */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /***************************************************************** KBD_RESTORE */ -/* OBSOLETE ** This function is used to put the keyboard back in the */ -/* OBSOLETE ** mode it was in before kbk_raw was called. Note that */ -/* OBSOLETE ** kbk_raw() must have been called at least once before */ -/* OBSOLETE ** kbd_restore() is called. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE kbd_restore (void) */ -/* OBSOLETE { */ -/* OBSOLETE int result; */ -/* OBSOLETE */ -/* OBSOLETE /* Set keyboard termio to original mode */ */ -/* OBSOLETE #ifdef HAVE_TERMIO */ -/* OBSOLETE result = ioctl (0, TCSETAF, &kbd_tbuf); */ -/* OBSOLETE #else */ -/* OBSOLETE result = ioctl (0, TIOCGETP, &kbd_tbuf); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE if (result == -1) */ -/* OBSOLETE return (errno); */ -/* OBSOLETE */ -/* OBSOLETE return (0); */ -/* OBSOLETE } /* end kbd_cooked() */ */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /*****************************************************************************/ */ -/* OBSOLETE /* Fetch a single register indicatated by 'regno'. */ -/* OBSOLETE * Returns 0/-1 on success/failure. */ -/* OBSOLETE */ */ -/* OBSOLETE static int */ -/* OBSOLETE fetch_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE int result; */ -/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */ -/* OBSOLETE out_msg_buf->read_req_msg.length = 4 * 3; */ -/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4; */ -/* OBSOLETE */ -/* OBSOLETE if (regno == GR1_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = 1; */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = (regno - GR96_REGNUM) + 96; */ -/* OBSOLETE } */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = (regno - GR64_REGNUM) + 64; */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = LOCAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = (regno - LR0_REGNUM); */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE int val = -1; */ -/* OBSOLETE supply_register (160 + (regno - FPE_REGNUM), &val); */ -/* OBSOLETE return 0; /* Pretend Success */ */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->read_req_msg.memory_space = SPECIAL_REG; */ -/* OBSOLETE out_msg_buf->read_req_msg.address = regnum_to_srnum (regno); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE */ -/* OBSOLETE if (expect_msg (READ_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE supply_register (regno, &(in_msg_buf->read_r_ack_msg.data[0])); */ -/* OBSOLETE result = 0; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE return result; */ -/* OBSOLETE } */ -/* OBSOLETE /*****************************************************************************/ */ -/* OBSOLETE /* Store a single register indicated by 'regno'. */ -/* OBSOLETE * Returns 0/-1 on success/failure. */ -/* OBSOLETE */ */ -/* OBSOLETE static int */ -/* OBSOLETE store_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE int result; */ -/* OBSOLETE */ -/* OBSOLETE out_msg_buf->write_req_msg.code = WRITE_REQ; */ -/* OBSOLETE out_msg_buf->write_req_msg.length = 4 * 4; */ -/* OBSOLETE out_msg_buf->write_req_msg.byte_count = 4; */ -/* OBSOLETE out_msg_buf->write_r_msg.data[0] = read_register (regno); */ -/* OBSOLETE */ -/* OBSOLETE if (regno == GR1_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->write_req_msg.address = 1; */ -/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so invalidate the */ -/* OBSOLETE * register cache. Do this *after* calling read_register, because we want */ -/* OBSOLETE * read_register to return the value that write_register has just stuffed */ -/* OBSOLETE * into the registers array, not the value of the register fetched from */ -/* OBSOLETE * the inferior. */ -/* OBSOLETE */ */ -/* OBSOLETE registers_changed (); */ -/* OBSOLETE } */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->write_req_msg.address = (regno - GR64_REGNUM) + 64; */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_req_msg.memory_space = GLOBAL_REG; */ -/* OBSOLETE out_msg_buf->write_req_msg.address = (regno - GR96_REGNUM) + 96; */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_req_msg.memory_space = LOCAL_REG; */ -/* OBSOLETE out_msg_buf->write_req_msg.address = (regno - LR0_REGNUM); */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE return 0; /* Pretend Success */ */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE /* An unprotected or protected special register */ */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->write_req_msg.memory_space = SPECIAL_REG; */ -/* OBSOLETE out_msg_buf->write_req_msg.address = regnum_to_srnum (regno); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE */ -/* OBSOLETE if (expect_msg (WRITE_ACK, in_msg_buf, 1)) */ -/* OBSOLETE { */ -/* OBSOLETE result = 0; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE result = -1; */ -/* OBSOLETE } */ -/* OBSOLETE return result; */ -/* OBSOLETE } */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Convert a gdb special register number to a 29000 special register number. */ -/* OBSOLETE */ */ -/* OBSOLETE static int */ -/* OBSOLETE regnum_to_srnum (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE switch (regno) */ -/* OBSOLETE { */ -/* OBSOLETE case VAB_REGNUM: */ -/* OBSOLETE return (0); */ -/* OBSOLETE case OPS_REGNUM: */ -/* OBSOLETE return (1); */ -/* OBSOLETE case CPS_REGNUM: */ -/* OBSOLETE return (2); */ -/* OBSOLETE case CFG_REGNUM: */ -/* OBSOLETE return (3); */ -/* OBSOLETE case CHA_REGNUM: */ -/* OBSOLETE return (4); */ -/* OBSOLETE case CHD_REGNUM: */ -/* OBSOLETE return (5); */ -/* OBSOLETE case CHC_REGNUM: */ -/* OBSOLETE return (6); */ -/* OBSOLETE case RBP_REGNUM: */ -/* OBSOLETE return (7); */ -/* OBSOLETE case TMC_REGNUM: */ -/* OBSOLETE return (8); */ -/* OBSOLETE case TMR_REGNUM: */ -/* OBSOLETE return (9); */ -/* OBSOLETE case NPC_REGNUM: */ -/* OBSOLETE return (USE_SHADOW_PC ? (20) : (10)); */ -/* OBSOLETE case PC_REGNUM: */ -/* OBSOLETE return (USE_SHADOW_PC ? (21) : (11)); */ -/* OBSOLETE case PC2_REGNUM: */ -/* OBSOLETE return (USE_SHADOW_PC ? (22) : (12)); */ -/* OBSOLETE case MMU_REGNUM: */ -/* OBSOLETE return (13); */ -/* OBSOLETE case LRU_REGNUM: */ -/* OBSOLETE return (14); */ -/* OBSOLETE case IPC_REGNUM: */ -/* OBSOLETE return (128); */ -/* OBSOLETE case IPA_REGNUM: */ -/* OBSOLETE return (129); */ -/* OBSOLETE case IPB_REGNUM: */ -/* OBSOLETE return (130); */ -/* OBSOLETE case Q_REGNUM: */ -/* OBSOLETE return (131); */ -/* OBSOLETE case ALU_REGNUM: */ -/* OBSOLETE return (132); */ -/* OBSOLETE case BP_REGNUM: */ -/* OBSOLETE return (133); */ -/* OBSOLETE case FC_REGNUM: */ -/* OBSOLETE return (134); */ -/* OBSOLETE case CR_REGNUM: */ -/* OBSOLETE return (135); */ -/* OBSOLETE case FPE_REGNUM: */ -/* OBSOLETE return (160); */ -/* OBSOLETE case INTE_REGNUM: */ -/* OBSOLETE return (161); */ -/* OBSOLETE case FPS_REGNUM: */ -/* OBSOLETE return (162); */ -/* OBSOLETE case EXO_REGNUM: */ -/* OBSOLETE return (164); */ -/* OBSOLETE default: */ -/* OBSOLETE return (255); /* Failure ? */ */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Initialize the target debugger (minimon only). */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE init_target_mm (ADDR32 tstart, ADDR32 tend, ADDR32 dstart, ADDR32 dend, */ -/* OBSOLETE ADDR32 entry, INT32 ms_size, INT32 rs_size, ADDR32 arg_start) */ -/* OBSOLETE { */ -/* OBSOLETE out_msg_buf->init_msg.code = INIT; */ -/* OBSOLETE out_msg_buf->init_msg.length = sizeof (struct init_msg_t) - 2 * sizeof (INT32); */ -/* OBSOLETE out_msg_buf->init_msg.text_start = tstart; */ -/* OBSOLETE out_msg_buf->init_msg.text_end = tend; */ -/* OBSOLETE out_msg_buf->init_msg.data_start = dstart; */ -/* OBSOLETE out_msg_buf->init_msg.data_end = dend; */ -/* OBSOLETE out_msg_buf->init_msg.entry_point = entry; */ -/* OBSOLETE out_msg_buf->init_msg.mem_stack_size = ms_size; */ -/* OBSOLETE out_msg_buf->init_msg.reg_stack_size = rs_size; */ -/* OBSOLETE out_msg_buf->init_msg.arg_start = arg_start; */ -/* OBSOLETE msg_send_serial (out_msg_buf); */ -/* OBSOLETE expect_msg (INIT_ACK, in_msg_buf, 1); */ -/* OBSOLETE } */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Return a pointer to a string representing the given message code. */ -/* OBSOLETE * Not all messages are represented here, only the ones that we expect */ -/* OBSOLETE * to be called with. */ -/* OBSOLETE */ */ -/* OBSOLETE static char * */ -/* OBSOLETE msg_str (INT32 code) */ -/* OBSOLETE { */ -/* OBSOLETE static char cbuf[32]; */ -/* OBSOLETE */ -/* OBSOLETE switch (code) */ -/* OBSOLETE { */ -/* OBSOLETE case BKPT_SET_ACK: */ -/* OBSOLETE sprintf (cbuf, "%s (%d)", "BKPT_SET_ACK", code); */ -/* OBSOLETE break; */ -/* OBSOLETE case BKPT_RM_ACK: */ -/* OBSOLETE sprintf (cbuf, "%s (%d)", "BKPT_RM_ACK", code); */ -/* OBSOLETE break; */ -/* OBSOLETE case INIT_ACK: */ -/* OBSOLETE sprintf (cbuf, "%s (%d)", "INIT_ACK", code); */ -/* OBSOLETE break; */ -/* OBSOLETE case READ_ACK: */ -/* OBSOLETE sprintf (cbuf, "%s (%d)", "READ_ACK", code); */ -/* OBSOLETE break; */ -/* OBSOLETE case WRITE_ACK: */ -/* OBSOLETE sprintf (cbuf, "%s (%d)", "WRITE_ACK", code); */ -/* OBSOLETE break; */ -/* OBSOLETE case ERROR: */ -/* OBSOLETE sprintf (cbuf, "%s (%d)", "ERROR", code); */ -/* OBSOLETE break; */ -/* OBSOLETE case HALT: */ -/* OBSOLETE sprintf (cbuf, "%s (%d)", "HALT", code); */ -/* OBSOLETE break; */ -/* OBSOLETE default: */ -/* OBSOLETE sprintf (cbuf, "UNKNOWN (%d)", code); */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE return (cbuf); */ -/* OBSOLETE } */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Selected (not all of them) error codes that we might get. */ -/* OBSOLETE */ */ -/* OBSOLETE static char * */ -/* OBSOLETE error_msg_str (INT32 code) */ -/* OBSOLETE { */ -/* OBSOLETE static char cbuf[50]; */ -/* OBSOLETE */ -/* OBSOLETE switch (code) */ -/* OBSOLETE { */ -/* OBSOLETE case EMFAIL: */ -/* OBSOLETE return ("EMFAIL: unrecoverable error"); */ -/* OBSOLETE case EMBADADDR: */ -/* OBSOLETE return ("EMBADADDR: Illegal address"); */ -/* OBSOLETE case EMBADREG: */ -/* OBSOLETE return ("EMBADREG: Illegal register "); */ -/* OBSOLETE case EMACCESS: */ -/* OBSOLETE return ("EMACCESS: Could not access memory"); */ -/* OBSOLETE case EMBADMSG: */ -/* OBSOLETE return ("EMBADMSG: Unknown message type"); */ -/* OBSOLETE case EMMSG2BIG: */ -/* OBSOLETE return ("EMMSG2BIG: Message to large"); */ -/* OBSOLETE case EMNOSEND: */ -/* OBSOLETE return ("EMNOSEND: Could not send message"); */ -/* OBSOLETE case EMNORECV: */ -/* OBSOLETE return ("EMNORECV: Could not recv message"); */ -/* OBSOLETE case EMRESET: */ -/* OBSOLETE return ("EMRESET: Could not RESET target"); */ -/* OBSOLETE case EMCONFIG: */ -/* OBSOLETE return ("EMCONFIG: Could not get target CONFIG"); */ -/* OBSOLETE case EMSTATUS: */ -/* OBSOLETE return ("EMSTATUS: Could not get target STATUS"); */ -/* OBSOLETE case EMREAD: */ -/* OBSOLETE return ("EMREAD: Could not READ target memory"); */ -/* OBSOLETE case EMWRITE: */ -/* OBSOLETE return ("EMWRITE: Could not WRITE target memory"); */ -/* OBSOLETE case EMBKPTSET: */ -/* OBSOLETE return ("EMBKPTSET: Could not set breakpoint"); */ -/* OBSOLETE case EMBKPTRM: */ -/* OBSOLETE return ("EMBKPTRM: Could not remove breakpoint"); */ -/* OBSOLETE case EMBKPTSTAT: */ -/* OBSOLETE return ("EMBKPTSTAT: Could not get breakpoint status"); */ -/* OBSOLETE case EMBKPTNONE: */ -/* OBSOLETE return ("EMBKPTNONE: All breakpoints in use"); */ -/* OBSOLETE case EMBKPTUSED: */ -/* OBSOLETE return ("EMBKPTUSED: Breakpoints already in use"); */ -/* OBSOLETE case EMINIT: */ -/* OBSOLETE return ("EMINIT: Could not init target memory"); */ -/* OBSOLETE case EMGO: */ -/* OBSOLETE return ("EMGO: Could not start execution"); */ -/* OBSOLETE case EMSTEP: */ -/* OBSOLETE return ("EMSTEP: Could not single step"); */ -/* OBSOLETE case EMBREAK: */ -/* OBSOLETE return ("EMBREAK: Could not BREAK"); */ -/* OBSOLETE case EMCOMMERR: */ -/* OBSOLETE return ("EMCOMMERR: Communication error"); */ -/* OBSOLETE default: */ -/* OBSOLETE sprintf (cbuf, "error number %d", code); */ -/* OBSOLETE break; */ -/* OBSOLETE } /* end switch */ */ -/* OBSOLETE */ -/* OBSOLETE return (cbuf); */ -/* OBSOLETE } */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE */ -/* OBSOLETE /* Receive a message, placing it in MSG_BUF, and expect it to be of */ -/* OBSOLETE type MSGCODE. If an error occurs, a non-zero FROM_TTY indicates */ -/* OBSOLETE that the message should be printed. */ -/* OBSOLETE */ -/* OBSOLETE Return 0 for failure, 1 for success. */ */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE expect_msg (INT32 msgcode, union msg_t *msg_buf, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE int retries = 0; */ -/* OBSOLETE while (msg_recv_serial (msg_buf) && (retries++ < MAX_RETRIES)); */ -/* OBSOLETE if (retries >= MAX_RETRIES) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Expected msg %s, ", msg_str (msgcode)); */ -/* OBSOLETE printf ("no message received!\n"); */ -/* OBSOLETE return (0); /* Failure */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (msg_buf->generic_msg.code != msgcode) */ -/* OBSOLETE { */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE printf ("Expected msg %s, ", msg_str (msgcode)); */ -/* OBSOLETE printf ("got msg %s\n", msg_str (msg_buf->generic_msg.code)); */ -/* OBSOLETE if (msg_buf->generic_msg.code == ERROR) */ -/* OBSOLETE printf ("%s\n", error_msg_str (msg_buf->error_msg.error_code)); */ -/* OBSOLETE } */ -/* OBSOLETE return (0); /* Failure */ */ -/* OBSOLETE } */ -/* OBSOLETE return (1); /* Success */ */ -/* OBSOLETE } */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Determine the MiniMon memory space qualifier based on the addr. */ -/* OBSOLETE * FIXME: Can't distinguis I_ROM/D_ROM. */ -/* OBSOLETE * FIXME: Doesn't know anything about I_CACHE/D_CACHE. */ -/* OBSOLETE */ */ -/* OBSOLETE static int */ -/* OBSOLETE mm_memory_space (CORE_ADDR *addr) */ -/* OBSOLETE { */ -/* OBSOLETE ADDR32 tstart = target_config.I_mem_start; */ -/* OBSOLETE ADDR32 tend = tstart + target_config.I_mem_size; */ -/* OBSOLETE ADDR32 dstart = target_config.D_mem_start; */ -/* OBSOLETE ADDR32 dend = tstart + target_config.D_mem_size; */ -/* OBSOLETE ADDR32 rstart = target_config.ROM_start; */ -/* OBSOLETE ADDR32 rend = tstart + target_config.ROM_size; */ -/* OBSOLETE */ -/* OBSOLETE if (((ADDR32) addr >= tstart) && ((ADDR32) addr < tend)) */ -/* OBSOLETE { */ -/* OBSOLETE return I_MEM; */ -/* OBSOLETE } */ -/* OBSOLETE else if (((ADDR32) addr >= dstart) && ((ADDR32) addr < dend)) */ -/* OBSOLETE { */ -/* OBSOLETE return D_MEM; */ -/* OBSOLETE } */ -/* OBSOLETE else if (((ADDR32) addr >= rstart) && ((ADDR32) addr < rend)) */ -/* OBSOLETE { */ -/* OBSOLETE /* FIXME: how do we determine between D_ROM and I_ROM */ */ -/* OBSOLETE return D_ROM; */ -/* OBSOLETE } */ -/* OBSOLETE else /* FIXME: what do me do now? */ */ -/* OBSOLETE return D_MEM; /* Hmmm! */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Define the target subroutine names */ -/* OBSOLETE */ */ -/* OBSOLETE struct target_ops mm_ops; */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE init_mm_ops (void) */ -/* OBSOLETE { */ -/* OBSOLETE mm_ops.to_shortname = "minimon"; */ -/* OBSOLETE mm_ops.to_longname = "Remote AMD/Minimon target"; */ -/* OBSOLETE mm_ops.to_doc = "Remote debug an AMD 290*0 using the MiniMon dbg core on the target"; */ -/* OBSOLETE mm_ops.to_open = mm_open; */ -/* OBSOLETE mm_ops.to_close = mm_close; */ -/* OBSOLETE mm_ops.to_attach = mm_attach; */ -/* OBSOLETE mm_ops.to_post_attach = NULL; */ -/* OBSOLETE mm_ops.to_require_attach = NULL; */ -/* OBSOLETE mm_ops.to_detach = mm_detach; */ -/* OBSOLETE mm_ops.to_require_detach = NULL; */ -/* OBSOLETE mm_ops.to_resume = mm_resume; */ -/* OBSOLETE mm_ops.to_wait = mm_wait; */ -/* OBSOLETE mm_ops.to_post_wait = NULL; */ -/* OBSOLETE mm_ops.to_fetch_registers = mm_fetch_registers; */ -/* OBSOLETE mm_ops.to_store_registers = mm_store_registers; */ -/* OBSOLETE mm_ops.to_prepare_to_store = mm_prepare_to_store; */ -/* OBSOLETE mm_ops.to_xfer_memory = mm_xfer_inferior_memory; */ -/* OBSOLETE mm_ops.to_files_info = mm_files_info; */ -/* OBSOLETE mm_ops.to_insert_breakpoint = mm_insert_breakpoint; */ -/* OBSOLETE mm_ops.to_remove_breakpoint = mm_remove_breakpoint; */ -/* OBSOLETE mm_ops.to_terminal_init = 0; */ -/* OBSOLETE mm_ops.to_terminal_inferior = 0; */ -/* OBSOLETE mm_ops.to_terminal_ours_for_output = 0; */ -/* OBSOLETE mm_ops.to_terminal_ours = 0; */ -/* OBSOLETE mm_ops.to_terminal_info = 0; */ -/* OBSOLETE mm_ops.to_kill = mm_kill; */ -/* OBSOLETE mm_ops.to_load = mm_load; */ -/* OBSOLETE mm_ops.to_lookup_symbol = 0; */ -/* OBSOLETE mm_ops.to_create_inferior = mm_create_inferior; */ -/* OBSOLETE mm_ops.to_post_startup_inferior = NULL; */ -/* OBSOLETE mm_ops.to_acknowledge_created_inferior = NULL; */ -/* OBSOLETE mm_ops.to_clone_and_follow_inferior = NULL; */ -/* OBSOLETE mm_ops.to_post_follow_inferior_by_clone = NULL; */ -/* OBSOLETE mm_ops.to_insert_fork_catchpoint = NULL; */ -/* OBSOLETE mm_ops.to_remove_fork_catchpoint = NULL; */ -/* OBSOLETE mm_ops.to_insert_vfork_catchpoint = NULL; */ -/* OBSOLETE mm_ops.to_remove_vfork_catchpoint = NULL; */ -/* OBSOLETE mm_ops.to_has_forked = NULL; */ -/* OBSOLETE mm_ops.to_has_vforked = NULL; */ -/* OBSOLETE mm_ops.to_can_follow_vfork_prior_to_exec = NULL; */ -/* OBSOLETE mm_ops.to_post_follow_vfork = NULL; */ -/* OBSOLETE mm_ops.to_insert_exec_catchpoint = NULL; */ -/* OBSOLETE mm_ops.to_remove_exec_catchpoint = NULL; */ -/* OBSOLETE mm_ops.to_has_execd = NULL; */ -/* OBSOLETE mm_ops.to_reported_exec_events_per_exec_call = NULL; */ -/* OBSOLETE mm_ops.to_has_exited = NULL; */ -/* OBSOLETE mm_ops.to_mourn_inferior = mm_mourn; */ -/* OBSOLETE mm_ops.to_can_run = 0; */ -/* OBSOLETE mm_ops.to_notice_signals = 0; */ -/* OBSOLETE mm_ops.to_thread_alive = 0; */ -/* OBSOLETE mm_ops.to_stop = 0; */ -/* OBSOLETE mm_ops.to_pid_to_exec_file = NULL; */ -/* OBSOLETE mm_ops.to_stratum = process_stratum; */ -/* OBSOLETE mm_ops.DONT_USE = 0; */ -/* OBSOLETE mm_ops.to_has_all_memory = 1; */ -/* OBSOLETE mm_ops.to_has_memory = 1; */ -/* OBSOLETE mm_ops.to_has_stack = 1; */ -/* OBSOLETE mm_ops.to_has_registers = 1; */ -/* OBSOLETE mm_ops.to_has_execution = 1; */ -/* OBSOLETE mm_ops.to_sections = 0; */ -/* OBSOLETE mm_ops.to_sections_end = 0; */ -/* OBSOLETE mm_ops.to_magic = OPS_MAGIC; */ -/* OBSOLETE }; */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE _initialize_remote_mm (void) */ -/* OBSOLETE { */ -/* OBSOLETE init_mm_ops (); */ -/* OBSOLETE add_target (&mm_ops); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #ifdef NO_HIF_SUPPORT */ -/* OBSOLETE service_HIF (union msg_t *msg) */ -/* OBSOLETE { */ -/* OBSOLETE return (0); /* Emulate a failure */ */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c deleted file mode 100644 index f7863a8..0000000 --- a/gdb/remote-udi.c +++ /dev/null @@ -1,1722 +0,0 @@ -/* OBSOLETE /* Remote debugging interface for AMD 29k interfaced via UDI, for GDB. */ -/* OBSOLETE Copyright 1990, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 */ -/* OBSOLETE Free Software Foundation, Inc. */ -/* OBSOLETE Written by Daniel Mann. Contributed by AMD. */ -/* 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 /* This is like remote.c but uses the Universal Debug Interface (UDI) to */ -/* OBSOLETE talk to the target hardware (or simulator). UDI is a TCP/IP based */ -/* OBSOLETE protocol; for hardware that doesn't run TCP, an interface adapter */ -/* OBSOLETE daemon talks UDI on one side, and talks to the hardware (typically */ -/* OBSOLETE over a serial port) on the other side. */ -/* OBSOLETE */ -/* OBSOLETE - Originally written by Daniel Mann at AMD for MiniMON and gdb 3.91.6. */ -/* OBSOLETE - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this */ -/* OBSOLETE file to gdb 3.95. I was unable to get this working on sun3os4 */ -/* OBSOLETE with termio, only with sgtty. */ -/* OBSOLETE - Daniel Mann at AMD took the 3.95 adaptions above and replaced */ -/* OBSOLETE MiniMON interface with UDI-p interface. */ */ -/* OBSOLETE */ -/* OBSOLETE #include "defs.h" */ -/* OBSOLETE #include "frame.h" */ -/* OBSOLETE #include "inferior.h" */ -/* OBSOLETE #include "value.h" */ -/* OBSOLETE #include <ctype.h> */ -/* OBSOLETE #include <fcntl.h> */ -/* OBSOLETE #include <errno.h> */ -/* OBSOLETE #include "gdb_string.h" */ -/* OBSOLETE #include "terminal.h" */ -/* OBSOLETE #include "target.h" */ -/* OBSOLETE #include "29k-share/udi/udiproc.h" */ -/* OBSOLETE #include "gdbcmd.h" */ -/* OBSOLETE #include "bfd.h" */ -/* OBSOLETE #include "gdbcore.h" /* For download function */ */ -/* OBSOLETE #include "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE /* access the register store directly, without going through */ -/* OBSOLETE the normal handler functions. This avoids an extra data copy. */ */ -/* OBSOLETE */ -/* OBSOLETE extern int stop_soon_quietly; /* for wait_for_inferior */ */ -/* OBSOLETE extern struct value *call_function_by_hand (); */ -/* OBSOLETE static void udi_resume (ptid_t ptid, int step, enum target_signal sig); */ -/* OBSOLETE static void udi_fetch_registers (int regno); */ -/* OBSOLETE static void udi_load (char *args, int from_tty); */ -/* OBSOLETE static void fetch_register (int regno); */ -/* OBSOLETE static void udi_store_registers (int regno); */ -/* OBSOLETE static int store_register (int regno); */ -/* OBSOLETE static int regnum_to_srnum (int regno); */ -/* OBSOLETE static void udi_close (int quitting); */ -/* OBSOLETE static CPUSpace udi_memory_space (CORE_ADDR addr); */ -/* OBSOLETE static int udi_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, */ -/* OBSOLETE int len); */ -/* OBSOLETE static int udi_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, */ -/* OBSOLETE int len); */ -/* OBSOLETE static void download (char *load_arg_string, int from_tty); */ -/* OBSOLETE char CoffFileName[100] = ""; */ -/* OBSOLETE */ -/* OBSOLETE #define FREEZE_MODE (read_register(CPS_REGNUM) & 0x400) */ -/* OBSOLETE #define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE) */ -/* OBSOLETE */ -/* OBSOLETE static int timeout = 5; */ -/* OBSOLETE extern struct target_ops udi_ops; /* Forward declaration */ */ -/* OBSOLETE */ -/* OBSOLETE /* Special register enumeration. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************************* UDI DATA*/ */ -/* OBSOLETE #define MAXDATA 2*1024 /* max UDI[read/write] byte size */ */ -/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */ -/* OBSOLETE udi_open knows that we don't have a file open when the program */ -/* OBSOLETE starts. */ */ -/* OBSOLETE */ -/* OBSOLETE UDISessionId udi_session_id = -1; */ -/* OBSOLETE static char *udi_config_id; */ -/* OBSOLETE */ -/* OBSOLETE CPUOffset IMemStart = 0; */ -/* OBSOLETE CPUSizeT IMemSize = 0; */ -/* OBSOLETE CPUOffset DMemStart = 0; */ -/* OBSOLETE CPUSizeT DMemSize = 0; */ -/* OBSOLETE CPUOffset RMemStart = 0; */ -/* OBSOLETE CPUSizeT RMemSize = 0; */ -/* OBSOLETE UDIUInt32 CPUPRL; */ -/* OBSOLETE UDIUInt32 CoProcPRL; */ -/* OBSOLETE */ -/* OBSOLETE UDIMemoryRange address_ranges[2]; /* Text and data */ */ -/* OBSOLETE UDIResource entry = */ -/* OBSOLETE {0, 0}; /* Entry point */ */ -/* OBSOLETE CPUSizeT stack_sizes[2]; /* Regular and memory stacks */ */ -/* OBSOLETE */ -/* OBSOLETE #define SBUF_MAX 1024 /* maximum size of string handling buffer */ */ -/* OBSOLETE char sbuf[SBUF_MAX]; */ -/* OBSOLETE */ -/* OBSOLETE typedef struct bkpt_entry_str */ -/* OBSOLETE { */ -/* OBSOLETE UDIResource Addr; */ -/* OBSOLETE UDIUInt32 PassCount; */ -/* OBSOLETE UDIBreakType Type; */ -/* OBSOLETE unsigned int BreakId; */ -/* OBSOLETE } */ -/* OBSOLETE bkpt_entry_t; */ -/* OBSOLETE #define BKPT_TABLE_SIZE 40 */ -/* OBSOLETE static bkpt_entry_t bkpt_table[BKPT_TABLE_SIZE]; */ -/* OBSOLETE extern char dfe_errmsg[]; /* error string */ */ -/* OBSOLETE */ -/* OBSOLETE /* malloc'd name of the program on the remote system. */ */ -/* OBSOLETE static char *prog_name = NULL; */ -/* OBSOLETE */ -/* OBSOLETE /* This is called not only when we first attach, but also when the */ -/* OBSOLETE user types "run" after having attached. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_create_inferior (char *execfile, char *args, char **env) */ -/* OBSOLETE { */ -/* OBSOLETE char *args1; */ -/* OBSOLETE */ -/* OBSOLETE if (execfile) */ -/* OBSOLETE { */ -/* OBSOLETE if (prog_name != NULL) */ -/* OBSOLETE xfree (prog_name); */ -/* OBSOLETE prog_name = savestring (execfile, strlen (execfile)); */ -/* OBSOLETE } */ -/* OBSOLETE else if (entry.Offset) */ -/* OBSOLETE execfile = ""; */ -/* OBSOLETE else */ -/* OBSOLETE error ("No image loaded into target."); */ -/* OBSOLETE */ -/* OBSOLETE if (udi_session_id < 0) */ -/* OBSOLETE { */ -/* OBSOLETE /* If the TIP is not open, open it. */ */ -/* OBSOLETE if (UDIConnect (udi_config_id, &udi_session_id)) */ -/* OBSOLETE error ("UDIConnect() failed: %s\n", dfe_errmsg); */ -/* OBSOLETE /* We will need to download the program. */ */ -/* OBSOLETE entry.Offset = 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE inferior_ptid = pid_to_ptid (40000); */ -/* OBSOLETE */ -/* OBSOLETE if (!entry.Offset) */ -/* OBSOLETE download (execfile, 0); */ -/* OBSOLETE */ -/* OBSOLETE args1 = alloca (strlen (execfile) + strlen (args) + 2); */ -/* OBSOLETE */ -/* OBSOLETE if (execfile[0] == '\0') */ -/* OBSOLETE */ -/* OBSOLETE /* It is empty. We need to quote it somehow, or else the target */ -/* OBSOLETE will think there is no argument being passed here. According */ -/* OBSOLETE to the UDI spec it is quoted "according to TIP OS rules" which */ -/* OBSOLETE I guess means quoting it like the Unix shell should work */ -/* OBSOLETE (sounds pretty bogus to me...). In fact it doesn't work (with */ -/* OBSOLETE isstip anyway), but passing in two quotes as the argument seems */ -/* OBSOLETE like a reasonable enough behavior anyway (I guess). */ */ -/* OBSOLETE */ -/* OBSOLETE strcpy (args1, "''"); */ -/* OBSOLETE else */ -/* OBSOLETE strcpy (args1, execfile); */ -/* OBSOLETE strcat (args1, " "); */ -/* OBSOLETE strcat (args1, args); */ -/* OBSOLETE */ -/* OBSOLETE UDIInitializeProcess (address_ranges, /* ProcessMemory[] */ */ -/* OBSOLETE (UDIInt) 2, /* NumberOfRanges */ */ -/* OBSOLETE entry, /* EntryPoint */ */ -/* OBSOLETE stack_sizes, /* *StackSizes */ */ -/* OBSOLETE (UDIInt) 2, /* NumberOfStacks */ */ -/* OBSOLETE args1); /* ArgString */ */ -/* OBSOLETE */ -/* OBSOLETE init_wait_for_inferior (); */ -/* OBSOLETE clear_proceed_status (); */ -/* OBSOLETE proceed (-1, TARGET_SIGNAL_DEFAULT, 0); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_mourn (void) */ -/* OBSOLETE { */ -/* OBSOLETE #if 0 */ -/* OBSOLETE /* Requiring "target udi" each time you run is a major pain. I suspect */ -/* OBSOLETE this was just blindy copied from remote.c, in which "target" and */ -/* OBSOLETE "run" are combined. Having a udi target without an inferior seems */ -/* OBSOLETE to work between "target udi" and "run", so why not now? */ */ -/* OBSOLETE pop_target (); /* Pop back to no-child state */ */ -/* OBSOLETE #endif */ -/* OBSOLETE /* But if we're going to want to run it again, we better remove the */ -/* OBSOLETE breakpoints... */ */ -/* OBSOLETE remove_breakpoints (); */ -/* OBSOLETE generic_mourn_inferior (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************************** UDI_OPEN */ -/* OBSOLETE ** Open a connection to remote TIP. */ -/* OBSOLETE NAME is the socket domain used for communication with the TIP, */ -/* OBSOLETE then a space and the socket name or TIP-host name. */ -/* OBSOLETE '<udi_udi_config_id>' for example. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE /* XXX - need cleanups for udiconnect for various failures!!! */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_open (char *name, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE unsigned int prl; */ -/* OBSOLETE char *p; */ -/* OBSOLETE int cnt; */ -/* OBSOLETE UDIMemoryRange KnownMemory[10]; */ -/* OBSOLETE UDIUInt32 ChipVersions[10]; */ -/* OBSOLETE UDIInt NumberOfRanges = 10; */ -/* OBSOLETE UDIInt NumberOfChips = 10; */ -/* OBSOLETE UDIPId PId; */ -/* OBSOLETE UDIUInt32 TIPId, TargetId, DFEId, DFE, TIP, DFEIPCId, TIPIPCId; */ -/* OBSOLETE */ -/* OBSOLETE target_preopen (from_tty); */ -/* OBSOLETE */ -/* OBSOLETE entry.Offset = 0; */ -/* OBSOLETE */ -/* OBSOLETE for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++) */ -/* OBSOLETE bkpt_table[cnt].Type = 0; */ -/* OBSOLETE */ -/* OBSOLETE if (udi_config_id) */ -/* OBSOLETE xfree (udi_config_id); */ -/* OBSOLETE */ -/* OBSOLETE if (!name) */ -/* OBSOLETE error ("Usage: target udi config_id, where config_id appears in udi_soc file"); */ -/* OBSOLETE */ -/* OBSOLETE udi_config_id = xstrdup (strtok (name, " \t")); */ -/* OBSOLETE */ -/* OBSOLETE if (UDIConnect (udi_config_id, &udi_session_id)) */ -/* OBSOLETE /* FIXME: Should set udi_session_id to -1 here. */ */ -/* OBSOLETE error ("UDIConnect() failed: %s\n", dfe_errmsg); */ -/* OBSOLETE */ -/* OBSOLETE push_target (&udi_ops); */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE ** Initialize target configuration structure (global) */ -/* OBSOLETE */ */ -/* OBSOLETE if (UDIGetTargetConfig (KnownMemory, &NumberOfRanges, */ -/* OBSOLETE ChipVersions, &NumberOfChips)) */ -/* OBSOLETE error ("UDIGetTargetConfig() failed"); */ -/* OBSOLETE if (NumberOfChips > 2) */ -/* OBSOLETE fprintf_unfiltered (gdb_stderr, "Target has more than one processor\n"); */ -/* OBSOLETE for (cnt = 0; cnt < NumberOfRanges; cnt++) */ -/* OBSOLETE { */ -/* OBSOLETE switch (KnownMemory[cnt].Space) */ -/* OBSOLETE { */ -/* OBSOLETE default: */ -/* OBSOLETE fprintf_unfiltered (gdb_stderr, "UDIGetTargetConfig() unknown memory space\n"); */ -/* OBSOLETE break; */ -/* OBSOLETE case UDI29KCP_S: */ -/* OBSOLETE break; */ -/* OBSOLETE case UDI29KIROMSpace: */ -/* OBSOLETE RMemStart = KnownMemory[cnt].Offset; */ -/* OBSOLETE RMemSize = KnownMemory[cnt].Size; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDI29KIRAMSpace: */ -/* OBSOLETE IMemStart = KnownMemory[cnt].Offset; */ -/* OBSOLETE IMemSize = KnownMemory[cnt].Size; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDI29KDRAMSpace: */ -/* OBSOLETE DMemStart = KnownMemory[cnt].Offset; */ -/* OBSOLETE DMemSize = KnownMemory[cnt].Size; */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE a29k_get_processor_type (); */ -/* OBSOLETE */ -/* OBSOLETE if (UDICreateProcess (&PId)) */ -/* OBSOLETE fprintf_unfiltered (gdb_stderr, "UDICreateProcess() failed\n"); */ -/* OBSOLETE */ -/* OBSOLETE /* Print out some stuff, letting the user now what's going on */ */ -/* OBSOLETE if (UDICapabilities (&TIPId, &TargetId, DFEId, DFE, &TIP, &DFEIPCId, */ -/* OBSOLETE &TIPIPCId, sbuf)) */ -/* OBSOLETE error ("UDICapabilities() failed"); */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("Connected via UDI socket,\n\ */ -/* OBSOLETE DFE-IPC version %x.%x.%x TIP-IPC version %x.%x.%x TIP version %x.%x.%x\n %s\n", */ -/* OBSOLETE (DFEIPCId >> 8) & 0xf, (DFEIPCId >> 4) & 0xf, DFEIPCId & 0xf, */ -/* OBSOLETE (TIPIPCId >> 8) & 0xf, (TIPIPCId >> 4) & 0xf, TIPIPCId & 0xf, */ -/* OBSOLETE (TargetId >> 8) & 0xf, (TargetId >> 4) & 0xf, TargetId & 0xf, */ -/* OBSOLETE sbuf); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************************* UDI_CLOSE */ -/* OBSOLETE Close the open connection to the TIP process. */ -/* OBSOLETE Use this when you want to detach and do something else */ -/* OBSOLETE with your gdb. */ */ -/* OBSOLETE static void */ -/* OBSOLETE udi_close ( /*FIXME: how is quitting used */ */ -/* OBSOLETE int quitting) */ -/* OBSOLETE { */ -/* OBSOLETE if (udi_session_id < 0) */ -/* OBSOLETE return; */ -/* OBSOLETE */ -/* OBSOLETE /* We should never get here if there isn't something valid in */ -/* OBSOLETE udi_session_id. */ */ -/* OBSOLETE */ -/* OBSOLETE if (UDIDisconnect (udi_session_id, UDITerminateSession)) */ -/* OBSOLETE { */ -/* OBSOLETE if (quitting) */ -/* OBSOLETE warning ("UDIDisconnect() failed in udi_close"); */ -/* OBSOLETE else */ -/* OBSOLETE error ("UDIDisconnect() failed in udi_close"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Do not try to close udi_session_id again, later in the program. */ */ -/* OBSOLETE udi_session_id = -1; */ -/* OBSOLETE inferior_ptid = null_ptid; */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" Ending remote debugging\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /**************************************************************** UDI_ATACH */ */ -/* OBSOLETE /* Attach to a program that is already loaded and running */ -/* OBSOLETE * Upon exiting the process's execution is stopped. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE udi_attach (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE UDIResource From; */ -/* OBSOLETE UDIInt32 PC_adds; */ -/* OBSOLETE UDICount Count = 1; */ -/* OBSOLETE UDISizeT Size = 4; */ -/* OBSOLETE UDICount CountDone; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE */ -/* OBSOLETE if (args == NULL) */ -/* OBSOLETE error_no_arg ("program to attach"); */ -/* OBSOLETE */ -/* OBSOLETE if (udi_session_id < 0) */ -/* OBSOLETE error ("UDI connection not opened yet, use the 'target udi' command.\n"); */ -/* OBSOLETE */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf_unfiltered ("Attaching to remote program %s...\n", prog_name); */ -/* OBSOLETE */ -/* OBSOLETE UDIStop (); */ -/* OBSOLETE From.Space = UDI29KSpecialRegs; */ -/* OBSOLETE From.Offset = 11; */ -/* OBSOLETE if (err = UDIRead (From, &PC_adds, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead failed in udi_attach"); */ -/* OBSOLETE printf_unfiltered ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds); */ -/* OBSOLETE } */ -/* OBSOLETE /************************************************************* UDI_DETACH */ */ -/* OBSOLETE /* Terminate the open connection to the TIP process. */ -/* OBSOLETE Use this when you want to detach and do something else */ -/* OBSOLETE with your gdb. Leave remote process running (with no breakpoints set). */ */ -/* OBSOLETE static void */ -/* OBSOLETE udi_detach (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE remove_breakpoints (); /* Just in case there were any left in */ */ -/* OBSOLETE */ -/* OBSOLETE if (UDIDisconnect (udi_session_id, UDIContinueSession)) */ -/* OBSOLETE error ("UDIDisconnect() failed in udi_detach"); */ -/* OBSOLETE */ -/* OBSOLETE /* Don't try to UDIDisconnect it again in udi_close, which is called from */ -/* OBSOLETE pop_target. */ */ -/* OBSOLETE udi_session_id = -1; */ -/* OBSOLETE inferior_ptid = null_ptid; */ -/* OBSOLETE */ -/* OBSOLETE pop_target (); */ -/* OBSOLETE */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf_unfiltered ("Detaching from TIP\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /****************************************************************** UDI_RESUME */ -/* OBSOLETE ** Tell the remote machine to resume. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_resume (ptid_t ptid, int step, enum target_signal sig) */ -/* OBSOLETE { */ -/* OBSOLETE UDIError tip_error; */ -/* OBSOLETE UDIUInt32 Steps = 1; */ -/* OBSOLETE UDIStepType StepType = UDIStepNatural; */ -/* OBSOLETE UDIRange Range; */ -/* OBSOLETE */ -/* OBSOLETE if (step) /* step 1 instruction */ */ -/* OBSOLETE { */ -/* OBSOLETE tip_error = UDIStep (Steps, StepType, Range); */ -/* OBSOLETE if (!tip_error) */ -/* OBSOLETE return; */ -/* OBSOLETE */ -/* OBSOLETE fprintf_unfiltered (gdb_stderr, "UDIStep() error = %d\n", tip_error); */ -/* OBSOLETE error ("failed in udi_resume"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (UDIExecute ()) */ -/* OBSOLETE error ("UDIExecute() failed in udi_resume"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /******************************************************************** UDI_WAIT */ -/* OBSOLETE ** Wait until the remote machine stops, then return, */ -/* OBSOLETE storing status in STATUS just as `wait' would. */ */ -/* OBSOLETE */ -/* OBSOLETE static ptid_t */ -/* OBSOLETE udi_wait (ptid_t ptid, struct target_waitstatus *status) */ -/* OBSOLETE { */ -/* OBSOLETE UDIInt32 MaxTime; */ -/* OBSOLETE UDIPId PId; */ -/* OBSOLETE UDIInt32 StopReason; */ -/* OBSOLETE UDISizeT CountDone; */ -/* OBSOLETE int old_timeout = timeout; */ -/* OBSOLETE int old_immediate_quit = immediate_quit; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* wait for message to arrive. It should be: */ -/* OBSOLETE If the target stops executing, udi_wait() should return. */ -/* OBSOLETE */ */ -/* OBSOLETE timeout = 0; /* Wait indefinetly for a message */ */ -/* OBSOLETE immediate_quit = 1; /* Helps ability to QUIT */ */ -/* OBSOLETE */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE i = 0; */ -/* OBSOLETE MaxTime = UDIWaitForever; */ -/* OBSOLETE UDIWait (MaxTime, &PId, &StopReason); */ -/* OBSOLETE QUIT; /* Let user quit if they want */ */ -/* OBSOLETE */ -/* OBSOLETE switch (StopReason & UDIGrossState) */ -/* OBSOLETE { */ -/* OBSOLETE case UDIStdoutReady: */ -/* OBSOLETE if (UDIGetStdout (sbuf, (UDISizeT) SBUF_MAX, &CountDone)) */ -/* OBSOLETE /* This is said to happen if the program tries to output */ -/* OBSOLETE a whole bunch of output (more than SBUF_MAX, I would */ -/* OBSOLETE guess). It doesn't seem to happen with the simulator. */ */ -/* OBSOLETE warning ("UDIGetStdout() failed in udi_wait"); */ -/* OBSOLETE fwrite (sbuf, 1, CountDone, stdout); */ -/* OBSOLETE gdb_flush (gdb_stdout); */ -/* OBSOLETE continue; */ -/* OBSOLETE */ -/* OBSOLETE case UDIStderrReady: */ -/* OBSOLETE UDIGetStderr (sbuf, (UDISizeT) SBUF_MAX, &CountDone); */ -/* OBSOLETE fwrite (sbuf, 1, CountDone, stderr); */ -/* OBSOLETE gdb_flush (gdb_stderr); */ -/* OBSOLETE continue; */ -/* OBSOLETE */ -/* OBSOLETE case UDIStdinNeeded: */ -/* OBSOLETE { */ -/* OBSOLETE int ch; */ -/* OBSOLETE i = 0; */ -/* OBSOLETE do */ -/* OBSOLETE { */ -/* OBSOLETE ch = getchar (); */ -/* OBSOLETE if (ch == EOF) */ -/* OBSOLETE break; */ -/* OBSOLETE sbuf[i++] = ch; */ -/* OBSOLETE } */ -/* OBSOLETE while (i < SBUF_MAX && ch != '\n'); */ -/* OBSOLETE UDIPutStdin (sbuf, (UDISizeT) i, &CountDone); */ -/* OBSOLETE continue; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE case UDIRunning: */ -/* OBSOLETE /* In spite of the fact that we told UDIWait to wait forever, it will */ -/* OBSOLETE return spuriously sometimes. */ */ -/* OBSOLETE case UDIStdinModeX: */ -/* OBSOLETE continue; */ -/* OBSOLETE default: */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE switch (StopReason & UDIGrossState) */ -/* OBSOLETE { */ -/* OBSOLETE case UDITrapped: */ -/* OBSOLETE printf_unfiltered ("Am290*0 received vector number %d\n", StopReason >> 24); */ -/* OBSOLETE */ -/* OBSOLETE switch ((StopReason >> 8) & 0xff) */ -/* OBSOLETE { */ -/* OBSOLETE case 0: /* Illegal opcode */ */ -/* OBSOLETE printf_unfiltered (" (break point)\n"); */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE break; */ -/* OBSOLETE case 1: /* Unaligned Access */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_BUS; */ -/* OBSOLETE break; */ -/* OBSOLETE case 3: */ -/* OBSOLETE case 4: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_FPE; */ -/* OBSOLETE break; */ -/* OBSOLETE case 5: /* Protection Violation */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE /* Why not SEGV? What is a Protection Violation? */ */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */ -/* OBSOLETE break; */ -/* OBSOLETE case 6: */ -/* OBSOLETE case 7: */ -/* OBSOLETE case 8: /* User Instruction Mapping Miss */ */ -/* OBSOLETE case 9: /* User Data Mapping Miss */ */ -/* OBSOLETE case 10: /* Supervisor Instruction Mapping Miss */ */ -/* OBSOLETE case 11: /* Supervisor Data Mapping Miss */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_SEGV; */ -/* OBSOLETE break; */ -/* OBSOLETE case 12: */ -/* OBSOLETE case 13: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */ -/* OBSOLETE break; */ -/* OBSOLETE case 14: /* Timer */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ALRM; */ -/* OBSOLETE break; */ -/* OBSOLETE case 15: /* Trace */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE break; */ -/* OBSOLETE case 16: /* INTR0 */ */ -/* OBSOLETE case 17: /* INTR1 */ */ -/* OBSOLETE case 18: /* INTR2 */ */ -/* OBSOLETE case 19: /* INTR3/Internal */ */ -/* OBSOLETE case 20: /* TRAP0 */ */ -/* OBSOLETE case 21: /* TRAP1 */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_INT; */ -/* OBSOLETE break; */ -/* OBSOLETE case 22: /* Floating-Point Exception */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE /* Why not FPE? */ */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */ -/* OBSOLETE break; */ -/* OBSOLETE case 77: /* assert 77 */ */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE break; */ -/* OBSOLETE default: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE } */ -/* OBSOLETE break; */ -/* OBSOLETE case UDINotExecuting: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TERM; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDIStopped: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TSTP; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDIWarned: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_URG; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDIStepped: */ -/* OBSOLETE case UDIBreak: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDIWaiting: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_STOP; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDIHalted: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */ -/* OBSOLETE status->value.sig = TARGET_SIGNAL_KILL; */ -/* OBSOLETE break; */ -/* OBSOLETE case UDIExited: */ -/* OBSOLETE default: */ -/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */ -/* OBSOLETE status->value.integer = 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE timeout = old_timeout; /* Restore original timeout value */ */ -/* OBSOLETE immediate_quit = old_immediate_quit; */ -/* OBSOLETE return inferior_ptid; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #if 0 */ -/* OBSOLETE /* Handy for debugging */ */ -/* OBSOLETE udi_pc (void) */ -/* OBSOLETE { */ -/* OBSOLETE UDIResource From; */ -/* OBSOLETE UDIUInt32 *To; */ -/* OBSOLETE UDICount Count; */ -/* OBSOLETE UDISizeT Size = 4; */ -/* OBSOLETE UDICount CountDone; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE int pc[2]; */ -/* OBSOLETE unsigned long myregs[256]; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KPC; */ -/* OBSOLETE From.Offset = 0; */ -/* OBSOLETE To = (UDIUInt32 *) pc; */ -/* OBSOLETE Count = 2; */ -/* OBSOLETE */ -/* OBSOLETE err = UDIRead (From, To, Count, Size, &CountDone, HostEndian); */ -/* OBSOLETE */ -/* OBSOLETE printf_unfiltered ("err = %d, CountDone = %d, pc[0] = 0x%x, pc[1] = 0x%x\n", */ -/* OBSOLETE err, CountDone, pc[0], pc[1]); */ -/* OBSOLETE */ -/* OBSOLETE udi_fetch_registers (-1); */ -/* OBSOLETE */ -/* OBSOLETE printf_unfiltered ("other pc1 = 0x%x, pc0 = 0x%x\n", *(int *) ®isters[4 * PC_REGNUM], */ -/* OBSOLETE *(int *) ®isters[4 * NPC_REGNUM]); */ -/* OBSOLETE */ -/* OBSOLETE /* Now, read all the registers globally */ */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KGlobalRegs; */ -/* OBSOLETE From.Offset = 0; */ -/* OBSOLETE err = UDIRead (From, myregs, 256, 4, &CountDone, HostEndian); */ -/* OBSOLETE */ -/* OBSOLETE printf ("err = %d, CountDone = %d\n", err, CountDone); */ -/* OBSOLETE */ -/* OBSOLETE printf ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < 256; i += 2) */ -/* OBSOLETE printf ("%d:\t%#10x\t%11d\t%#10x\t%11d\n", i, myregs[i], myregs[i], */ -/* OBSOLETE myregs[i + 1], myregs[i + 1]); */ -/* OBSOLETE printf ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE return pc[0]; */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************** UDI_FETCH_REGISTERS */ -/* OBSOLETE * Read a remote register 'regno'. */ -/* OBSOLETE * If regno==-1 then read all the registers. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE udi_fetch_registers (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE UDIResource From; */ -/* OBSOLETE UDIUInt32 *To; */ -/* OBSOLETE UDICount Count; */ -/* OBSOLETE UDISizeT Size = 4; */ -/* OBSOLETE UDICount CountDone; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE if (regno >= 0) */ -/* OBSOLETE { */ -/* OBSOLETE fetch_register (regno); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Gr1/rsp */ */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KGlobalRegs; */ -/* OBSOLETE From.Offset = 1; */ -/* OBSOLETE To = (UDIUInt32 *) & registers[4 * GR1_REGNUM]; */ -/* OBSOLETE Count = 1; */ -/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */ -/* OBSOLETE */ -/* OBSOLETE register_valid[GR1_REGNUM] = 1; */ -/* OBSOLETE */ -/* OBSOLETE #if defined(GR64_REGNUM) /* Read gr64-127 */ */ -/* OBSOLETE */ -/* OBSOLETE /* Global Registers gr64-gr95 */ */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KGlobalRegs; */ -/* OBSOLETE From.Offset = 64; */ -/* OBSOLETE To = (UDIUInt32 *) & registers[4 * GR64_REGNUM]; */ -/* OBSOLETE Count = 32; */ -/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */ -/* OBSOLETE */ -/* OBSOLETE for (i = GR64_REGNUM; i < GR64_REGNUM + 32; i++) */ -/* OBSOLETE register_valid[i] = 1; */ -/* OBSOLETE */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE */ -/* OBSOLETE /* Global Registers gr96-gr127 */ */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KGlobalRegs; */ -/* OBSOLETE From.Offset = 96; */ -/* OBSOLETE To = (UDIUInt32 *) & registers[4 * GR96_REGNUM]; */ -/* OBSOLETE Count = 32; */ -/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */ -/* OBSOLETE */ -/* OBSOLETE for (i = GR96_REGNUM; i < GR96_REGNUM + 32; i++) */ -/* OBSOLETE register_valid[i] = 1; */ -/* OBSOLETE */ -/* OBSOLETE /* Local Registers */ */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KLocalRegs; */ -/* OBSOLETE From.Offset = 0; */ -/* OBSOLETE To = (UDIUInt32 *) & registers[4 * LR0_REGNUM]; */ -/* OBSOLETE Count = 128; */ -/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */ -/* OBSOLETE */ -/* OBSOLETE for (i = LR0_REGNUM; i < LR0_REGNUM + 128; i++) */ -/* OBSOLETE register_valid[i] = 1; */ -/* OBSOLETE */ -/* OBSOLETE /* Protected Special Registers */ */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KSpecialRegs; */ -/* OBSOLETE From.Offset = 0; */ -/* OBSOLETE To = (UDIUInt32 *) & registers[4 * SR_REGNUM (0)]; */ -/* OBSOLETE Count = 15; */ -/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */ -/* OBSOLETE */ -/* OBSOLETE for (i = SR_REGNUM (0); i < SR_REGNUM (0) + 15; i++) */ -/* OBSOLETE register_valid[i] = 1; */ -/* OBSOLETE */ -/* OBSOLETE if (USE_SHADOW_PC) */ -/* OBSOLETE { /* Let regno_to_srnum() handle the register number */ */ -/* OBSOLETE fetch_register (NPC_REGNUM); */ -/* OBSOLETE fetch_register (PC_REGNUM); */ -/* OBSOLETE fetch_register (PC2_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE /* Unprotected Special Registers sr128-sr135 */ */ -/* OBSOLETE */ -/* OBSOLETE From.Space = UDI29KSpecialRegs; */ -/* OBSOLETE From.Offset = 128; */ -/* OBSOLETE To = (UDIUInt32 *) & registers[4 * SR_REGNUM (128)]; */ -/* OBSOLETE Count = 135 - 128 + 1; */ -/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */ -/* OBSOLETE */ -/* OBSOLETE for (i = SR_REGNUM (128); i < SR_REGNUM (128) + 135 - 128 + 1; i++) */ -/* OBSOLETE register_valid[i] = 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (remote_debug) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Fetching all registers\n"); */ -/* OBSOLETE fprintf_unfiltered (gdb_stdlog, */ -/* OBSOLETE "Fetching PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", */ -/* OBSOLETE read_register (NPC_REGNUM), */ -/* OBSOLETE read_register (PC_REGNUM), */ -/* OBSOLETE read_register (PC2_REGNUM)); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* There doesn't seem to be any way to get these. */ */ -/* OBSOLETE { */ -/* OBSOLETE int val = -1; */ -/* OBSOLETE supply_register (FPE_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (INTE_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (FPS_REGNUM, (char *) &val); */ -/* OBSOLETE supply_register (EXO_REGNUM, (char *) &val); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************* UDI_STORE_REGISTERS */ -/* OBSOLETE ** Store register regno into the target. */ -/* OBSOLETE * If regno==-1 then store all the registers. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_store_registers (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE UDIUInt32 *From; */ -/* OBSOLETE UDIResource To; */ -/* OBSOLETE UDICount Count; */ -/* OBSOLETE UDISizeT Size = 4; */ -/* OBSOLETE UDICount CountDone; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE */ -/* OBSOLETE if (regno >= 0) */ -/* OBSOLETE { */ -/* OBSOLETE store_register (regno); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (remote_debug) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Storing all registers\n"); */ -/* OBSOLETE fprintf_unfiltered (gdb_stdlog, */ -/* OBSOLETE "PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", */ -/* OBSOLETE read_register (NPC_REGNUM), */ -/* OBSOLETE read_register (PC_REGNUM), */ -/* OBSOLETE read_register (PC2_REGNUM)); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Gr1/rsp */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * GR1_REGNUM]; */ -/* OBSOLETE To.Space = UDI29KGlobalRegs; */ -/* OBSOLETE To.Offset = 1; */ -/* OBSOLETE Count = 1; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* Global registers gr64-gr95 */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * GR64_REGNUM]; */ -/* OBSOLETE To.Space = UDI29KGlobalRegs; */ -/* OBSOLETE To.Offset = 64; */ -/* OBSOLETE Count = 32; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE */ -/* OBSOLETE /* Global registers gr96-gr127 */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * GR96_REGNUM]; */ -/* OBSOLETE To.Space = UDI29KGlobalRegs; */ -/* OBSOLETE To.Offset = 96; */ -/* OBSOLETE Count = 32; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE /* Local Registers */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * LR0_REGNUM]; */ -/* OBSOLETE To.Space = UDI29KLocalRegs; */ -/* OBSOLETE To.Offset = 0; */ -/* OBSOLETE Count = 128; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Protected Special Registers *//* VAB through TMR */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (0)]; */ -/* OBSOLETE To.Space = UDI29KSpecialRegs; */ -/* OBSOLETE To.Offset = 0; */ -/* OBSOLETE Count = 10; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE /* PC0, PC1, PC2 possibly as shadow registers */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (10)]; */ -/* OBSOLETE To.Space = UDI29KSpecialRegs; */ -/* OBSOLETE Count = 3; */ -/* OBSOLETE if (USE_SHADOW_PC) */ -/* OBSOLETE To.Offset = 20; /* SPC0 */ */ -/* OBSOLETE else */ -/* OBSOLETE To.Offset = 10; /* PC0 */ */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE /* PC1 via UDI29KPC */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * PC_REGNUM]; */ -/* OBSOLETE To.Space = UDI29KPC; */ -/* OBSOLETE To.Offset = 0; /* PC1 */ */ -/* OBSOLETE Count = 1; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE /* LRU and MMU */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (13)]; */ -/* OBSOLETE To.Space = UDI29KSpecialRegs; */ -/* OBSOLETE To.Offset = 13; */ -/* OBSOLETE Count = 2; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE /* Unprotected Special Registers */ */ -/* OBSOLETE */ -/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (128)]; */ -/* OBSOLETE To.Space = UDI29KSpecialRegs; */ -/* OBSOLETE To.Offset = 128; */ -/* OBSOLETE Count = 135 - 128 + 1; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */ -/* OBSOLETE */ -/* OBSOLETE registers_changed (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /****************************************************** UDI_PREPARE_TO_STORE */ */ -/* OBSOLETE /* Get ready to modify the registers array. On machines which store */ -/* OBSOLETE individual registers, this doesn't need to do anything. On machines */ -/* OBSOLETE which store all the registers in one fell swoop, this makes sure */ -/* OBSOLETE that registers contains all the registers from the program being */ -/* OBSOLETE debugged. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_prepare_to_store (void) */ -/* OBSOLETE { */ -/* OBSOLETE /* Do nothing, since we can store individual regs */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************** TRANSLATE_ADDR */ */ -/* OBSOLETE static CORE_ADDR */ -/* OBSOLETE translate_addr (CORE_ADDR addr) */ -/* OBSOLETE { */ -/* OBSOLETE #if defined(ULTRA3) && defined(KERNEL_DEBUGGING) */ -/* OBSOLETE /* Check for a virtual address in the kernel */ */ -/* OBSOLETE /* Assume physical address of ublock is in paddr_u register */ */ -/* OBSOLETE /* FIXME: doesn't work for user virtual addresses */ */ -/* OBSOLETE if (addr >= UVADDR) */ -/* OBSOLETE { */ -/* OBSOLETE /* PADDR_U register holds the physical address of the ublock */ */ -/* OBSOLETE CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM); */ -/* OBSOLETE return (i + addr - (CORE_ADDR) UVADDR); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE return (addr); */ -/* OBSOLETE } */ -/* OBSOLETE #else */ -/* OBSOLETE return (addr); */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE /************************************************* UDI_XFER_INFERIOR_MEMORY */ */ -/* OBSOLETE /* FIXME! Merge these two. */ */ -/* OBSOLETE static int */ -/* OBSOLETE udi_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */ -/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */ -/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE memaddr = translate_addr (memaddr); */ -/* OBSOLETE */ -/* OBSOLETE if (write) */ -/* OBSOLETE return udi_write_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE else */ -/* OBSOLETE return udi_read_inferior_memory (memaddr, myaddr, len); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************** UDI_FILES_INFO */ */ -/* OBSOLETE static void */ -/* OBSOLETE udi_files_info (struct target_ops *target) */ -/* OBSOLETE { */ -/* OBSOLETE printf_unfiltered ("\tAttached to UDI socket to %s", udi_config_id); */ -/* OBSOLETE if (prog_name != NULL) */ -/* OBSOLETE printf_unfiltered ("and running program %s", prog_name); */ -/* OBSOLETE printf_unfiltered (".\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /**************************************************** UDI_INSERT_BREAKPOINT */ */ -/* OBSOLETE static int */ -/* OBSOLETE udi_insert_breakpoint (CORE_ADDR addr, char *contents_cache) */ -/* OBSOLETE { */ -/* OBSOLETE int cnt; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE */ -/* OBSOLETE for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++) */ -/* OBSOLETE if (bkpt_table[cnt].Type == 0) /* Find first free slot */ */ -/* OBSOLETE break; */ -/* OBSOLETE */ -/* OBSOLETE if (cnt >= BKPT_TABLE_SIZE) */ -/* OBSOLETE error ("Too many breakpoints set"); */ -/* OBSOLETE */ -/* OBSOLETE bkpt_table[cnt].Addr.Offset = addr; */ -/* OBSOLETE bkpt_table[cnt].Addr.Space = UDI29KIRAMSpace; */ -/* OBSOLETE bkpt_table[cnt].PassCount = 1; */ -/* OBSOLETE bkpt_table[cnt].Type = UDIBreakFlagExecute; */ -/* OBSOLETE */ -/* OBSOLETE err = UDISetBreakpoint (bkpt_table[cnt].Addr, */ -/* OBSOLETE bkpt_table[cnt].PassCount, */ -/* OBSOLETE bkpt_table[cnt].Type, */ -/* OBSOLETE &bkpt_table[cnt].BreakId); */ -/* OBSOLETE */ -/* OBSOLETE if (err == 0) */ -/* OBSOLETE return 0; /* Success */ */ -/* OBSOLETE */ -/* OBSOLETE bkpt_table[cnt].Type = 0; */ -/* OBSOLETE error ("UDISetBreakpoint returned error code %d\n", err); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /**************************************************** UDI_REMOVE_BREAKPOINT */ */ -/* OBSOLETE static int */ -/* OBSOLETE udi_remove_breakpoint (CORE_ADDR addr, char *contents_cache) */ -/* OBSOLETE { */ -/* OBSOLETE int cnt; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE */ -/* OBSOLETE for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++) */ -/* OBSOLETE if (bkpt_table[cnt].Addr.Offset == addr) /* Find matching breakpoint */ */ -/* OBSOLETE break; */ -/* OBSOLETE */ -/* OBSOLETE if (cnt >= BKPT_TABLE_SIZE) */ -/* OBSOLETE error ("Can't find breakpoint in table"); */ -/* OBSOLETE */ -/* OBSOLETE bkpt_table[cnt].Type = 0; */ -/* OBSOLETE */ -/* OBSOLETE err = UDIClearBreakpoint (bkpt_table[cnt].BreakId); */ -/* OBSOLETE if (err == 0) */ -/* OBSOLETE return 0; /* Success */ */ -/* OBSOLETE */ -/* OBSOLETE error ("UDIClearBreakpoint returned error code %d\n", err); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_kill (void) */ -/* OBSOLETE { */ -/* OBSOLETE */ -/* OBSOLETE #if 0 */ -/* OBSOLETE /* */ -/* OBSOLETE UDIStop does not really work as advertised. It causes the TIP to close it's */ -/* OBSOLETE connection, which usually results in GDB dying with a SIGPIPE. For now, we */ -/* OBSOLETE just invoke udi_close, which seems to get things right. */ -/* OBSOLETE */ */ -/* OBSOLETE UDIStop (); */ -/* OBSOLETE */ -/* OBSOLETE udi_session_id = -1; */ -/* OBSOLETE inferior_ptid = null_ptid; */ -/* OBSOLETE */ -/* OBSOLETE if (from_tty) */ -/* OBSOLETE printf_unfiltered ("Target has been stopped."); */ -/* OBSOLETE #endif /* 0 */ */ -/* OBSOLETE #if 0 */ -/* OBSOLETE udi_close (0); */ -/* OBSOLETE pop_target (); */ -/* OBSOLETE #endif /* 0 */ */ -/* OBSOLETE */ -/* OBSOLETE /* Keep the target around, e.g. so "run" can do the right thing when */ -/* OBSOLETE we are already debugging something. */ */ -/* OBSOLETE */ -/* OBSOLETE if (UDIDisconnect (udi_session_id, UDITerminateSession)) */ -/* OBSOLETE { */ -/* OBSOLETE warning ("UDIDisconnect() failed"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Do not try to close udi_session_id again, later in the program. */ */ -/* OBSOLETE udi_session_id = -1; */ -/* OBSOLETE inferior_ptid = null_ptid; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE Load a program into the target. Args are: `program {options}'. The options */ -/* OBSOLETE are used to control loading of the program, and are NOT passed onto the */ -/* OBSOLETE loaded code as arguments. (You need to use the `run' command to do that.) */ -/* OBSOLETE */ -/* OBSOLETE The options are: */ -/* OBSOLETE -ms %d Set mem stack size to %d */ -/* OBSOLETE -rs %d Set regular stack size to %d */ -/* OBSOLETE -i send init info (default) */ -/* OBSOLETE -noi don't send init info */ -/* OBSOLETE -[tT] Load Text section */ -/* OBSOLETE -[dD] Load Data section */ -/* OBSOLETE -[bB] Load BSS section */ -/* OBSOLETE -[lL] Load Lit section */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE download (char *load_arg_string, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE #define DEFAULT_MEM_STACK_SIZE 0x6000 */ -/* OBSOLETE #define DEFAULT_REG_STACK_SIZE 0x2000 */ -/* OBSOLETE */ -/* OBSOLETE char *token; */ -/* OBSOLETE char *filename; */ -/* OBSOLETE asection *section; */ -/* OBSOLETE bfd *pbfd; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE int load_text = 1, load_data = 1, load_bss = 1, load_lit = 1; */ -/* OBSOLETE */ -/* OBSOLETE address_ranges[0].Space = UDI29KIRAMSpace; */ -/* OBSOLETE address_ranges[0].Offset = 0xffffffff; */ -/* OBSOLETE address_ranges[0].Size = 0; */ -/* OBSOLETE */ -/* OBSOLETE address_ranges[1].Space = UDI29KDRAMSpace; */ -/* OBSOLETE address_ranges[1].Offset = 0xffffffff; */ -/* OBSOLETE address_ranges[1].Size = 0; */ -/* OBSOLETE */ -/* OBSOLETE stack_sizes[0] = DEFAULT_REG_STACK_SIZE; */ -/* OBSOLETE stack_sizes[1] = DEFAULT_MEM_STACK_SIZE; */ -/* OBSOLETE */ -/* OBSOLETE dont_repeat (); */ -/* OBSOLETE */ -/* OBSOLETE filename = strtok (load_arg_string, " \t"); */ -/* OBSOLETE if (!filename) */ -/* OBSOLETE error ("Must specify at least a file name with the load command"); */ -/* OBSOLETE */ -/* OBSOLETE filename = tilde_expand (filename); */ -/* OBSOLETE make_cleanup (xfree, filename); */ -/* OBSOLETE */ -/* OBSOLETE while (token = strtok (NULL, " \t")) */ -/* OBSOLETE { */ -/* OBSOLETE if (token[0] == '-') */ -/* OBSOLETE { */ -/* OBSOLETE token++; */ -/* OBSOLETE */ -/* OBSOLETE if (STREQ (token, "ms")) */ -/* OBSOLETE stack_sizes[1] = atol (strtok (NULL, " \t")); */ -/* OBSOLETE else if (STREQ (token, "rs")) */ -/* OBSOLETE stack_sizes[0] = atol (strtok (NULL, " \t")); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE load_text = load_data = load_bss = load_lit = 0; */ -/* OBSOLETE */ -/* OBSOLETE while (*token) */ -/* OBSOLETE { */ -/* OBSOLETE switch (*token++) */ -/* OBSOLETE { */ -/* OBSOLETE case 't': */ -/* OBSOLETE case 'T': */ -/* OBSOLETE load_text = 1; */ -/* OBSOLETE break; */ -/* OBSOLETE case 'd': */ -/* OBSOLETE case 'D': */ -/* OBSOLETE load_data = 1; */ -/* OBSOLETE break; */ -/* OBSOLETE case 'b': */ -/* OBSOLETE case 'B': */ -/* OBSOLETE load_bss = 1; */ -/* OBSOLETE break; */ -/* OBSOLETE case 'l': */ -/* OBSOLETE case 'L': */ -/* OBSOLETE load_lit = 1; */ -/* OBSOLETE break; */ -/* OBSOLETE default: */ -/* OBSOLETE error ("Unknown UDI load option -%s", token - 1); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE pbfd = bfd_openr (filename, gnutarget); */ -/* OBSOLETE */ -/* OBSOLETE if (!pbfd) */ -/* OBSOLETE /* FIXME: should be using bfd_errmsg, not assuming it was */ -/* OBSOLETE bfd_error_system_call. */ */ -/* OBSOLETE perror_with_name (filename); */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME: should be checking for errors from bfd_close (for one thing, */ -/* OBSOLETE on error it does not free all the storage associated with the */ -/* OBSOLETE bfd). */ */ -/* OBSOLETE make_cleanup_bfd_close (pbfd); */ -/* OBSOLETE */ -/* OBSOLETE QUIT; */ -/* OBSOLETE immediate_quit++; */ -/* OBSOLETE */ -/* OBSOLETE if (!bfd_check_format (pbfd, bfd_object)) */ -/* OBSOLETE error ("It doesn't seem to be an object file"); */ -/* OBSOLETE */ -/* OBSOLETE for (section = pbfd->sections; section; section = section->next) */ -/* OBSOLETE { */ -/* OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC) */ -/* OBSOLETE { */ -/* OBSOLETE UDIResource To; */ -/* OBSOLETE UDICount Count; */ -/* OBSOLETE unsigned long section_size, section_end; */ -/* OBSOLETE const char *section_name; */ -/* OBSOLETE */ -/* OBSOLETE section_name = bfd_get_section_name (pbfd, section); */ -/* OBSOLETE if (STREQ (section_name, ".text") && !load_text) */ -/* OBSOLETE continue; */ -/* OBSOLETE else if (STREQ (section_name, ".data") && !load_data) */ -/* OBSOLETE continue; */ -/* OBSOLETE else if (STREQ (section_name, ".bss") && !load_bss) */ -/* OBSOLETE continue; */ -/* OBSOLETE else if (STREQ (section_name, ".lit") && !load_lit) */ -/* OBSOLETE continue; */ -/* OBSOLETE */ -/* OBSOLETE To.Offset = bfd_get_section_vma (pbfd, section); */ -/* OBSOLETE section_size = bfd_section_size (pbfd, section); */ -/* OBSOLETE section_end = To.Offset + section_size; */ -/* OBSOLETE */ -/* OBSOLETE if (section_size == 0) */ -/* OBSOLETE /* This is needed at least in the BSS case, where the code */ -/* OBSOLETE below starts writing before it even checks the size. */ */ -/* OBSOLETE continue; */ -/* OBSOLETE */ -/* OBSOLETE printf_unfiltered ("[Loading section %s at %x (%d bytes)]\n", */ -/* OBSOLETE section_name, */ -/* OBSOLETE To.Offset, */ -/* OBSOLETE section_size); */ -/* OBSOLETE */ -/* OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_CODE) */ -/* OBSOLETE { */ -/* OBSOLETE To.Space = UDI29KIRAMSpace; */ -/* OBSOLETE */ -/* OBSOLETE address_ranges[0].Offset = min (address_ranges[0].Offset, */ -/* OBSOLETE To.Offset); */ -/* OBSOLETE address_ranges[0].Size = max (address_ranges[0].Size, */ -/* OBSOLETE section_end */ -/* OBSOLETE - address_ranges[0].Offset); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE To.Space = UDI29KDRAMSpace; */ -/* OBSOLETE */ -/* OBSOLETE address_ranges[1].Offset = min (address_ranges[1].Offset, */ -/* OBSOLETE To.Offset); */ -/* OBSOLETE address_ranges[1].Size = max (address_ranges[1].Size, */ -/* OBSOLETE section_end */ -/* OBSOLETE - address_ranges[1].Offset); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_LOAD) /* Text, data or lit */ */ -/* OBSOLETE { */ -/* OBSOLETE file_ptr fptr; */ -/* OBSOLETE */ -/* OBSOLETE fptr = 0; */ -/* OBSOLETE */ -/* OBSOLETE while (section_size > 0) */ -/* OBSOLETE { */ -/* OBSOLETE char buffer[1024]; */ -/* OBSOLETE */ -/* OBSOLETE Count = min (section_size, 1024); */ -/* OBSOLETE */ -/* OBSOLETE bfd_get_section_contents (pbfd, section, buffer, fptr, */ -/* OBSOLETE Count); */ -/* OBSOLETE */ -/* OBSOLETE err = UDIWrite ((UDIHostMemPtr) buffer, /* From */ */ -/* OBSOLETE To, /* To */ */ -/* OBSOLETE Count, /* Count */ */ -/* OBSOLETE (UDISizeT) 1, /* Size */ */ -/* OBSOLETE &Count, /* CountDone */ */ -/* OBSOLETE (UDIBool) 0); /* HostEndian */ */ -/* OBSOLETE if (err) */ -/* OBSOLETE error ("UDIWrite failed, error = %d", err); */ -/* OBSOLETE */ -/* OBSOLETE To.Offset += Count; */ -/* OBSOLETE fptr += Count; */ -/* OBSOLETE section_size -= Count; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE /* BSS */ */ -/* OBSOLETE { */ -/* OBSOLETE UDIResource From; */ -/* OBSOLETE unsigned long zero = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* Write a zero byte at the vma */ */ -/* OBSOLETE /* FIXME: Broken for sections of 1-3 bytes (we test for */ -/* OBSOLETE zero above). */ */ -/* OBSOLETE err = UDIWrite ((UDIHostMemPtr) & zero, /* From */ */ -/* OBSOLETE To, /* To */ */ -/* OBSOLETE (UDICount) 1, /* Count */ */ -/* OBSOLETE (UDISizeT) 4, /* Size */ */ -/* OBSOLETE &Count, /* CountDone */ */ -/* OBSOLETE (UDIBool) 0); /* HostEndian */ */ -/* OBSOLETE if (err) */ -/* OBSOLETE error ("UDIWrite failed, error = %d", err); */ -/* OBSOLETE */ -/* OBSOLETE From = To; */ -/* OBSOLETE To.Offset += 4; */ -/* OBSOLETE */ -/* OBSOLETE /* Now, duplicate it for the length of the BSS */ */ -/* OBSOLETE err = UDICopy (From, /* From */ */ -/* OBSOLETE To, /* To */ */ -/* OBSOLETE (UDICount) (section_size / 4 - 1), /* Count */ */ -/* OBSOLETE (UDISizeT) 4, /* Size */ */ -/* OBSOLETE &Count, /* CountDone */ */ -/* OBSOLETE (UDIBool) 1); /* Direction */ */ -/* OBSOLETE if (err) */ -/* OBSOLETE { */ -/* OBSOLETE char message[100]; */ -/* OBSOLETE int xerr; */ -/* OBSOLETE */ -/* OBSOLETE xerr = UDIGetErrorMsg (err, 100, message, &Count); */ -/* OBSOLETE if (!xerr) */ -/* OBSOLETE fprintf_unfiltered (gdb_stderr, "Error is %s\n", message); */ -/* OBSOLETE else */ -/* OBSOLETE fprintf_unfiltered (gdb_stderr, "xerr is %d\n", xerr); */ -/* OBSOLETE error ("UDICopy failed, error = %d", err); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE entry.Space = UDI29KIRAMSpace; */ -/* OBSOLETE entry.Offset = bfd_get_start_address (pbfd); */ -/* OBSOLETE */ -/* OBSOLETE immediate_quit--; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Function to download an image into the remote target. */ */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE udi_load (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE download (args, from_tty); */ -/* OBSOLETE */ -/* OBSOLETE /* As a convenience, pick up any symbol info that is in the program */ -/* OBSOLETE being loaded. Note that we assume that the program is the``mainline''; */ -/* OBSOLETE if this is not always true, then this code will need to be augmented. */ */ -/* OBSOLETE symbol_file_add (strtok (args, " \t"), from_tty, NULL, 1, 0); */ -/* OBSOLETE */ -/* OBSOLETE /* Getting new symbols may change our opinion about what is */ -/* OBSOLETE frameless. */ */ -/* OBSOLETE reinit_frame_cache (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /*************************************************** UDI_WRITE_INFERIOR_MEMORY */ -/* OBSOLETE ** Copy LEN bytes of data from debugger memory at MYADDR */ -/* OBSOLETE to inferior's memory at MEMADDR. Returns number of bytes written. */ */ -/* OBSOLETE static int */ -/* OBSOLETE udi_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int nwritten = 0; */ -/* OBSOLETE UDIUInt32 *From; */ -/* OBSOLETE UDIResource To; */ -/* OBSOLETE UDICount Count; */ -/* OBSOLETE UDISizeT Size = 1; */ -/* OBSOLETE UDICount CountDone = 0; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE */ -/* OBSOLETE To.Space = udi_memory_space (memaddr); */ -/* OBSOLETE From = (UDIUInt32 *) myaddr; */ -/* OBSOLETE */ -/* OBSOLETE while (nwritten < len) */ -/* OBSOLETE { */ -/* OBSOLETE Count = len - nwritten; */ -/* OBSOLETE if (Count > MAXDATA) */ -/* OBSOLETE Count = MAXDATA; */ -/* OBSOLETE To.Offset = memaddr + nwritten; */ -/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE { */ -/* OBSOLETE error ("UDIWrite() failed in udi_write_inferior_memory"); */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE nwritten += CountDone; */ -/* OBSOLETE From += CountDone; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE return (nwritten); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /**************************************************** UDI_READ_INFERIOR_MEMORY */ -/* OBSOLETE ** Read LEN bytes from inferior memory at MEMADDR. Put the result */ -/* OBSOLETE at debugger address MYADDR. Returns number of bytes read. */ */ -/* OBSOLETE static int */ -/* OBSOLETE udi_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */ -/* OBSOLETE { */ -/* OBSOLETE int nread = 0; */ -/* OBSOLETE UDIResource From; */ -/* OBSOLETE UDIUInt32 *To; */ -/* OBSOLETE UDICount Count; */ -/* OBSOLETE UDISizeT Size = 1; */ -/* OBSOLETE UDICount CountDone = 0; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE */ -/* OBSOLETE From.Space = udi_memory_space (memaddr); */ -/* OBSOLETE To = (UDIUInt32 *) myaddr; */ -/* OBSOLETE */ -/* OBSOLETE while (nread < len) */ -/* OBSOLETE { */ -/* OBSOLETE Count = len - nread; */ -/* OBSOLETE if (Count > MAXDATA) */ -/* OBSOLETE Count = MAXDATA; */ -/* OBSOLETE From.Offset = memaddr + nread; */ -/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE { */ -/* OBSOLETE error ("UDIRead() failed in udi_read_inferior_memory"); */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE nread += CountDone; */ -/* OBSOLETE To += CountDone; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE return (nread); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /********************************************************************* WARNING */ -/* OBSOLETE */ */ -/* OBSOLETE udi_warning (int num) */ -/* OBSOLETE { */ -/* OBSOLETE error ("ERROR while loading program into remote TIP: $d\n", num); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /*****************************************************************************/ */ -/* OBSOLETE /* Fetch a single register indicatated by 'regno'. */ -/* OBSOLETE * Returns 0/-1 on success/failure. */ -/* OBSOLETE */ */ -/* OBSOLETE static void */ -/* OBSOLETE fetch_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE UDIResource From; */ -/* OBSOLETE UDIUInt32 To; */ -/* OBSOLETE UDICount Count = 1; */ -/* OBSOLETE UDISizeT Size = 4; */ -/* OBSOLETE UDICount CountDone; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE UDIError err; */ -/* OBSOLETE int result; */ -/* OBSOLETE */ -/* OBSOLETE if (regno == GR1_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE From.Space = UDI29KGlobalRegs; */ -/* OBSOLETE From.Offset = 1; */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE From.Space = UDI29KGlobalRegs; */ -/* OBSOLETE From.Offset = (regno - GR96_REGNUM) + 96;; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE From.Space = UDI29KGlobalRegs; */ -/* OBSOLETE From.Offset = (regno - GR64_REGNUM) + 64; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE */ -/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */ -/* OBSOLETE { */ -/* OBSOLETE From.Space = UDI29KLocalRegs; */ -/* OBSOLETE From.Offset = (regno - LR0_REGNUM); */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE int val = -1; */ -/* OBSOLETE /*supply_register(160 + (regno - FPE_REGNUM),(char *) &val); */ */ -/* OBSOLETE supply_register (regno, (char *) &val); */ -/* OBSOLETE return; /* Pretend Success */ */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE From.Space = UDI29KSpecialRegs; */ -/* OBSOLETE From.Offset = regnum_to_srnum (regno); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (err = UDIRead (From, &To, Count, Size, &CountDone, HostEndian)) */ -/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */ -/* OBSOLETE */ -/* OBSOLETE supply_register (regno, (char *) &To); */ -/* OBSOLETE */ -/* OBSOLETE if (remote_debug) */ -/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Fetching register %s = 0x%x\n", */ -/* OBSOLETE REGISTER_NAME (regno), To); */ -/* OBSOLETE } */ -/* OBSOLETE /*****************************************************************************/ */ -/* OBSOLETE /* Store a single register indicated by 'regno'. */ -/* OBSOLETE * Returns 0/-1 on success/failure. */ -/* OBSOLETE */ */ -/* OBSOLETE static int */ -/* OBSOLETE store_register (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE int result; */ -/* OBSOLETE UDIUInt32 From; */ -/* OBSOLETE UDIResource To; */ -/* OBSOLETE UDICount Count = 1; */ -/* OBSOLETE UDISizeT Size = 4; */ -/* OBSOLETE UDICount CountDone; */ -/* OBSOLETE UDIBool HostEndian = 0; */ -/* OBSOLETE */ -/* OBSOLETE From = read_register (regno); /* get data value */ */ -/* OBSOLETE */ -/* OBSOLETE if (remote_debug) */ -/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Storing register %s = 0x%x\n", */ -/* OBSOLETE REGISTER_NAME (regno), From); */ -/* OBSOLETE */ -/* OBSOLETE if (regno == GR1_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE To.Space = UDI29KGlobalRegs; */ -/* OBSOLETE To.Offset = 1; */ -/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */ -/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so invalidate the */ -/* OBSOLETE * register cache. Do this *after* calling read_register, because we want */ -/* OBSOLETE * read_register to return the value that write_register has just stuffed */ -/* OBSOLETE * into the registers array, not the value of the register fetched from */ -/* OBSOLETE * the inferior. */ -/* OBSOLETE */ */ -/* OBSOLETE registers_changed (); */ -/* OBSOLETE } */ -/* OBSOLETE #if defined(GR64_REGNUM) */ -/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE To.Space = UDI29KGlobalRegs; */ -/* OBSOLETE To.Offset = (regno - GR64_REGNUM) + 64; */ -/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */ -/* OBSOLETE } */ -/* OBSOLETE #endif /* GR64_REGNUM */ */ -/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */ -/* OBSOLETE { */ -/* OBSOLETE To.Space = UDI29KGlobalRegs; */ -/* OBSOLETE To.Offset = (regno - GR96_REGNUM) + 96; */ -/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */ -/* OBSOLETE { */ -/* OBSOLETE To.Space = UDI29KLocalRegs; */ -/* OBSOLETE To.Offset = (regno - LR0_REGNUM); */ -/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */ -/* OBSOLETE } */ -/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */ -/* OBSOLETE return 0; /* Pretend Success */ */ -/* OBSOLETE else if (regno == PC_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE /* PC1 via UDI29KPC */ */ -/* OBSOLETE */ -/* OBSOLETE To.Space = UDI29KPC; */ -/* OBSOLETE To.Offset = 0; /* PC1 */ */ -/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */ -/* OBSOLETE */ -/* OBSOLETE /* Writing to this loc actually changes the values of pc0 & pc1 */ */ -/* OBSOLETE */ -/* OBSOLETE register_valid[PC_REGNUM] = 0; /* pc1 */ */ -/* OBSOLETE register_valid[NPC_REGNUM] = 0; /* pc0 */ */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE /* An unprotected or protected special register */ */ -/* OBSOLETE { */ -/* OBSOLETE To.Space = UDI29KSpecialRegs; */ -/* OBSOLETE To.Offset = regnum_to_srnum (regno); */ -/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (result != 0) */ -/* OBSOLETE error ("UDIWrite() failed in store_registers"); */ -/* OBSOLETE */ -/* OBSOLETE return 0; */ -/* OBSOLETE } */ -/* OBSOLETE /********************************************************** REGNUM_TO_SRNUM */ */ -/* OBSOLETE /* */ -/* OBSOLETE * Convert a gdb special register number to a 29000 special register number. */ -/* OBSOLETE */ */ -/* OBSOLETE static int */ -/* OBSOLETE regnum_to_srnum (int regno) */ -/* OBSOLETE { */ -/* OBSOLETE switch (regno) */ -/* OBSOLETE { */ -/* OBSOLETE case VAB_REGNUM: */ -/* OBSOLETE return (0); */ -/* OBSOLETE case OPS_REGNUM: */ -/* OBSOLETE return (1); */ -/* OBSOLETE case CPS_REGNUM: */ -/* OBSOLETE return (2); */ -/* OBSOLETE case CFG_REGNUM: */ -/* OBSOLETE return (3); */ -/* OBSOLETE case CHA_REGNUM: */ -/* OBSOLETE return (4); */ -/* OBSOLETE case CHD_REGNUM: */ -/* OBSOLETE return (5); */ -/* OBSOLETE case CHC_REGNUM: */ -/* OBSOLETE return (6); */ -/* OBSOLETE case RBP_REGNUM: */ -/* OBSOLETE return (7); */ -/* OBSOLETE case TMC_REGNUM: */ -/* OBSOLETE return (8); */ -/* OBSOLETE case TMR_REGNUM: */ -/* OBSOLETE return (9); */ -/* OBSOLETE case NPC_REGNUM: */ -/* OBSOLETE return (USE_SHADOW_PC ? (20) : (10)); */ -/* OBSOLETE case PC_REGNUM: */ -/* OBSOLETE return (USE_SHADOW_PC ? (21) : (11)); */ -/* OBSOLETE case PC2_REGNUM: */ -/* OBSOLETE return (USE_SHADOW_PC ? (22) : (12)); */ -/* OBSOLETE case MMU_REGNUM: */ -/* OBSOLETE return (13); */ -/* OBSOLETE case LRU_REGNUM: */ -/* OBSOLETE return (14); */ -/* OBSOLETE case IPC_REGNUM: */ -/* OBSOLETE return (128); */ -/* OBSOLETE case IPA_REGNUM: */ -/* OBSOLETE return (129); */ -/* OBSOLETE case IPB_REGNUM: */ -/* OBSOLETE return (130); */ -/* OBSOLETE case Q_REGNUM: */ -/* OBSOLETE return (131); */ -/* OBSOLETE case ALU_REGNUM: */ -/* OBSOLETE return (132); */ -/* OBSOLETE case BP_REGNUM: */ -/* OBSOLETE return (133); */ -/* OBSOLETE case FC_REGNUM: */ -/* OBSOLETE return (134); */ -/* OBSOLETE case CR_REGNUM: */ -/* OBSOLETE return (135); */ -/* OBSOLETE case FPE_REGNUM: */ -/* OBSOLETE return (160); */ -/* OBSOLETE case INTE_REGNUM: */ -/* OBSOLETE return (161); */ -/* OBSOLETE case FPS_REGNUM: */ -/* OBSOLETE return (162); */ -/* OBSOLETE case EXO_REGNUM: */ -/* OBSOLETE return (164); */ -/* OBSOLETE default: */ -/* OBSOLETE return (255); /* Failure ? */ */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE /****************************************************************************/ */ -/* OBSOLETE /* */ -/* OBSOLETE * Determine the Target memory space qualifier based on the addr. */ -/* OBSOLETE * FIXME: Can't distinguis I_ROM/D_ROM. */ -/* OBSOLETE * FIXME: Doesn't know anything about I_CACHE/D_CACHE. */ -/* OBSOLETE */ */ -/* OBSOLETE static CPUSpace */ -/* OBSOLETE udi_memory_space (CORE_ADDR addr) */ -/* OBSOLETE { */ -/* OBSOLETE UDIUInt32 tstart = IMemStart; */ -/* OBSOLETE UDIUInt32 tend = tstart + IMemSize; */ -/* OBSOLETE UDIUInt32 dstart = DMemStart; */ -/* OBSOLETE UDIUInt32 dend = tstart + DMemSize; */ -/* OBSOLETE UDIUInt32 rstart = RMemStart; */ -/* OBSOLETE UDIUInt32 rend = tstart + RMemSize; */ -/* OBSOLETE */ -/* OBSOLETE if (((UDIUInt32) addr >= tstart) && ((UDIUInt32) addr < tend)) */ -/* OBSOLETE { */ -/* OBSOLETE return UDI29KIRAMSpace; */ -/* OBSOLETE } */ -/* OBSOLETE else if (((UDIUInt32) addr >= dstart) && ((UDIUInt32) addr < dend)) */ -/* OBSOLETE { */ -/* OBSOLETE return UDI29KDRAMSpace; */ -/* OBSOLETE } */ -/* OBSOLETE else if (((UDIUInt32) addr >= rstart) && ((UDIUInt32) addr < rend)) */ -/* OBSOLETE { */ -/* OBSOLETE /* FIXME: how do we determine between D_ROM and I_ROM */ */ -/* OBSOLETE return UDI29KIROMSpace; */ -/* OBSOLETE } */ -/* OBSOLETE else /* FIXME: what do me do now? */ */ -/* OBSOLETE return UDI29KDRAMSpace; /* Hmmm! */ */ -/* OBSOLETE } */ -/* OBSOLETE /*********************************************************************** STUBS */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE convert16 (void) */ -/* OBSOLETE {; */ -/* OBSOLETE } */ -/* OBSOLETE void */ -/* OBSOLETE convert32 (void) */ -/* OBSOLETE {; */ -/* OBSOLETE } */ -/* OBSOLETE struct ui_file *EchoFile = 0; /* used for debugging */ */ -/* OBSOLETE int QuietMode = 0; /* used for debugging */ */ -/* OBSOLETE */ -/* OBSOLETE #ifdef NO_HIF_SUPPORT */ -/* OBSOLETE service_HIF (union msg_t *msg) */ -/* OBSOLETE { */ -/* OBSOLETE return (0); /* Emulate a failure */ */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* Target_ops vector. Not static because there does not seem to be */ -/* OBSOLETE any portable way to do a forward declaration of a static variable. */ -/* OBSOLETE The RS/6000 doesn't like "extern" followed by "static"; SunOS */ -/* OBSOLETE /bin/cc doesn't like "static" twice. */ */ -/* OBSOLETE */ -/* OBSOLETE struct target_ops udi_ops; */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE init_udi_ops (void) */ -/* OBSOLETE { */ -/* OBSOLETE udi_ops.to_shortname = "udi"; */ -/* OBSOLETE udi_ops.to_longname = "Remote UDI connected TIP"; */ -/* OBSOLETE udi_ops.to_doc = "Remote debug an AMD 29k using UDI socket connection to TIP process.\n\ */ -/* OBSOLETE Arguments are\n\ */ -/* OBSOLETE `configuration-id AF_INET hostname port-number'\n\ */ -/* OBSOLETE To connect via the network, where hostname and port-number specify the\n\ */ -/* OBSOLETE host and port where you can connect via UDI.\n\ */ -/* OBSOLETE configuration-id is unused.\n\ */ -/* OBSOLETE \n\ */ -/* OBSOLETE `configuration-id AF_UNIX socket-name tip-program'\n\ */ -/* OBSOLETE To connect using a local connection to the \"tip.exe\" program which is\n\ */ -/* OBSOLETE supplied by AMD. If socket-name specifies an AF_UNIX socket then the\n\ */ -/* OBSOLETE tip program must already be started; connect to it using that socket.\n\ */ -/* OBSOLETE If not, start up tip-program, which should be the name of the tip\n\ */ -/* OBSOLETE program. If appropriate, the PATH environment variable is searched.\n\ */ -/* OBSOLETE configuration-id is unused.\n\ */ -/* OBSOLETE \n\ */ -/* OBSOLETE `configuration-id'\n\ */ -/* OBSOLETE Look up the configuration in ./udi_soc or /etc/udi_soc, which\n\ */ -/* OBSOLETE are files containing lines in the above formats. configuration-id is\n\ */ -/* OBSOLETE used to pick which line of the file to use."; */ -/* OBSOLETE udi_ops.to_open = udi_open; */ -/* OBSOLETE udi_ops.to_close = udi_close; */ -/* OBSOLETE udi_ops.to_attach = udi_attach; */ -/* OBSOLETE udi_ops.to_detach = udi_detach; */ -/* OBSOLETE udi_ops.to_resume = udi_resume; */ -/* OBSOLETE udi_ops.to_wait = udi_wait; */ -/* OBSOLETE udi_ops.to_fetch_registers = udi_fetch_registers; */ -/* OBSOLETE udi_ops.to_store_registers = udi_store_registers; */ -/* OBSOLETE udi_ops.to_prepare_to_store = udi_prepare_to_store; */ -/* OBSOLETE udi_ops.to_xfer_memory = udi_xfer_inferior_memory; */ -/* OBSOLETE udi_ops.to_files_info = udi_files_info; */ -/* OBSOLETE udi_ops.to_insert_breakpoint = udi_insert_breakpoint; */ -/* OBSOLETE udi_ops.to_remove_breakpoint = udi_remove_breakpoint; */ -/* OBSOLETE udi_ops.to_terminal_init = 0; */ -/* OBSOLETE udi_ops.to_terminal_inferior = 0; */ -/* OBSOLETE udi_ops.to_terminal_ours_for_output = 0; */ -/* OBSOLETE udi_ops.to_terminal_ours = 0; */ -/* OBSOLETE udi_ops.to_terminal_info = 0; */ -/* OBSOLETE udi_ops.to_kill = udi_kill; */ -/* OBSOLETE udi_ops.to_load = udi_load; */ -/* OBSOLETE udi_ops.to_lookup_symbol = 0; */ -/* OBSOLETE udi_ops.to_create_inferior = udi_create_inferior; */ -/* OBSOLETE udi_ops.to_mourn_inferior = udi_mourn; */ -/* OBSOLETE udi_ops.to_can_run = 0; */ -/* OBSOLETE udi_ops.to_notice_signals = 0; */ -/* OBSOLETE udi_ops.to_thread_alive = 0; */ -/* OBSOLETE udi_ops.to_stop = 0; */ -/* OBSOLETE udi_ops.to_stratum = process_stratum; */ -/* OBSOLETE udi_ops.DONT_USE = 0; */ -/* OBSOLETE udi_ops.to_has_all_memory = 1; */ -/* OBSOLETE udi_ops.to_has_memory = 1; */ -/* OBSOLETE udi_ops.to_has_stack = 1; */ -/* OBSOLETE udi_ops.to_has_registers = 1; */ -/* OBSOLETE udi_ops.to_has_execution = 1; */ -/* OBSOLETE udi_ops.to_sections = 0; */ -/* OBSOLETE udi_ops.to_sections_end = 0; */ -/* OBSOLETE udi_ops.to_magic = OPS_MAGIC; */ -/* OBSOLETE }; */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE _initialize_remote_udi (void) */ -/* OBSOLETE { */ -/* OBSOLETE init_udi_ops (); */ -/* OBSOLETE add_target (&udi_ops); */ -/* OBSOLETE } */ |