2003-10-06 Andrew Cagney <cagney@redhat.com>

* z8k-tdep.c, symm-tdep.c, symm-nat.c: Delete obsolete file.
	* sparclet-stub.c, sparclet-rom.c: Delete obsolete file.
	* sparcl-tdep.c, sparcl-stub.c, h8500-tdep.c: Delete obsolete file.
	* m3-nat.c, mipsm3-nat.c, mn10200-tdep.c: Delete obsolete file.
This commit is contained in:
Andrew Cagney 2003-10-06 19:10:44 +00:00
parent 10cf14ea3d
commit 28a86f5cc0
12 changed files with 7 additions and 11427 deletions

View file

@ -1,3 +1,10 @@
2003-10-06 Andrew Cagney <cagney@redhat.com>
* z8k-tdep.c, symm-tdep.c, symm-nat.c: Delete obsolete file.
* sparclet-stub.c, sparclet-rom.c: Delete obsolete file.
* sparcl-tdep.c, sparcl-stub.c, h8500-tdep.c: Delete obsolete file.
* m3-nat.c, mipsm3-nat.c, mn10200-tdep.c: Delete obsolete file.
2003-10-06 David Lecomber <dsl@sources.redhat.com>
* f-valprint.c: Reformatting

View file

@ -1,739 +0,0 @@
// OBSOLETE /* Target-dependent code for Hitachi H8/500, for GDB.
// OBSOLETE
// OBSOLETE Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002 Free Software
// OBSOLETE Foundation, Inc.
// OBSOLETE
// OBSOLETE This file is part of GDB.
// OBSOLETE
// OBSOLETE This program is free software; you can redistribute it and/or modify
// OBSOLETE it under the terms of the GNU General Public License as published by
// OBSOLETE the Free Software Foundation; either version 2 of the License, or
// OBSOLETE (at your option) any later version.
// OBSOLETE
// OBSOLETE This program is distributed in the hope that it will be useful,
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// OBSOLETE GNU General Public License for more details.
// OBSOLETE
// OBSOLETE You should have received a copy of the GNU General Public License
// OBSOLETE along with this program; if not, write to the Free Software
// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
// OBSOLETE Boston, MA 02111-1307, USA. */
// OBSOLETE
// OBSOLETE /*
// OBSOLETE Contributed by Steve Chamberlain
// OBSOLETE sac@cygnus.com
// OBSOLETE */
// OBSOLETE
// OBSOLETE #include "defs.h"
// OBSOLETE #include "frame.h"
// OBSOLETE #include "symtab.h"
// OBSOLETE #include "gdbtypes.h"
// OBSOLETE #include "gdbcmd.h"
// OBSOLETE #include "value.h"
// OBSOLETE #include "dis-asm.h"
// OBSOLETE #include "gdbcore.h"
// OBSOLETE #include "regcache.h"
// OBSOLETE
// OBSOLETE #define UNSIGNED_SHORT(X) ((X) & 0xffff)
// OBSOLETE
// OBSOLETE static int code_size = 2;
// OBSOLETE
// OBSOLETE static int data_size = 2;
// OBSOLETE
// OBSOLETE /* Shape of an H8/500 frame :
// OBSOLETE
// OBSOLETE arg-n
// OBSOLETE ..
// OBSOLETE arg-2
// OBSOLETE arg-1
// OBSOLETE return address <2 or 4 bytes>
// OBSOLETE old fp <2 bytes>
// OBSOLETE auto-n
// OBSOLETE ..
// OBSOLETE auto-1
// OBSOLETE saved registers
// OBSOLETE
// OBSOLETE */
// OBSOLETE
// OBSOLETE /* an easy to debug H8 stack frame looks like:
// OBSOLETE 0x6df6 push r6
// OBSOLETE 0x0d76 mov.w r7,r6
// OBSOLETE 0x6dfn push reg
// OBSOLETE 0x7905 nnnn mov.w #n,r5 or 0x1b87 subs #2,sp
// OBSOLETE 0x1957 sub.w r5,sp
// OBSOLETE
// OBSOLETE */
// OBSOLETE
// OBSOLETE #define IS_PUSH(x) (((x) & 0xff00)==0x6d00)
// OBSOLETE #define IS_LINK_8(x) ((x) == 0x17)
// OBSOLETE #define IS_LINK_16(x) ((x) == 0x1f)
// OBSOLETE #define IS_MOVE_FP(x) ((x) == 0x0d76)
// OBSOLETE #define IS_MOV_SP_FP(x) ((x) == 0x0d76)
// OBSOLETE #define IS_SUB2_SP(x) ((x) == 0x1b87)
// OBSOLETE #define IS_MOVK_R5(x) ((x) == 0x7905)
// OBSOLETE #define IS_SUB_R5SP(x) ((x) == 0x1957)
// OBSOLETE
// OBSOLETE #define LINK_8 0x17
// OBSOLETE #define LINK_16 0x1f
// OBSOLETE
// OBSOLETE int minimum_mode = 1;
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE h8500_skip_prologue (CORE_ADDR start_pc)
// OBSOLETE {
// OBSOLETE short int w;
// OBSOLETE
// OBSOLETE w = read_memory_integer (start_pc, 1);
// OBSOLETE if (w == LINK_8)
// OBSOLETE {
// OBSOLETE start_pc += 2;
// OBSOLETE w = read_memory_integer (start_pc, 1);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (w == LINK_16)
// OBSOLETE {
// OBSOLETE start_pc += 3;
// OBSOLETE w = read_memory_integer (start_pc, 2);
// OBSOLETE }
// OBSOLETE
// OBSOLETE return start_pc;
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE h8500_addr_bits_remove (CORE_ADDR addr)
// OBSOLETE {
// OBSOLETE return ((addr) & 0xffffff);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Given a GDB frame, determine the address of the calling function's
// OBSOLETE frame. This will be used to create a new GDB frame struct, and
// OBSOLETE then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be
// OBSOLETE called for the new frame.
// OBSOLETE
// OBSOLETE For us, the frame address is its stack pointer value, so we look up
// OBSOLETE the function prologue to determine the caller's sp value, and return it. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE h8500_frame_chain (struct frame_info *thisframe)
// OBSOLETE {
// OBSOLETE if (!inside_entry_file (thisframe->pc))
// OBSOLETE return (read_memory_integer (get_frame_base (thisframe), PTR_SIZE));
// OBSOLETE else
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
// OBSOLETE is not the address of a valid instruction, the address of the next
// OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word
// OBSOLETE of the instruction. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, char *pword1)
// OBSOLETE {
// OBSOLETE if (addr < lim + 8)
// OBSOLETE {
// OBSOLETE read_memory (addr, pword1, 1);
// OBSOLETE read_memory (addr, pword1 + 1, 1);
// OBSOLETE return 1;
// OBSOLETE }
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Examine the prologue of a function. `ip' points to the first
// OBSOLETE instruction. `limit' is the limit of the prologue (e.g. the addr
// OBSOLETE of the first linenumber, or perhaps the program counter if we're
// OBSOLETE stepping through). `frame_sp' is the stack pointer value in use in
// OBSOLETE this frame. `fsr' is a pointer to a frame_saved_regs structure
// OBSOLETE into which we put info about the registers saved by this frame.
// OBSOLETE `fi' is a struct frame_info pointer; we fill in various fields in
// OBSOLETE it to reflect the offsets of the arg pointer and the locals
// OBSOLETE pointer. */
// OBSOLETE
// OBSOLETE /* Return the saved PC from this frame. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE frame_saved_pc (struct frame_info *frame)
// OBSOLETE {
// OBSOLETE return read_memory_integer (get_frame_base (frame) + 2, PTR_SIZE);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE h8500_pop_frame (void)
// OBSOLETE {
// OBSOLETE unsigned regnum;
// OBSOLETE struct frame_saved_regs fsr;
// OBSOLETE struct frame_info *frame = get_current_frame ();
// OBSOLETE
// OBSOLETE deprecated_get_frame_saved_regs (frame, &fsr);
// OBSOLETE
// OBSOLETE for (regnum = 0; regnum < 8; regnum++)
// OBSOLETE {
// OBSOLETE if (fsr.regs[regnum])
// OBSOLETE write_register (regnum, read_memory_short (fsr.regs[regnum]));
// OBSOLETE
// OBSOLETE flush_cached_frames ();
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE h8500_print_register_hook (int regno)
// OBSOLETE {
// OBSOLETE if (regno == CCR_REGNUM)
// OBSOLETE {
// OBSOLETE /* CCR register */
// OBSOLETE
// OBSOLETE int C, Z, N, V;
// OBSOLETE unsigned char b[2];
// OBSOLETE unsigned char l;
// OBSOLETE
// OBSOLETE frame_register_read (deprecated_selected_frame, regno, b);
// OBSOLETE l = b[1];
// OBSOLETE printf_unfiltered ("\t");
// OBSOLETE printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
// OBSOLETE N = (l & 0x8) != 0;
// OBSOLETE Z = (l & 0x4) != 0;
// OBSOLETE V = (l & 0x2) != 0;
// OBSOLETE C = (l & 0x1) != 0;
// OBSOLETE printf_unfiltered ("N-%d ", N);
// OBSOLETE printf_unfiltered ("Z-%d ", Z);
// OBSOLETE printf_unfiltered ("V-%d ", V);
// OBSOLETE printf_unfiltered ("C-%d ", C);
// OBSOLETE if ((C | Z) == 0)
// OBSOLETE printf_unfiltered ("u> ");
// OBSOLETE if ((C | Z) == 1)
// OBSOLETE printf_unfiltered ("u<= ");
// OBSOLETE if ((C == 0))
// OBSOLETE printf_unfiltered ("u>= ");
// OBSOLETE if (C == 1)
// OBSOLETE printf_unfiltered ("u< ");
// OBSOLETE if (Z == 0)
// OBSOLETE printf_unfiltered ("!= ");
// OBSOLETE if (Z == 1)
// OBSOLETE printf_unfiltered ("== ");
// OBSOLETE if ((N ^ V) == 0)
// OBSOLETE printf_unfiltered (">= ");
// OBSOLETE if ((N ^ V) == 1)
// OBSOLETE printf_unfiltered ("< ");
// OBSOLETE if ((Z | (N ^ V)) == 0)
// OBSOLETE printf_unfiltered ("> ");
// OBSOLETE if ((Z | (N ^ V)) == 1)
// OBSOLETE printf_unfiltered ("<= ");
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE h8500_print_registers_info (struct gdbarch *gdbarch,
// OBSOLETE struct ui_file *file,
// OBSOLETE struct frame_info *frame,
// OBSOLETE int regnum, int print_all)
// OBSOLETE {
// OBSOLETE int i;
// OBSOLETE const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
// OBSOLETE char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
// OBSOLETE char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
// OBSOLETE
// OBSOLETE for (i = 0; i < numregs; i++)
// OBSOLETE {
// OBSOLETE /* Decide between printing all regs, non-float / vector regs, or
// OBSOLETE specific reg. */
// OBSOLETE if (regnum == -1)
// OBSOLETE {
// OBSOLETE if (!print_all)
// OBSOLETE {
// OBSOLETE if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
// OBSOLETE continue;
// OBSOLETE if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE if (i != regnum)
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* If the register name is empty, it is undefined for this
// OBSOLETE processor, so don't display anything. */
// OBSOLETE if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
// OBSOLETE continue;
// OBSOLETE
// OBSOLETE fputs_filtered (REGISTER_NAME (i), file);
// OBSOLETE print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
// OBSOLETE
// OBSOLETE /* Get the data in raw format. */
// OBSOLETE if (! frame_register_read (frame, i, raw_buffer))
// OBSOLETE {
// OBSOLETE fprintf_filtered (file, "*value not available*\n");
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
// OBSOLETE The function frame_register_read() should have returned the
// OBSOLETE pre-cooked register so no conversion is necessary. */
// OBSOLETE /* Convert raw data to virtual format if necessary. */
// OBSOLETE if (REGISTER_CONVERTIBLE (i))
// OBSOLETE {
// OBSOLETE REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
// OBSOLETE raw_buffer, virtual_buffer);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE memcpy (virtual_buffer, raw_buffer,
// OBSOLETE REGISTER_VIRTUAL_SIZE (i));
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* If virtual format is floating, print it that way, and in raw
// OBSOLETE hex. */
// OBSOLETE if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
// OBSOLETE {
// OBSOLETE int j;
// OBSOLETE
// OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
// OBSOLETE file, 0, 1, 0, Val_pretty_default);
// OBSOLETE
// OBSOLETE fprintf_filtered (file, "\t(raw 0x");
// OBSOLETE for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
// OBSOLETE {
// OBSOLETE int idx;
// OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
// OBSOLETE idx = j;
// OBSOLETE else
// OBSOLETE idx = REGISTER_RAW_SIZE (i) - 1 - j;
// OBSOLETE fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
// OBSOLETE }
// OBSOLETE fprintf_filtered (file, ")");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE /* Print the register in hex. */
// OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
// OBSOLETE file, 'x', 1, 0, Val_pretty_default);
// OBSOLETE /* If not a vector register, print it also according to its
// OBSOLETE natural format. */
// OBSOLETE if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
// OBSOLETE {
// OBSOLETE fprintf_filtered (file, "\t");
// OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
// OBSOLETE file, 0, 1, 0, Val_pretty_default);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Some h8500 specific info. */
// OBSOLETE h8500_print_register_hook (i);
// OBSOLETE
// OBSOLETE fprintf_filtered (file, "\n");
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE h8500_do_registers_info (int regnum, int all)
// OBSOLETE {
// OBSOLETE h8500_print_registers_info (current_gdbarch, gdb_stdout, deprecated_selected_frame,
// OBSOLETE regnum, all);
// OBSOLETE }
// OBSOLETE
// OBSOLETE int
// OBSOLETE h8500_register_size (int regno)
// OBSOLETE {
// OBSOLETE switch (regno)
// OBSOLETE {
// OBSOLETE case SEG_C_REGNUM:
// OBSOLETE case SEG_D_REGNUM:
// OBSOLETE case SEG_E_REGNUM:
// OBSOLETE case SEG_T_REGNUM:
// OBSOLETE return 1;
// OBSOLETE case R0_REGNUM:
// OBSOLETE case R1_REGNUM:
// OBSOLETE case R2_REGNUM:
// OBSOLETE case R3_REGNUM:
// OBSOLETE case R4_REGNUM:
// OBSOLETE case R5_REGNUM:
// OBSOLETE case R6_REGNUM:
// OBSOLETE case R7_REGNUM:
// OBSOLETE case CCR_REGNUM:
// OBSOLETE return 2;
// OBSOLETE
// OBSOLETE case PR0_REGNUM:
// OBSOLETE case PR1_REGNUM:
// OBSOLETE case PR2_REGNUM:
// OBSOLETE case PR3_REGNUM:
// OBSOLETE case PR4_REGNUM:
// OBSOLETE case PR5_REGNUM:
// OBSOLETE case PR6_REGNUM:
// OBSOLETE case PR7_REGNUM:
// OBSOLETE case PC_REGNUM:
// OBSOLETE return 4;
// OBSOLETE default:
// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check");
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE struct type *
// OBSOLETE h8500_register_virtual_type (int regno)
// OBSOLETE {
// OBSOLETE switch (regno)
// OBSOLETE {
// OBSOLETE case SEG_C_REGNUM:
// OBSOLETE case SEG_E_REGNUM:
// OBSOLETE case SEG_D_REGNUM:
// OBSOLETE case SEG_T_REGNUM:
// OBSOLETE return builtin_type_unsigned_char;
// OBSOLETE case R0_REGNUM:
// OBSOLETE case R1_REGNUM:
// OBSOLETE case R2_REGNUM:
// OBSOLETE case R3_REGNUM:
// OBSOLETE case R4_REGNUM:
// OBSOLETE case R5_REGNUM:
// OBSOLETE case R6_REGNUM:
// OBSOLETE case R7_REGNUM:
// OBSOLETE case CCR_REGNUM:
// OBSOLETE return builtin_type_unsigned_short;
// OBSOLETE case PR0_REGNUM:
// OBSOLETE case PR1_REGNUM:
// OBSOLETE case PR2_REGNUM:
// OBSOLETE case PR3_REGNUM:
// OBSOLETE case PR4_REGNUM:
// OBSOLETE case PR5_REGNUM:
// OBSOLETE case PR6_REGNUM:
// OBSOLETE case PR7_REGNUM:
// OBSOLETE case PC_REGNUM:
// OBSOLETE return builtin_type_unsigned_long;
// OBSOLETE default:
// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check");
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO.
// OBSOLETE This includes special registers such as pc and fp saved in special
// OBSOLETE ways in the stack frame. sp is even more special:
// OBSOLETE the address we return for it IS the sp for the next frame. */
// OBSOLETE
// OBSOLETE void
// OBSOLETE frame_find_saved_regs (struct frame_info *frame_info,
// OBSOLETE struct frame_saved_regs *frame_saved_regs)
// OBSOLETE {
// OBSOLETE register int regnum;
// OBSOLETE register int regmask;
// OBSOLETE register CORE_ADDR next_addr;
// OBSOLETE register CORE_ADDR pc;
// OBSOLETE unsigned char thebyte;
// OBSOLETE
// OBSOLETE memset (frame_saved_regs, '\0', sizeof *frame_saved_regs);
// OBSOLETE
// OBSOLETE if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4
// OBSOLETE && (frame_info)->pc <= (frame_info)->frame)
// OBSOLETE {
// OBSOLETE next_addr = (frame_info)->frame;
// OBSOLETE pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE pc = get_pc_function_start ((frame_info)->pc);
// OBSOLETE /* Verify we have a link a6 instruction next;
// OBSOLETE if not we lose. If we win, find the address above the saved
// OBSOLETE regs using the amount of storage from the link instruction.
// OBSOLETE */
// OBSOLETE
// OBSOLETE thebyte = read_memory_integer (pc, 1);
// OBSOLETE if (0x1f == thebyte)
// OBSOLETE next_addr = (frame_info)->frame + read_memory_integer (pc += 1, 2), pc += 2;
// OBSOLETE else if (0x17 == thebyte)
// OBSOLETE next_addr = (frame_info)->frame + read_memory_integer (pc += 1, 1), pc += 1;
// OBSOLETE else
// OBSOLETE goto lose;
// OBSOLETE #if 0
// OBSOLETE /* FIXME steve */
// OBSOLETE /* If have an add:g.waddal #-n, sp next, adjust next_addr. */
// OBSOLETE if ((0x0c0177777 & read_memory_integer (pc, 2)) == 0157774)
// OBSOLETE next_addr += read_memory_integer (pc += 2, 4), pc += 4;
// OBSOLETE #endif
// OBSOLETE }
// OBSOLETE
// OBSOLETE thebyte = read_memory_integer (pc, 1);
// OBSOLETE if (thebyte == 0x12)
// OBSOLETE {
// OBSOLETE /* Got stm */
// OBSOLETE pc++;
// OBSOLETE regmask = read_memory_integer (pc, 1);
// OBSOLETE pc++;
// OBSOLETE for (regnum = 0; regnum < 8; regnum++, regmask >>= 1)
// OBSOLETE {
// OBSOLETE if (regmask & 1)
// OBSOLETE {
// OBSOLETE (frame_saved_regs)->regs[regnum] = (next_addr += 2) - 2;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE thebyte = read_memory_integer (pc, 1);
// OBSOLETE }
// OBSOLETE /* Maybe got a load of pushes */
// OBSOLETE while (thebyte == 0xbf)
// OBSOLETE {
// OBSOLETE pc++;
// OBSOLETE regnum = read_memory_integer (pc, 1) & 0x7;
// OBSOLETE pc++;
// OBSOLETE (frame_saved_regs)->regs[regnum] = (next_addr += 2) - 2;
// OBSOLETE thebyte = read_memory_integer (pc, 1);
// OBSOLETE }
// OBSOLETE
// OBSOLETE lose:;
// OBSOLETE
// OBSOLETE /* Remember the address of the frame pointer */
// OBSOLETE (frame_saved_regs)->regs[FP_REGNUM] = (frame_info)->frame;
// OBSOLETE
// OBSOLETE /* This is where the old sp is hidden */
// OBSOLETE (frame_saved_regs)->regs[SP_REGNUM] = (frame_info)->frame;
// OBSOLETE
// OBSOLETE /* And the PC - remember the pushed FP is always two bytes long */
// OBSOLETE (frame_saved_regs)->regs[PC_REGNUM] = (frame_info)->frame + 2;
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE saved_pc_after_call (void)
// OBSOLETE {
// OBSOLETE int x;
// OBSOLETE int a = read_register (SP_REGNUM);
// OBSOLETE
// OBSOLETE x = read_memory_integer (a, code_size);
// OBSOLETE if (code_size == 2)
// OBSOLETE {
// OBSOLETE /* Stick current code segement onto top */
// OBSOLETE x &= 0xffff;
// OBSOLETE x |= read_register (SEG_C_REGNUM) << 16;
// OBSOLETE }
// OBSOLETE x &= 0xffffff;
// OBSOLETE return x;
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE h8500_set_pointer_size (int newsize)
// OBSOLETE {
// OBSOLETE static int oldsize = 0;
// OBSOLETE
// OBSOLETE if (oldsize != newsize)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("pointer size set to %d bits\n", newsize);
// OBSOLETE oldsize = newsize;
// OBSOLETE if (newsize == 32)
// OBSOLETE {
// OBSOLETE minimum_mode = 0;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE minimum_mode = 1;
// OBSOLETE }
// OBSOLETE _initialize_gdbtypes ();
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE big_command (char *arg, int from_tty)
// OBSOLETE {
// OBSOLETE h8500_set_pointer_size (32);
// OBSOLETE code_size = 4;
// OBSOLETE data_size = 4;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE medium_command (char *arg, int from_tty)
// OBSOLETE {
// OBSOLETE h8500_set_pointer_size (32);
// OBSOLETE code_size = 4;
// OBSOLETE data_size = 2;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE compact_command (char *arg, int from_tty)
// OBSOLETE {
// OBSOLETE h8500_set_pointer_size (32);
// OBSOLETE code_size = 2;
// OBSOLETE data_size = 4;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE small_command (char *arg, int from_tty)
// OBSOLETE {
// OBSOLETE h8500_set_pointer_size (16);
// OBSOLETE code_size = 2;
// OBSOLETE data_size = 2;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static struct cmd_list_element *setmemorylist;
// OBSOLETE
// OBSOLETE static void
// OBSOLETE set_memory (char *args, int from_tty)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("\"set memory\" must be followed by the name of a memory subcommand.\n");
// OBSOLETE help_list (setmemorylist, "set memory ", -1, gdb_stdout);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* See if variable name is ppc or pr[0-7] */
// OBSOLETE
// OBSOLETE int
// OBSOLETE h8500_is_trapped_internalvar (char *name)
// OBSOLETE {
// OBSOLETE if (name[0] != 'p')
// OBSOLETE return 0;
// OBSOLETE
// OBSOLETE if (strcmp (name + 1, "pc") == 0)
// OBSOLETE return 1;
// OBSOLETE
// OBSOLETE if (name[1] == 'r'
// OBSOLETE && name[2] >= '0'
// OBSOLETE && name[2] <= '7'
// OBSOLETE && name[3] == '\000')
// OBSOLETE return 1;
// OBSOLETE else
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE struct value *
// OBSOLETE h8500_value_of_trapped_internalvar (struct internalvar *var)
// OBSOLETE {
// OBSOLETE LONGEST regval;
// OBSOLETE unsigned char regbuf[4];
// OBSOLETE int page_regnum, regnum;
// OBSOLETE
// OBSOLETE regnum = var->name[2] == 'c' ? PC_REGNUM : var->name[2] - '0';
// OBSOLETE
// OBSOLETE switch (var->name[2])
// OBSOLETE {
// OBSOLETE case 'c':
// OBSOLETE page_regnum = SEG_C_REGNUM;
// OBSOLETE break;
// OBSOLETE case '0':
// OBSOLETE case '1':
// OBSOLETE case '2':
// OBSOLETE case '3':
// OBSOLETE page_regnum = SEG_D_REGNUM;
// OBSOLETE break;
// OBSOLETE case '4':
// OBSOLETE case '5':
// OBSOLETE page_regnum = SEG_E_REGNUM;
// OBSOLETE break;
// OBSOLETE case '6':
// OBSOLETE case '7':
// OBSOLETE page_regnum = SEG_T_REGNUM;
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE
// OBSOLETE get_saved_register (regbuf, NULL, NULL, deprecated_selected_frame, page_regnum, NULL);
// OBSOLETE regval = regbuf[0] << 16;
// OBSOLETE
// OBSOLETE get_saved_register (regbuf, NULL, NULL, deprecated_selected_frame, regnum, NULL);
// OBSOLETE regval |= regbuf[0] << 8 | regbuf[1]; /* XXX host/target byte order */
// OBSOLETE
// OBSOLETE xfree (var->value); /* Free up old value */
// OBSOLETE
// OBSOLETE var->value = value_from_longest (builtin_type_unsigned_long, regval);
// OBSOLETE release_value (var->value); /* Unchain new value */
// OBSOLETE
// OBSOLETE VALUE_LVAL (var->value) = lval_internalvar;
// OBSOLETE VALUE_INTERNALVAR (var->value) = var;
// OBSOLETE return var->value;
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE h8500_set_trapped_internalvar (struct internalvar *var, struct value *newval,
// OBSOLETE int bitpos, int bitsize, int offset)
// OBSOLETE {
// OBSOLETE char *page_regnum, *regnum;
// OBSOLETE char expression[100];
// OBSOLETE unsigned new_regval;
// OBSOLETE struct type *type;
// OBSOLETE enum type_code newval_type_code;
// OBSOLETE
// OBSOLETE type = check_typedef (VALUE_TYPE (newval));
// OBSOLETE newval_type_code = TYPE_CODE (type);
// OBSOLETE
// OBSOLETE if ((newval_type_code != TYPE_CODE_INT
// OBSOLETE && newval_type_code != TYPE_CODE_PTR)
// OBSOLETE || TYPE_LENGTH (type) != sizeof (new_regval))
// OBSOLETE error ("Illegal type (%s) for assignment to $%s\n",
// OBSOLETE TYPE_NAME (VALUE_TYPE (newval)), var->name);
// OBSOLETE
// OBSOLETE new_regval = *(long *) VALUE_CONTENTS_RAW (newval);
// OBSOLETE
// OBSOLETE regnum = var->name + 1;
// OBSOLETE
// OBSOLETE switch (var->name[2])
// OBSOLETE {
// OBSOLETE case 'c':
// OBSOLETE page_regnum = "cp";
// OBSOLETE break;
// OBSOLETE case '0':
// OBSOLETE case '1':
// OBSOLETE case '2':
// OBSOLETE case '3':
// OBSOLETE page_regnum = "dp";
// OBSOLETE break;
// OBSOLETE case '4':
// OBSOLETE case '5':
// OBSOLETE page_regnum = "ep";
// OBSOLETE break;
// OBSOLETE case '6':
// OBSOLETE case '7':
// OBSOLETE page_regnum = "tp";
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE
// OBSOLETE sprintf (expression, "$%s=%d", page_regnum, new_regval >> 16);
// OBSOLETE parse_and_eval (expression);
// OBSOLETE
// OBSOLETE sprintf (expression, "$%s=%d", regnum, new_regval & 0xffff);
// OBSOLETE parse_and_eval (expression);
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE h8500_read_sp (void)
// OBSOLETE {
// OBSOLETE return read_register (PR7_REGNUM);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE h8500_write_sp (CORE_ADDR v)
// OBSOLETE {
// OBSOLETE write_register (PR7_REGNUM, v);
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE h8500_read_pc (ptid_t ptid)
// OBSOLETE {
// OBSOLETE return read_register (PC_REGNUM);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE h8500_write_pc (CORE_ADDR v, ptid_t ptid)
// OBSOLETE {
// OBSOLETE write_register (PC_REGNUM, v);
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE h8500_read_fp (void)
// OBSOLETE {
// OBSOLETE return read_register (PR6_REGNUM);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE _initialize_h8500_tdep (void)
// OBSOLETE {
// OBSOLETE tm_print_insn = print_insn_h8500;
// OBSOLETE
// OBSOLETE add_prefix_cmd ("memory", no_class, set_memory,
// OBSOLETE "set the memory model", &setmemorylist, "set memory ", 0,
// OBSOLETE &setlist);
// OBSOLETE
// OBSOLETE add_cmd ("small", class_support, small_command,
// OBSOLETE "Set small memory model. (16 bit code, 16 bit data)", &setmemorylist);
// OBSOLETE
// OBSOLETE add_cmd ("big", class_support, big_command,
// OBSOLETE "Set big memory model. (32 bit code, 32 bit data)", &setmemorylist);
// OBSOLETE
// OBSOLETE add_cmd ("medium", class_support, medium_command,
// OBSOLETE "Set medium memory model. (32 bit code, 16 bit data)", &setmemorylist);
// OBSOLETE
// OBSOLETE add_cmd ("compact", class_support, compact_command,
// OBSOLETE "Set compact memory model. (16 bit code, 32 bit data)", &setmemorylist);
// OBSOLETE
// OBSOLETE }

File diff suppressed because it is too large Load diff

View file

@ -1,386 +0,0 @@
// OBSOLETE /* Definitions to make GDB run on a mips box under Mach 3.0
// OBSOLETE Copyright 1992, 1993, 1998, 2000, 2001 Free Software Foundation, Inc.
// 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 /* Mach specific routines for little endian mips (e.g. pmax)
// OBSOLETE * running Mach 3.0
// OBSOLETE *
// OBSOLETE * Author: Jukka Virtanen <jtv@hut.fi>
// OBSOLETE */
// OBSOLETE
// OBSOLETE #include "defs.h"
// OBSOLETE #include "inferior.h"
// OBSOLETE #include "regcache.h"
// OBSOLETE
// OBSOLETE #include <stdio.h>
// OBSOLETE
// OBSOLETE #include <mach.h>
// OBSOLETE #include <mach/message.h>
// OBSOLETE #include <mach/exception.h>
// OBSOLETE #include <mach_error.h>
// OBSOLETE
// OBSOLETE /* Find offsets to thread states at compile time.
// OBSOLETE * If your compiler does not grok this, check the hand coded
// OBSOLETE * offsets and use them.
// OBSOLETE */
// OBSOLETE
// OBSOLETE #if 1
// OBSOLETE
// OBSOLETE #define REG_OFFSET(reg) (int)(&((struct mips_thread_state *)0)->reg)
// OBSOLETE #define CREG_OFFSET(reg) (int)(&((struct mips_float_state *)0)->reg)
// OBSOLETE #define EREG_OFFSET(reg) (int)(&((struct mips_exc_state *)0)->reg)
// OBSOLETE
// OBSOLETE /* at reg_offset[i] is the offset to the mips_thread_state
// OBSOLETE * location where the gdb registers[i] is stored.
// OBSOLETE *
// OBSOLETE * -1 means mach does not save it anywhere.
// OBSOLETE */
// OBSOLETE static int reg_offset[] =
// OBSOLETE {
// OBSOLETE /* zero at v0 v1 */
// OBSOLETE -1, REG_OFFSET (r1), REG_OFFSET (r2), REG_OFFSET (r3),
// OBSOLETE
// OBSOLETE /* a0 a1 a2 a3 */
// OBSOLETE REG_OFFSET (r4), REG_OFFSET (r5), REG_OFFSET (r6), REG_OFFSET (r7),
// OBSOLETE
// OBSOLETE /* t0 t1 t2 t3 */
// OBSOLETE REG_OFFSET (r8), REG_OFFSET (r9), REG_OFFSET (r10), REG_OFFSET (r11),
// OBSOLETE
// OBSOLETE /* t4 t5 t6 t7 */
// OBSOLETE REG_OFFSET (r12), REG_OFFSET (r13), REG_OFFSET (r14), REG_OFFSET (r15),
// OBSOLETE
// OBSOLETE /* s0 s1 s2 s3 */
// OBSOLETE REG_OFFSET (r16), REG_OFFSET (r17), REG_OFFSET (r18), REG_OFFSET (r19),
// OBSOLETE
// OBSOLETE /* s4 s5 s6 s7 */
// OBSOLETE REG_OFFSET (r20), REG_OFFSET (r21), REG_OFFSET (r22), REG_OFFSET (r23),
// OBSOLETE
// OBSOLETE /* t8 t9 k0 k1 */
// OBSOLETE REG_OFFSET (r24), REG_OFFSET (r25), REG_OFFSET (r26), REG_OFFSET (r27),
// OBSOLETE
// OBSOLETE /* gp sp s8(30) == fp(72) ra */
// OBSOLETE REG_OFFSET (r28), REG_OFFSET (r29), REG_OFFSET (r30), REG_OFFSET (r31),
// OBSOLETE
// OBSOLETE /* sr(32) PS_REGNUM */
// OBSOLETE EREG_OFFSET (coproc_state),
// OBSOLETE
// OBSOLETE /* lo(33) hi(34) */
// OBSOLETE REG_OFFSET (mdlo), REG_OFFSET (mdhi),
// OBSOLETE
// OBSOLETE /* bad(35) cause(36) pc(37) */
// OBSOLETE EREG_OFFSET (address), EREG_OFFSET (cause), REG_OFFSET (pc),
// OBSOLETE
// OBSOLETE /* f0(38) f1(39) f2(40) f3(41) */
// OBSOLETE CREG_OFFSET (r0), CREG_OFFSET (r1), CREG_OFFSET (r2), CREG_OFFSET (r3),
// OBSOLETE CREG_OFFSET (r4), CREG_OFFSET (r5), CREG_OFFSET (r6), CREG_OFFSET (r7),
// OBSOLETE CREG_OFFSET (r8), CREG_OFFSET (r9), CREG_OFFSET (r10), CREG_OFFSET (r11),
// OBSOLETE CREG_OFFSET (r12), CREG_OFFSET (r13), CREG_OFFSET (r14), CREG_OFFSET (r15),
// OBSOLETE CREG_OFFSET (r16), CREG_OFFSET (r17), CREG_OFFSET (r18), CREG_OFFSET (r19),
// OBSOLETE CREG_OFFSET (r20), CREG_OFFSET (r21), CREG_OFFSET (r22), CREG_OFFSET (r23),
// OBSOLETE CREG_OFFSET (r24), CREG_OFFSET (r25), CREG_OFFSET (r26), CREG_OFFSET (r27),
// OBSOLETE CREG_OFFSET (r28), CREG_OFFSET (r29), CREG_OFFSET (r30), CREG_OFFSET (r31),
// OBSOLETE
// OBSOLETE /* fsr(70) fir(71) fp(72) == s8(30) */
// OBSOLETE CREG_OFFSET (csr), CREG_OFFSET (esr), REG_OFFSET (r30)
// OBSOLETE };
// OBSOLETE #else
// OBSOLETE /* If the compiler does not grok the above defines */
// OBSOLETE static int reg_offset[] =
// OBSOLETE {
// OBSOLETE /* mach_thread_state offsets: */
// OBSOLETE -1, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
// OBSOLETE 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120,
// OBSOLETE /*sr, lo, hi,addr,cause,pc */
// OBSOLETE 8, 124, 128, 4, 0, 132,
// OBSOLETE /* mach_float_state offsets: */
// OBSOLETE 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
// OBSOLETE 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124,
// OBSOLETE /*fsr,fir */
// OBSOLETE 128, 132,
// OBSOLETE /* FP_REGNUM pseudo maps to s8==r30 in mach_thread_state */
// OBSOLETE 116
// OBSOLETE };
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE /* Fetch COUNT contiguous registers from thread STATE starting from REGNUM
// OBSOLETE * Caller knows that the regs handled in one transaction are of same size.
// OBSOLETE */
// OBSOLETE #define FETCH_REGS(state, regnum, count) \
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (regnum)], \
// OBSOLETE (char *)state+reg_offset[ regnum ], \
// OBSOLETE count*REGISTER_SIZE)
// OBSOLETE
// OBSOLETE /* Store COUNT contiguous registers to thread STATE starting from REGNUM */
// OBSOLETE #define STORE_REGS(state, regnum, count) \
// OBSOLETE memcpy ((char *)state+reg_offset[ regnum ], \
// OBSOLETE &deprecated_registers[REGISTER_BYTE (regnum)], \
// OBSOLETE count*REGISTER_SIZE)
// OBSOLETE
// OBSOLETE #define REGS_ALL -1
// OBSOLETE #define REGS_NORMAL 1
// OBSOLETE #define REGS_EXC 2
// OBSOLETE #define REGS_COP1 4
// OBSOLETE
// OBSOLETE /* Hardware regs that matches FP_REGNUM */
// OBSOLETE #define MACH_FP_REGNUM 30
// OBSOLETE
// OBSOLETE /* Fech thread's registers. if regno == -1, fetch all regs */
// OBSOLETE void
// OBSOLETE fetch_inferior_registers (int regno)
// OBSOLETE {
// OBSOLETE kern_return_t ret;
// OBSOLETE
// OBSOLETE thread_state_data_t state;
// OBSOLETE struct mips_exc_state exc_state;
// OBSOLETE
// OBSOLETE int stateCnt = MIPS_THREAD_STATE_COUNT;
// OBSOLETE
// OBSOLETE int which_regs = 0; /* A bit mask */
// OBSOLETE
// OBSOLETE if (!MACH_PORT_VALID (current_thread))
// OBSOLETE error ("fetch inferior registers: Invalid thread");
// OBSOLETE
// OBSOLETE if (regno < -1 || regno >= NUM_REGS)
// OBSOLETE error ("invalid register %d supplied to fetch_inferior_registers", regno);
// OBSOLETE
// OBSOLETE if (regno == -1)
// OBSOLETE which_regs = REGS_ALL;
// OBSOLETE else if (regno == ZERO_REGNUM)
// OBSOLETE {
// OBSOLETE int zero = 0;
// OBSOLETE supply_register (ZERO_REGNUM, &zero);
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE else if ((ZERO_REGNUM < regno && regno < PS_REGNUM)
// OBSOLETE || regno == FP_REGNUM
// OBSOLETE || regno == LO_REGNUM
// OBSOLETE || regno == HI_REGNUM
// OBSOLETE || regno == PC_REGNUM)
// OBSOLETE which_regs = REGS_NORMAL;
// OBSOLETE else if (FP0_REGNUM <= regno && regno <= FCRIR_REGNUM)
// OBSOLETE which_regs = REGS_COP1 | REGS_EXC;
// OBSOLETE else
// OBSOLETE which_regs = REGS_EXC;
// OBSOLETE
// OBSOLETE /* fetch regs saved to mips_thread_state */
// OBSOLETE if (which_regs & REGS_NORMAL)
// OBSOLETE {
// OBSOLETE ret = thread_get_state (current_thread,
// OBSOLETE MIPS_THREAD_STATE,
// OBSOLETE state,
// OBSOLETE &stateCnt);
// OBSOLETE CHK ("fetch inferior registers: thread_get_state", ret);
// OBSOLETE
// OBSOLETE if (which_regs == REGS_NORMAL)
// OBSOLETE {
// OBSOLETE /* Fetch also FP_REGNUM if fetching MACH_FP_REGNUM and vice versa */
// OBSOLETE if (regno == MACH_FP_REGNUM || regno == FP_REGNUM)
// OBSOLETE {
// OBSOLETE supply_register (FP_REGNUM,
// OBSOLETE (char *) state + reg_offset[MACH_FP_REGNUM]);
// OBSOLETE supply_register (MACH_FP_REGNUM,
// OBSOLETE (char *) state + reg_offset[MACH_FP_REGNUM]);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE supply_register (regno,
// OBSOLETE (char *) state + reg_offset[regno]);
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* ZERO_REGNUM is always zero */
// OBSOLETE *(int *) deprecated_registers = 0;
// OBSOLETE
// OBSOLETE /* Copy thread saved regs 1..31 to gdb's reg value array
// OBSOLETE * Luckily, they are contiquous
// OBSOLETE */
// OBSOLETE FETCH_REGS (state, 1, 31);
// OBSOLETE
// OBSOLETE /* Copy mdlo and mdhi */
// OBSOLETE FETCH_REGS (state, LO_REGNUM, 2);
// OBSOLETE
// OBSOLETE /* Copy PC */
// OBSOLETE FETCH_REGS (state, PC_REGNUM, 1);
// OBSOLETE
// OBSOLETE /* Mach 3.0 saves FP to MACH_FP_REGNUM.
// OBSOLETE * For some reason gdb wants to assign a pseudo register for it.
// OBSOLETE */
// OBSOLETE FETCH_REGS (state, FP_REGNUM, 1);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Read exc state. Also read if need to fetch floats */
// OBSOLETE if (which_regs & REGS_EXC)
// OBSOLETE {
// OBSOLETE stateCnt = MIPS_EXC_STATE_COUNT;
// OBSOLETE ret = thread_get_state (current_thread,
// OBSOLETE MIPS_EXC_STATE,
// OBSOLETE (thread_state_t) & exc_state,
// OBSOLETE &stateCnt);
// OBSOLETE CHK ("fetch inferior regs (exc): thread_get_state", ret);
// OBSOLETE
// OBSOLETE /* We need to fetch exc_state to see if the floating
// OBSOLETE * state is valid for the thread.
// OBSOLETE */
// OBSOLETE
// OBSOLETE /* cproc_state: Which coprocessors the thread uses */
// OBSOLETE supply_register (PS_REGNUM,
// OBSOLETE (char *) &exc_state + reg_offset[PS_REGNUM]);
// OBSOLETE
// OBSOLETE if (which_regs == REGS_EXC || which_regs == REGS_ALL)
// OBSOLETE {
// OBSOLETE supply_register (BADVADDR_REGNUM,
// OBSOLETE (char *) &exc_state + reg_offset[BADVADDR_REGNUM]);
// OBSOLETE
// OBSOLETE supply_register (CAUSE_REGNUM,
// OBSOLETE (char *) &exc_state + reg_offset[CAUSE_REGNUM]);
// OBSOLETE if (which_regs == REGS_EXC)
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE
// OBSOLETE if (which_regs & REGS_COP1)
// OBSOLETE {
// OBSOLETE /* If the thread does not have saved COPROC1, set regs to zero */
// OBSOLETE
// OBSOLETE if (!(exc_state.coproc_state & MIPS_STATUS_USE_COP1))
// OBSOLETE bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
// OBSOLETE sizeof (struct mips_float_state));
// OBSOLETE else
// OBSOLETE {
// OBSOLETE stateCnt = MIPS_FLOAT_STATE_COUNT;
// OBSOLETE ret = thread_get_state (current_thread,
// OBSOLETE MIPS_FLOAT_STATE,
// OBSOLETE state,
// OBSOLETE &stateCnt);
// OBSOLETE CHK ("fetch inferior regs (floats): thread_get_state", ret);
// OBSOLETE
// OBSOLETE if (regno != -1)
// OBSOLETE {
// OBSOLETE supply_register (regno,
// OBSOLETE (char *) state + reg_offset[regno]);
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE
// OBSOLETE FETCH_REGS (state, FP0_REGNUM, 34);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* All registers are valid, if not returned yet */
// OBSOLETE deprecated_registers_fetched ();
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Store gdb's view of registers to the thread.
// OBSOLETE * All registers are always valid when entering here.
// OBSOLETE * @@ ahem, maybe that is too strict, we could validate the necessary ones
// OBSOLETE * here.
// OBSOLETE *
// OBSOLETE * Hmm. It seems that gdb set $reg=value command first reads everything,
// OBSOLETE * then sets the reg and then stores everything. -> we must make sure
// OBSOLETE * that the immutable registers are not changed by reading them first.
// OBSOLETE */
// OBSOLETE
// OBSOLETE void
// OBSOLETE store_inferior_registers (register int regno)
// OBSOLETE {
// OBSOLETE thread_state_data_t state;
// OBSOLETE kern_return_t ret;
// OBSOLETE
// OBSOLETE if (!MACH_PORT_VALID (current_thread))
// OBSOLETE error ("store inferior registers: Invalid thread");
// OBSOLETE
// OBSOLETE /* Check for read only regs.
// OBSOLETE * @@ If some of these is can be changed, fix this
// OBSOLETE */
// OBSOLETE if (regno == ZERO_REGNUM ||
// OBSOLETE regno == PS_REGNUM ||
// OBSOLETE regno == BADVADDR_REGNUM ||
// OBSOLETE regno == CAUSE_REGNUM ||
// OBSOLETE regno == FCRIR_REGNUM)
// OBSOLETE {
// OBSOLETE message ("You can not alter read-only register `%s'",
// OBSOLETE REGISTER_NAME (regno));
// OBSOLETE fetch_inferior_registers (regno);
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (regno == -1)
// OBSOLETE {
// OBSOLETE /* Don't allow these to change */
// OBSOLETE
// OBSOLETE /* ZERO_REGNUM */
// OBSOLETE *(int *) deprecated_registers = 0;
// OBSOLETE
// OBSOLETE fetch_inferior_registers (PS_REGNUM);
// OBSOLETE fetch_inferior_registers (BADVADDR_REGNUM);
// OBSOLETE fetch_inferior_registers (CAUSE_REGNUM);
// OBSOLETE fetch_inferior_registers (FCRIR_REGNUM);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (regno == -1 || (ZERO_REGNUM < regno && regno <= PC_REGNUM))
// OBSOLETE {
// OBSOLETE #if 1
// OBSOLETE /* Mach 3.0 saves thread's FP to MACH_FP_REGNUM.
// OBSOLETE * GDB wants assigns a pseudo register FP_REGNUM for frame pointer.
// OBSOLETE *
// OBSOLETE * @@@ Here I assume (!) that gdb's FP has the value that
// OBSOLETE * should go to threads frame pointer. If not true, this
// OBSOLETE * fails badly!!!!!
// OBSOLETE */
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (MACH_FP_REGNUM)],
// OBSOLETE &deprecated_registers[REGISTER_BYTE (FP_REGNUM)],
// OBSOLETE REGISTER_RAW_SIZE (FP_REGNUM));
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE /* Save gdb's regs 1..31 to thread saved regs 1..31
// OBSOLETE * Luckily, they are contiquous
// OBSOLETE */
// OBSOLETE STORE_REGS (state, 1, 31);
// OBSOLETE
// OBSOLETE /* Save mdlo, mdhi */
// OBSOLETE STORE_REGS (state, LO_REGNUM, 2);
// OBSOLETE
// OBSOLETE /* Save PC */
// OBSOLETE STORE_REGS (state, PC_REGNUM, 1);
// OBSOLETE
// OBSOLETE ret = thread_set_state (current_thread,
// OBSOLETE MIPS_THREAD_STATE,
// OBSOLETE state,
// OBSOLETE MIPS_FLOAT_STATE_COUNT);
// OBSOLETE CHK ("store inferior regs : thread_set_state", ret);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (regno == -1 || regno >= FP0_REGNUM)
// OBSOLETE {
// OBSOLETE /* If thread has floating state, save it */
// OBSOLETE if (read_register (PS_REGNUM) & MIPS_STATUS_USE_COP1)
// OBSOLETE {
// OBSOLETE /* Do NOT save FCRIR_REGNUM */
// OBSOLETE STORE_REGS (state, FP0_REGNUM, 33);
// OBSOLETE
// OBSOLETE ret = thread_set_state (current_thread,
// OBSOLETE MIPS_FLOAT_STATE,
// OBSOLETE state,
// OBSOLETE MIPS_FLOAT_STATE_COUNT);
// OBSOLETE CHK ("store inferior registers (floats): thread_set_state", ret);
// OBSOLETE }
// OBSOLETE else if (regno != -1)
// OBSOLETE message
// OBSOLETE ("Thread does not use floating point unit, floating regs not saved");
// OBSOLETE }
// OBSOLETE }

View file

@ -1,899 +0,0 @@
// OBSOLETE /* Target-dependent code for the Matsushita MN10200 for GDB, the GNU debugger.
// OBSOLETE
// OBSOLETE Copyright 1997, 1998, 1999, 2000, 2001, 2003 Free Software
// OBSOLETE Foundation, Inc.
// 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 "frame.h"
// OBSOLETE #include "inferior.h"
// OBSOLETE #include "target.h"
// OBSOLETE #include "value.h"
// OBSOLETE #include "bfd.h"
// OBSOLETE #include "gdb_string.h"
// OBSOLETE #include "gdbcore.h"
// OBSOLETE #include "symfile.h"
// OBSOLETE #include "regcache.h"
// OBSOLETE
// OBSOLETE
// OBSOLETE /* Should call_function allocate stack space for a struct return? */
// OBSOLETE int
// OBSOLETE mn10200_use_struct_convention (int gcc_p, struct type *type)
// OBSOLETE {
// OBSOLETE return (TYPE_NFIELDS (type) > 1 || TYPE_LENGTH (type) > 8);
// OBSOLETE }
// OBSOLETE /* *INDENT-OFF* */
// OBSOLETE /* The main purpose of this file is dealing with prologues to extract
// OBSOLETE information about stack frames and saved registers.
// OBSOLETE
// OBSOLETE For reference here's how prologues look on the mn10200:
// OBSOLETE
// OBSOLETE With frame pointer:
// OBSOLETE mov fp,a0
// OBSOLETE mov sp,fp
// OBSOLETE add <size>,sp
// OBSOLETE Register saves for d2, d3, a1, a2 as needed. Saves start
// OBSOLETE at fp - <size> + <outgoing_args_size> and work towards higher
// OBSOLETE addresses. Note that the saves are actually done off the stack
// OBSOLETE pointer in the prologue! This makes for smaller code and easier
// OBSOLETE prologue scanning as the displacement fields will unlikely
// OBSOLETE be more than 8 bits!
// OBSOLETE
// OBSOLETE Without frame pointer:
// OBSOLETE add <size>,sp
// OBSOLETE Register saves for d2, d3, a1, a2 as needed. Saves start
// OBSOLETE at sp + <outgoing_args_size> and work towards higher addresses.
// OBSOLETE
// OBSOLETE Out of line prologue:
// OBSOLETE add <local size>,sp -- optional
// OBSOLETE jsr __prologue
// OBSOLETE add <outgoing_size>,sp -- optional
// OBSOLETE
// OBSOLETE The stack pointer remains constant throughout the life of most
// OBSOLETE functions. As a result the compiler will usually omit the
// OBSOLETE frame pointer, so we must handle frame pointerless functions. */
// OBSOLETE
// OBSOLETE /* Analyze the prologue to determine where registers are saved,
// OBSOLETE the end of the prologue, etc etc. Return the end of the prologue
// OBSOLETE scanned.
// OBSOLETE
// OBSOLETE We store into FI (if non-null) several tidbits of information:
// OBSOLETE
// OBSOLETE * stack_size -- size of this stack frame. Note that if we stop in
// OBSOLETE certain parts of the prologue/epilogue we may claim the size of the
// OBSOLETE current frame is zero. This happens when the current frame has
// OBSOLETE not been allocated yet or has already been deallocated.
// OBSOLETE
// OBSOLETE * fsr -- Addresses of registers saved in the stack by this frame.
// OBSOLETE
// OBSOLETE * status -- A (relatively) generic status indicator. It's a bitmask
// OBSOLETE with the following bits:
// OBSOLETE
// OBSOLETE MY_FRAME_IN_SP: The base of the current frame is actually in
// OBSOLETE the stack pointer. This can happen for frame pointerless
// OBSOLETE functions, or cases where we're stopped in the prologue/epilogue
// OBSOLETE itself. For these cases mn10200_analyze_prologue will need up
// OBSOLETE update fi->frame before returning or analyzing the register
// OBSOLETE save instructions.
// OBSOLETE
// OBSOLETE MY_FRAME_IN_FP: The base of the current frame is in the
// OBSOLETE frame pointer register ($a2).
// OBSOLETE
// OBSOLETE CALLER_A2_IN_A0: $a2 from the caller's frame is temporarily
// OBSOLETE in $a0. This can happen if we're stopped in the prologue.
// OBSOLETE
// OBSOLETE NO_MORE_FRAMES: Set this if the current frame is "start" or
// OBSOLETE if the first instruction looks like mov <imm>,sp. This tells
// OBSOLETE frame chain to not bother trying to unwind past this frame. */
// OBSOLETE /* *INDENT-ON* */
// OBSOLETE
// OBSOLETE
// OBSOLETE
// OBSOLETE
// OBSOLETE #define MY_FRAME_IN_SP 0x1
// OBSOLETE #define MY_FRAME_IN_FP 0x2
// OBSOLETE #define CALLER_A2_IN_A0 0x4
// OBSOLETE #define NO_MORE_FRAMES 0x8
// OBSOLETE
// OBSOLETE static CORE_ADDR
// OBSOLETE mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
// OBSOLETE {
// OBSOLETE CORE_ADDR func_addr, func_end, addr, stop;
// OBSOLETE CORE_ADDR stack_size = 0;
// OBSOLETE unsigned char buf[4];
// OBSOLETE int status;
// OBSOLETE char *name;
// OBSOLETE int out_of_line_prologue = 0;
// OBSOLETE
// OBSOLETE /* Use the PC in the frame if it's provided to look up the
// OBSOLETE start of this function. */
// OBSOLETE pc = (fi ? get_frame_pc (fi) : pc);
// OBSOLETE
// OBSOLETE /* Find the start of this function. */
// OBSOLETE status = find_pc_partial_function (pc, &name, &func_addr, &func_end);
// OBSOLETE
// OBSOLETE /* Do nothing if we couldn't find the start of this function or if we're
// OBSOLETE stopped at the first instruction in the prologue. */
// OBSOLETE if (status == 0)
// OBSOLETE return pc;
// OBSOLETE
// OBSOLETE /* If we're in start, then give up. */
// OBSOLETE if (strcmp (name, "start") == 0)
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE fi->status = NO_MORE_FRAMES;
// OBSOLETE return pc;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* At the start of a function our frame is in the stack pointer. */
// OBSOLETE if (fi)
// OBSOLETE fi->status = MY_FRAME_IN_SP;
// OBSOLETE
// OBSOLETE /* If we're physically on an RTS instruction, then our frame has already
// OBSOLETE been deallocated.
// OBSOLETE
// OBSOLETE fi->frame is bogus, we need to fix it. */
// OBSOLETE if (fi && get_frame_pc (fi) + 1 == func_end)
// OBSOLETE {
// OBSOLETE status = target_read_memory (get_frame_pc (fi), buf, 1);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return get_frame_pc (fi);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (buf[0] == 0xfe)
// OBSOLETE {
// OBSOLETE if (get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return get_frame_pc (fi);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Similarly if we're stopped on the first insn of a prologue as our
// OBSOLETE frame hasn't been allocated yet. */
// OBSOLETE if (fi && get_frame_pc (fi) == func_addr)
// OBSOLETE {
// OBSOLETE if (get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return get_frame_pc (fi);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Figure out where to stop scanning. */
// OBSOLETE stop = fi ? get_frame_pc (fi) : func_end;
// OBSOLETE
// OBSOLETE /* Don't walk off the end of the function. */
// OBSOLETE stop = stop > func_end ? func_end : stop;
// OBSOLETE
// OBSOLETE /* Start scanning on the first instruction of this function. */
// OBSOLETE addr = func_addr;
// OBSOLETE
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && fi->status & MY_FRAME_IN_SP)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* First see if this insn sets the stack pointer; if so, it's something
// OBSOLETE we won't understand, so quit now. */
// OBSOLETE if (buf[0] == 0xdf
// OBSOLETE || (buf[0] == 0xf4 && buf[1] == 0x77))
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE fi->status = NO_MORE_FRAMES;
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Now see if we have a frame pointer.
// OBSOLETE
// OBSOLETE Search for mov a2,a0 (0xf278)
// OBSOLETE then mov a3,a2 (0xf27e). */
// OBSOLETE
// OBSOLETE if (buf[0] == 0xf2 && buf[1] == 0x78)
// OBSOLETE {
// OBSOLETE /* Our caller's $a2 will be found in $a0 now. Note it for
// OBSOLETE our callers. */
// OBSOLETE if (fi)
// OBSOLETE fi->status |= CALLER_A2_IN_A0;
// OBSOLETE addr += 2;
// OBSOLETE if (addr >= stop)
// OBSOLETE {
// OBSOLETE /* We still haven't allocated our local stack. Handle this
// OBSOLETE as if we stopped on the first or last insn of a function. */
// OBSOLETE if (fi && get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE if (buf[0] == 0xf2 && buf[1] == 0x7e)
// OBSOLETE {
// OBSOLETE addr += 2;
// OBSOLETE
// OBSOLETE /* Our frame pointer is valid now. */
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE fi->status |= MY_FRAME_IN_FP;
// OBSOLETE fi->status &= ~MY_FRAME_IN_SP;
// OBSOLETE }
// OBSOLETE if (addr >= stop)
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Next we should allocate the local frame.
// OBSOLETE
// OBSOLETE Search for add imm8,a3 (0xd3XX)
// OBSOLETE or add imm16,a3 (0xf70bXXXX)
// OBSOLETE or add imm24,a3 (0xf467XXXXXX).
// OBSOLETE
// OBSOLETE If none of the above was found, then this prologue has
// OBSOLETE no stack, and therefore can't have any register saves,
// OBSOLETE so quit now. */
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE if (buf[0] == 0xd3)
// OBSOLETE {
// OBSOLETE stack_size = extract_signed_integer (&buf[1], 1);
// OBSOLETE if (fi)
// OBSOLETE fi->stack_size = stack_size;
// OBSOLETE addr += 2;
// OBSOLETE if (addr >= stop)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else if (buf[0] == 0xf7 && buf[1] == 0x0b)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 2, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE stack_size = extract_signed_integer (buf, 2);
// OBSOLETE if (fi)
// OBSOLETE fi->stack_size = stack_size;
// OBSOLETE addr += 4;
// OBSOLETE if (addr >= stop)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else if (buf[0] == 0xf4 && buf[1] == 0x67)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 2, buf, 3);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE stack_size = extract_signed_integer (buf, 3);
// OBSOLETE if (fi)
// OBSOLETE fi->stack_size = stack_size;
// OBSOLETE addr += 5;
// OBSOLETE if (addr >= stop)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Now see if we have a call to __prologue for an out of line
// OBSOLETE prologue. */
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE
// OBSOLETE /* First check for 16bit pc-relative call to __prologue. */
// OBSOLETE if (buf[0] == 0xfd)
// OBSOLETE {
// OBSOLETE CORE_ADDR temp;
// OBSOLETE status = target_read_memory (addr + 1, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Get the PC this instruction will branch to. */
// OBSOLETE temp = (extract_signed_integer (buf, 2) + addr + 3) & 0xffffff;
// OBSOLETE
// OBSOLETE /* Get the name of the function at the target address. */
// OBSOLETE status = find_pc_partial_function (temp, &name, NULL, NULL);
// OBSOLETE if (status == 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Note if it is an out of line prologue. */
// OBSOLETE out_of_line_prologue = (strcmp (name, "__prologue") == 0);
// OBSOLETE
// OBSOLETE /* This sucks up 3 bytes of instruction space. */
// OBSOLETE if (out_of_line_prologue)
// OBSOLETE addr += 3;
// OBSOLETE
// OBSOLETE if (addr >= stop)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL)
// OBSOLETE {
// OBSOLETE fi->stack_size -= 16;
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
// OBSOLETE }
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE /* Now check for the 24bit pc-relative call to __prologue. */
// OBSOLETE else if (buf[0] == 0xf4 && buf[1] == 0xe1)
// OBSOLETE {
// OBSOLETE CORE_ADDR temp;
// OBSOLETE status = target_read_memory (addr + 2, buf, 3);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Get the PC this instruction will branch to. */
// OBSOLETE temp = (extract_signed_integer (buf, 3) + addr + 5) & 0xffffff;
// OBSOLETE
// OBSOLETE /* Get the name of the function at the target address. */
// OBSOLETE status = find_pc_partial_function (temp, &name, NULL, NULL);
// OBSOLETE if (status == 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp ());
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Note if it is an out of line prologue. */
// OBSOLETE out_of_line_prologue = (strcmp (name, "__prologue") == 0);
// OBSOLETE
// OBSOLETE /* This sucks up 5 bytes of instruction space. */
// OBSOLETE if (out_of_line_prologue)
// OBSOLETE addr += 5;
// OBSOLETE
// OBSOLETE if (addr >= stop)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
// OBSOLETE {
// OBSOLETE fi->stack_size -= 16;
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
// OBSOLETE }
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Now actually handle the out of line prologue. */
// OBSOLETE if (out_of_line_prologue)
// OBSOLETE {
// OBSOLETE int outgoing_args_size = 0;
// OBSOLETE
// OBSOLETE /* First adjust the stack size for this function. The out of
// OBSOLETE line prologue saves 4 registers (16bytes of data). */
// OBSOLETE if (fi)
// OBSOLETE fi->stack_size -= 16;
// OBSOLETE
// OBSOLETE /* Update fi->frame if necessary. */
// OBSOLETE if (fi && get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
// OBSOLETE
// OBSOLETE /* After the out of line prologue, there may be another
// OBSOLETE stack adjustment for the outgoing arguments.
// OBSOLETE
// OBSOLETE Search for add imm8,a3 (0xd3XX)
// OBSOLETE or add imm16,a3 (0xf70bXXXX)
// OBSOLETE or add imm24,a3 (0xf467XXXXXX). */
// OBSOLETE
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
// OBSOLETE fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
// OBSOLETE fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
// OBSOLETE fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
// OBSOLETE }
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (buf[0] == 0xd3)
// OBSOLETE {
// OBSOLETE outgoing_args_size = extract_signed_integer (&buf[1], 1);
// OBSOLETE addr += 2;
// OBSOLETE }
// OBSOLETE else if (buf[0] == 0xf7 && buf[1] == 0x0b)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 2, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
// OBSOLETE fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
// OBSOLETE fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
// OBSOLETE fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
// OBSOLETE }
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE outgoing_args_size = extract_signed_integer (buf, 2);
// OBSOLETE addr += 4;
// OBSOLETE }
// OBSOLETE else if (buf[0] == 0xf4 && buf[1] == 0x67)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 2, buf, 3);
// OBSOLETE if (status != 0)
// OBSOLETE {
// OBSOLETE if (fi && get_next_frame (fi) == NULL)
// OBSOLETE {
// OBSOLETE fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
// OBSOLETE fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
// OBSOLETE fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
// OBSOLETE fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
// OBSOLETE }
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE outgoing_args_size = extract_signed_integer (buf, 3);
// OBSOLETE addr += 5;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE outgoing_args_size = 0;
// OBSOLETE
// OBSOLETE /* Now that we know the size of the outgoing arguments, fix
// OBSOLETE fi->frame again if this is the innermost frame. */
// OBSOLETE if (fi && get_next_frame (fi) == NULL)
// OBSOLETE deprecated_update_frame_base_hack (fi, get_frame_base (fi) - outgoing_args_size);
// OBSOLETE
// OBSOLETE /* Note the register save information and update the stack
// OBSOLETE size for this frame too. */
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
// OBSOLETE fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
// OBSOLETE fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
// OBSOLETE fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
// OBSOLETE fi->stack_size += outgoing_args_size;
// OBSOLETE }
// OBSOLETE /* There can be no more prologue insns, so return now. */
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* At this point fi->frame needs to be correct.
// OBSOLETE
// OBSOLETE If MY_FRAME_IN_SP is set and we're the innermost frame, then we
// OBSOLETE need to fix fi->frame so that backtracing, find_frame_saved_regs,
// OBSOLETE etc work correctly. */
// OBSOLETE if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP) != 0)
// OBSOLETE deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
// OBSOLETE
// OBSOLETE /* And last we have the register saves. These are relatively
// OBSOLETE simple because they're physically done off the stack pointer,
// OBSOLETE and thus the number of different instructions we need to
// OBSOLETE check is greatly reduced because we know the displacements
// OBSOLETE will be small.
// OBSOLETE
// OBSOLETE Search for movx d2,(X,a3) (0xf55eXX)
// OBSOLETE then movx d3,(X,a3) (0xf55fXX)
// OBSOLETE then mov a1,(X,a3) (0x5dXX) No frame pointer case
// OBSOLETE then mov a2,(X,a3) (0x5eXX) No frame pointer case
// OBSOLETE or mov a0,(X,a3) (0x5cXX) Frame pointer case. */
// OBSOLETE
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE if (buf[0] == 0xf5 && buf[1] == 0x5e)
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 2, buf, 1);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE fi->fsr.regs[2] = (get_frame_base (fi) + stack_size
// OBSOLETE + extract_signed_integer (buf, 1));
// OBSOLETE }
// OBSOLETE addr += 3;
// OBSOLETE if (addr >= stop)
// OBSOLETE return addr;
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE if (buf[0] == 0xf5 && buf[1] == 0x5f)
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 2, buf, 1);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE fi->fsr.regs[3] = (get_frame_base (fi) + stack_size
// OBSOLETE + extract_signed_integer (buf, 1));
// OBSOLETE }
// OBSOLETE addr += 3;
// OBSOLETE if (addr >= stop)
// OBSOLETE return addr;
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE if (buf[0] == 0x5d)
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 1, buf, 1);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE fi->fsr.regs[5] = (get_frame_base (fi) + stack_size
// OBSOLETE + extract_signed_integer (buf, 1));
// OBSOLETE }
// OBSOLETE addr += 2;
// OBSOLETE if (addr >= stop)
// OBSOLETE return addr;
// OBSOLETE status = target_read_memory (addr, buf, 2);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE if (buf[0] == 0x5e || buf[0] == 0x5c)
// OBSOLETE {
// OBSOLETE if (fi)
// OBSOLETE {
// OBSOLETE status = target_read_memory (addr + 1, buf, 1);
// OBSOLETE if (status != 0)
// OBSOLETE return addr;
// OBSOLETE fi->fsr.regs[6] = (get_frame_base (fi) + stack_size
// OBSOLETE + extract_signed_integer (buf, 1));
// OBSOLETE fi->status &= ~CALLER_A2_IN_A0;
// OBSOLETE }
// OBSOLETE addr += 2;
// OBSOLETE if (addr >= stop)
// OBSOLETE return addr;
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE return addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: frame_chain
// OBSOLETE Figure out and return the caller's frame pointer given current
// OBSOLETE frame_info struct.
// OBSOLETE
// OBSOLETE We don't handle dummy frames yet but we would probably just return the
// OBSOLETE stack pointer that was in use at the time the function call was made? */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE mn10200_frame_chain (struct frame_info *fi)
// OBSOLETE {
// OBSOLETE struct frame_info *dummy_frame = deprecated_frame_xmalloc ();
// OBSOLETE struct cleanup *old_chain = make_cleanup (xfree, dummy_frame);
// OBSOLETE CORE_ADDR ret;
// OBSOLETE
// OBSOLETE /* Walk through the prologue to determine the stack size,
// OBSOLETE location of saved registers, end of the prologue, etc. */
// OBSOLETE if (fi->status == 0)
// OBSOLETE mn10200_analyze_prologue (fi, (CORE_ADDR) 0);
// OBSOLETE
// OBSOLETE /* Quit now if mn10200_analyze_prologue set NO_MORE_FRAMES. */
// OBSOLETE if (fi->status & NO_MORE_FRAMES)
// OBSOLETE return 0;
// OBSOLETE
// OBSOLETE /* Now that we've analyzed our prologue, determine the frame
// OBSOLETE pointer for our caller.
// OBSOLETE
// OBSOLETE If our caller has a frame pointer, then we need to
// OBSOLETE find the entry value of $a2 to our function.
// OBSOLETE
// OBSOLETE If CALLER_A2_IN_A0, then the chain is in $a0.
// OBSOLETE
// OBSOLETE If fsr.regs[6] is nonzero, then it's at the memory
// OBSOLETE location pointed to by fsr.regs[6].
// OBSOLETE
// OBSOLETE Else it's still in $a2.
// OBSOLETE
// OBSOLETE If our caller does not have a frame pointer, then his
// OBSOLETE frame base is fi->frame + -caller's stack size + 4. */
// OBSOLETE
// OBSOLETE /* The easiest way to get that info is to analyze our caller's frame.
// OBSOLETE
// OBSOLETE So we set up a dummy frame and call mn10200_analyze_prologue to
// OBSOLETE find stuff for us. */
// OBSOLETE deprecated_update_frame_pc_hack (dummy_frame, FRAME_SAVED_PC (fi));
// OBSOLETE deprecated_update_frame_base_hack (dummy_frame, get_frame_base (fi));
// OBSOLETE memset (dummy_frame->fsr.regs, '\000', sizeof dummy_frame->fsr.regs);
// OBSOLETE dummy_frame->status = 0;
// OBSOLETE dummy_frame->stack_size = 0;
// OBSOLETE mn10200_analyze_prologue (dummy_frame, 0);
// OBSOLETE
// OBSOLETE if (dummy_frame->status & MY_FRAME_IN_FP)
// OBSOLETE {
// OBSOLETE /* Our caller has a frame pointer. So find the frame in $a2, $a0,
// OBSOLETE or in the stack. */
// OBSOLETE if (fi->fsr.regs[6])
// OBSOLETE ret = (read_memory_integer (fi->fsr.regs[FP_REGNUM], REGISTER_SIZE)
// OBSOLETE & 0xffffff);
// OBSOLETE else if (fi->status & CALLER_A2_IN_A0)
// OBSOLETE ret = read_register (4);
// OBSOLETE else
// OBSOLETE ret = read_register (FP_REGNUM);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE /* Our caller does not have a frame pointer. So his frame starts
// OBSOLETE at the base of our frame (fi->frame) + <his size> + 4 (saved pc). */
// OBSOLETE ret = get_frame_base (fi) + -dummy_frame->stack_size + 4;
// OBSOLETE }
// OBSOLETE do_cleanups (old_chain);
// OBSOLETE return ret;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: skip_prologue
// OBSOLETE Return the address of the first inst past the prologue of the function. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE mn10200_skip_prologue (CORE_ADDR pc)
// OBSOLETE {
// OBSOLETE /* We used to check the debug symbols, but that can lose if
// OBSOLETE we have a null prologue. */
// OBSOLETE return mn10200_analyze_prologue (NULL, pc);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: pop_frame
// OBSOLETE This routine gets called when either the user uses the `return'
// OBSOLETE command, or the call dummy breakpoint gets hit. */
// OBSOLETE
// OBSOLETE void
// OBSOLETE mn10200_pop_frame (struct frame_info *frame)
// OBSOLETE {
// OBSOLETE int regnum;
// OBSOLETE
// OBSOLETE if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
// OBSOLETE get_frame_base (frame),
// OBSOLETE get_frame_base (frame)))
// OBSOLETE generic_pop_dummy_frame ();
// OBSOLETE else
// OBSOLETE {
// OBSOLETE write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
// OBSOLETE
// OBSOLETE /* Restore any saved registers. */
// OBSOLETE for (regnum = 0; regnum < NUM_REGS; regnum++)
// OBSOLETE if (frame->fsr.regs[regnum] != 0)
// OBSOLETE {
// OBSOLETE ULONGEST value;
// OBSOLETE
// OBSOLETE value = read_memory_unsigned_integer (frame->fsr.regs[regnum],
// OBSOLETE REGISTER_RAW_SIZE (regnum));
// OBSOLETE write_register (regnum, value);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Actually cut back the stack. */
// OBSOLETE write_register (SP_REGNUM, get_frame_base (frame));
// OBSOLETE
// OBSOLETE /* Don't we need to set the PC?!? XXX FIXME. */
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Throw away any cached frame information. */
// OBSOLETE flush_cached_frames ();
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: push_arguments
// OBSOLETE Setup arguments for a call to the target. Arguments go in
// OBSOLETE order on the stack. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE mn10200_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
// OBSOLETE unsigned char struct_return, CORE_ADDR struct_addr)
// OBSOLETE {
// OBSOLETE int argnum = 0;
// OBSOLETE int len = 0;
// OBSOLETE int stack_offset = 0;
// OBSOLETE int regsused = struct_return ? 1 : 0;
// OBSOLETE
// OBSOLETE /* This should be a nop, but align the stack just in case something
// OBSOLETE went wrong. Stacks are two byte aligned on the mn10200. */
// OBSOLETE sp &= ~1;
// OBSOLETE
// OBSOLETE /* Now make space on the stack for the args.
// OBSOLETE
// OBSOLETE XXX This doesn't appear to handle pass-by-invisible reference
// OBSOLETE arguments. */
// OBSOLETE for (argnum = 0; argnum < nargs; argnum++)
// OBSOLETE {
// OBSOLETE int arg_length = (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 1) & ~1;
// OBSOLETE
// OBSOLETE /* If we've used all argument registers, then this argument is
// OBSOLETE pushed. */
// OBSOLETE if (regsused >= 2 || arg_length > 4)
// OBSOLETE {
// OBSOLETE regsused = 2;
// OBSOLETE len += arg_length;
// OBSOLETE }
// OBSOLETE /* We know we've got some arg register space left. If this argument
// OBSOLETE will fit entirely in regs, then put it there. */
// OBSOLETE else if (arg_length <= 2
// OBSOLETE || TYPE_CODE (VALUE_TYPE (args[argnum])) == TYPE_CODE_PTR)
// OBSOLETE {
// OBSOLETE regsused++;
// OBSOLETE }
// OBSOLETE else if (regsused == 0)
// OBSOLETE {
// OBSOLETE regsused = 2;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE regsused = 2;
// OBSOLETE len += arg_length;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Allocate stack space. */
// OBSOLETE sp -= len;
// OBSOLETE
// OBSOLETE regsused = struct_return ? 1 : 0;
// OBSOLETE /* Push all arguments onto the stack. */
// OBSOLETE for (argnum = 0; argnum < nargs; argnum++)
// OBSOLETE {
// OBSOLETE int len;
// OBSOLETE char *val;
// OBSOLETE
// OBSOLETE /* XXX Check this. What about UNIONS? */
// OBSOLETE if (TYPE_CODE (VALUE_TYPE (*args)) == TYPE_CODE_STRUCT
// OBSOLETE && TYPE_LENGTH (VALUE_TYPE (*args)) > 8)
// OBSOLETE {
// OBSOLETE /* XXX Wrong, we want a pointer to this argument. */
// OBSOLETE len = TYPE_LENGTH (VALUE_TYPE (*args));
// OBSOLETE val = (char *) VALUE_CONTENTS (*args);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE len = TYPE_LENGTH (VALUE_TYPE (*args));
// OBSOLETE val = (char *) VALUE_CONTENTS (*args);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (regsused < 2
// OBSOLETE && (len <= 2
// OBSOLETE || TYPE_CODE (VALUE_TYPE (*args)) == TYPE_CODE_PTR))
// OBSOLETE {
// OBSOLETE write_register (regsused, extract_unsigned_integer (val, 4));
// OBSOLETE regsused++;
// OBSOLETE }
// OBSOLETE else if (regsused == 0 && len == 4)
// OBSOLETE {
// OBSOLETE write_register (regsused, extract_unsigned_integer (val, 2));
// OBSOLETE write_register (regsused + 1, extract_unsigned_integer (val + 2, 2));
// OBSOLETE regsused = 2;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE regsused = 2;
// OBSOLETE while (len > 0)
// OBSOLETE {
// OBSOLETE write_memory (sp + stack_offset, val, 2);
// OBSOLETE
// OBSOLETE len -= 2;
// OBSOLETE val += 2;
// OBSOLETE stack_offset += 2;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE args++;
// OBSOLETE }
// OBSOLETE
// OBSOLETE return sp;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: push_return_address (pc)
// OBSOLETE Set up the return address for the inferior function call.
// OBSOLETE Needed for targets where we don't actually execute a JSR/BSR instruction */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE mn10200_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
// OBSOLETE {
// OBSOLETE unsigned char buf[4];
// OBSOLETE
// OBSOLETE store_unsigned_integer (buf, 4, CALL_DUMMY_ADDRESS ());
// OBSOLETE write_memory (sp - 4, buf, 4);
// OBSOLETE return sp - 4;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: store_struct_return (addr,sp)
// OBSOLETE Store the structure value return address for an inferior function
// OBSOLETE call. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE mn10200_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
// OBSOLETE {
// OBSOLETE /* The structure return address is passed as the first argument. */
// OBSOLETE write_register (0, addr);
// OBSOLETE return sp;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: frame_saved_pc
// OBSOLETE Find the caller of this frame. We do this by seeing if RP_REGNUM
// OBSOLETE is saved in the stack anywhere, otherwise we get it from the
// OBSOLETE registers. If the inner frame is a dummy frame, return its PC
// OBSOLETE instead of RP, because that's where "caller" of the dummy-frame
// OBSOLETE will be found. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE mn10200_frame_saved_pc (struct frame_info *fi)
// OBSOLETE {
// OBSOLETE /* The saved PC will always be at the base of the current frame. */
// OBSOLETE return (read_memory_integer (get_frame_base (fi), REGISTER_SIZE) & 0xffffff);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Function: init_extra_frame_info
// OBSOLETE Setup the frame's frame pointer, pc, and frame addresses for saved
// OBSOLETE registers. Most of the work is done in mn10200_analyze_prologue().
// OBSOLETE
// OBSOLETE Note that when we are called for the last frame (currently active frame),
// OBSOLETE that get_frame_pc (fi) and fi->frame will already be setup. However, fi->frame will
// OBSOLETE be valid only if this routine uses FP. For previous frames, fi-frame will
// OBSOLETE always be correct. mn10200_analyze_prologue will fix fi->frame if
// OBSOLETE it's not valid.
// OBSOLETE
// OBSOLETE We can be called with the PC in the call dummy under two circumstances.
// OBSOLETE First, during normal backtracing, second, while figuring out the frame
// OBSOLETE pointer just prior to calling the target function (see run_stack_dummy). */
// OBSOLETE
// OBSOLETE void
// OBSOLETE mn10200_init_extra_frame_info (struct frame_info *fi)
// OBSOLETE {
// OBSOLETE if (get_next_frame (fi))
// OBSOLETE deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
// OBSOLETE
// OBSOLETE memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs);
// OBSOLETE fi->status = 0;
// OBSOLETE fi->stack_size = 0;
// OBSOLETE
// OBSOLETE mn10200_analyze_prologue (fi, 0);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE _initialize_mn10200_tdep (void)
// OBSOLETE {
// OBSOLETE tm_print_insn = print_insn_mn10200;
// OBSOLETE }

View file

@ -1,946 +0,0 @@
// OBSOLETE /****************************************************************************
// OBSOLETE
// OBSOLETE THIS SOFTWARE IS NOT COPYRIGHTED
// OBSOLETE
// OBSOLETE HP offers the following for use in the public domain. HP makes no
// OBSOLETE warranty with regard to the software or it's performance and the
// OBSOLETE user accepts the software "AS IS" with all faults.
// OBSOLETE
// OBSOLETE HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
// OBSOLETE TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OBSOLETE OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
// OBSOLETE
// OBSOLETE ****************************************************************************/
// OBSOLETE
// OBSOLETE /****************************************************************************
// OBSOLETE * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
// OBSOLETE *
// OBSOLETE * Module name: remcom.c $
// OBSOLETE * Revision: 1.34 $
// OBSOLETE * Date: 91/03/09 12:29:49 $
// OBSOLETE * Contributor: Lake Stevens Instrument Division$
// OBSOLETE *
// OBSOLETE * Description: low level support for gdb debugger. $
// OBSOLETE *
// OBSOLETE * Considerations: only works on target hardware $
// OBSOLETE *
// OBSOLETE * Written by: Glenn Engel $
// OBSOLETE * ModuleState: Experimental $
// OBSOLETE *
// OBSOLETE * NOTES: See Below $
// OBSOLETE *
// OBSOLETE * Modified for SPARC by Stu Grossman, Cygnus Support.
// OBSOLETE * Based on sparc-stub.c, it's modified for SPARClite Debug Unit hardware
// OBSOLETE * breakpoint support to create sparclite-stub.c, by Kung Hsu, Cygnus Support.
// OBSOLETE *
// OBSOLETE * This code has been extensively tested on the Fujitsu SPARClite demo board.
// OBSOLETE *
// OBSOLETE * To enable debugger support, two things need to happen. One, a
// OBSOLETE * call to set_debug_traps() is necessary in order to allow any breakpoints
// OBSOLETE * or error conditions to be properly intercepted and reported to gdb.
// OBSOLETE * Two, a breakpoint needs to be generated to begin communication. This
// OBSOLETE * is most easily accomplished by a call to breakpoint(). Breakpoint()
// OBSOLETE * simulates a breakpoint by executing a trap #1.
// OBSOLETE *
// OBSOLETE *************
// OBSOLETE *
// OBSOLETE * The following gdb commands are supported:
// OBSOLETE *
// OBSOLETE * command function Return value
// OBSOLETE *
// OBSOLETE * g return the value of the CPU registers hex data or ENN
// OBSOLETE * G set the value of the CPU registers OK or ENN
// OBSOLETE * P set the value of a single CPU register OK or ENN
// OBSOLETE *
// OBSOLETE * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
// OBSOLETE * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
// OBSOLETE *
// OBSOLETE * c Resume at current address SNN ( signal NN)
// OBSOLETE * cAA..AA Continue at address AA..AA SNN
// OBSOLETE *
// OBSOLETE * s Step one instruction SNN
// OBSOLETE * sAA..AA Step one instruction from AA..AA SNN
// OBSOLETE *
// OBSOLETE * k kill
// OBSOLETE *
// OBSOLETE * ? What was the last sigval ? SNN (signal NN)
// OBSOLETE *
// OBSOLETE * All commands and responses are sent with a packet which includes a
// OBSOLETE * checksum. A packet consists of
// OBSOLETE *
// OBSOLETE * $<packet info>#<checksum>.
// OBSOLETE *
// OBSOLETE * where
// OBSOLETE * <packet info> :: <characters representing the command or response>
// OBSOLETE * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
// OBSOLETE *
// OBSOLETE * When a packet is received, it is first acknowledged with either '+' or '-'.
// OBSOLETE * '+' indicates a successful transfer. '-' indicates a failed transfer.
// OBSOLETE *
// OBSOLETE * Example:
// OBSOLETE *
// OBSOLETE * Host: Reply:
// OBSOLETE * $m0,10#2a +$00010203040506070809101112131415#42
// OBSOLETE *
// OBSOLETE ****************************************************************************/
// OBSOLETE
// OBSOLETE #include <string.h>
// OBSOLETE #include <signal.h>
// OBSOLETE #include <sparclite.h>
// OBSOLETE
// OBSOLETE /************************************************************************
// OBSOLETE *
// OBSOLETE * external low-level support routines
// OBSOLETE */
// OBSOLETE
// OBSOLETE extern void putDebugChar (int c); /* write a single character */
// OBSOLETE extern int getDebugChar (void); /* read and return a single char */
// OBSOLETE
// OBSOLETE /************************************************************************/
// OBSOLETE /* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
// OBSOLETE /* at least NUMREGBYTES*2 are needed for register packets */
// OBSOLETE #define BUFMAX 2048
// OBSOLETE
// OBSOLETE static int initialized = 0; /* !0 means we've been initialized */
// OBSOLETE
// OBSOLETE extern void breakinst ();
// OBSOLETE static void set_mem_fault_trap (int enable);
// OBSOLETE static void get_in_break_mode (void);
// OBSOLETE
// OBSOLETE static const char hexchars[]="0123456789abcdef";
// OBSOLETE
// OBSOLETE #define NUMREGS 80
// OBSOLETE
// OBSOLETE /* Number of bytes of registers. */
// OBSOLETE #define NUMREGBYTES (NUMREGS * 4)
// OBSOLETE enum regnames {G0, G1, G2, G3, G4, G5, G6, G7,
// OBSOLETE O0, O1, O2, O3, O4, O5, SP, O7,
// OBSOLETE L0, L1, L2, L3, L4, L5, L6, L7,
// OBSOLETE I0, I1, I2, I3, I4, I5, FP, I7,
// OBSOLETE
// OBSOLETE F0, F1, F2, F3, F4, F5, F6, F7,
// OBSOLETE F8, F9, F10, F11, F12, F13, F14, F15,
// OBSOLETE F16, F17, F18, F19, F20, F21, F22, F23,
// OBSOLETE F24, F25, F26, F27, F28, F29, F30, F31,
// OBSOLETE Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR,
// OBSOLETE DIA1, DIA2, DDA1, DDA2, DDV1, DDV2, DCR, DSR };
// OBSOLETE
// OBSOLETE /*************************** ASSEMBLY CODE MACROS *************************/
// OBSOLETE /* */
// OBSOLETE
// OBSOLETE extern void trap_low();
// OBSOLETE
// OBSOLETE /* Create private copies of common functions used by the stub. This prevents
// OBSOLETE nasty interactions between app code and the stub (for instance if user steps
// OBSOLETE into strlen, etc..) */
// OBSOLETE
// OBSOLETE static char *
// OBSOLETE strcpy (char *dst, const char *src)
// OBSOLETE {
// OBSOLETE char *retval = dst;
// OBSOLETE
// OBSOLETE while ((*dst++ = *src++) != '\000');
// OBSOLETE
// OBSOLETE return retval;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void *
// OBSOLETE memcpy (void *vdst, const void *vsrc, int n)
// OBSOLETE {
// OBSOLETE char *dst = vdst;
// OBSOLETE const char *src = vsrc;
// OBSOLETE char *retval = dst;
// OBSOLETE
// OBSOLETE while (n-- > 0)
// OBSOLETE *dst++ = *src++;
// OBSOLETE
// OBSOLETE return retval;
// OBSOLETE }
// OBSOLETE
// OBSOLETE asm("
// OBSOLETE .reserve trapstack, 1000 * 4, \"bss\", 8
// OBSOLETE
// OBSOLETE .data
// OBSOLETE .align 4
// OBSOLETE
// OBSOLETE in_trap_handler:
// OBSOLETE .word 0
// OBSOLETE
// OBSOLETE .text
// OBSOLETE .align 4
// OBSOLETE
// OBSOLETE ! This function is called when any SPARC trap (except window overflow or
// OBSOLETE ! underflow) occurs. It makes sure that the invalid register window is still
// OBSOLETE ! available before jumping into C code. It will also restore the world if you
// OBSOLETE ! return from handle_exception.
// OBSOLETE !
// OBSOLETE ! On entry, trap_low expects l1 and l2 to contain pc and npc respectivly.
// OBSOLETE ! Register usage throughout the routine is as follows:
// OBSOLETE !
// OBSOLETE ! l0 - psr
// OBSOLETE ! l1 - pc
// OBSOLETE ! l2 - npc
// OBSOLETE ! l3 - wim
// OBSOLETE ! l4 - scratch and y reg
// OBSOLETE ! l5 - scratch and tbr
// OBSOLETE ! l6 - unused
// OBSOLETE ! l7 - unused
// OBSOLETE
// OBSOLETE .globl _trap_low
// OBSOLETE _trap_low:
// OBSOLETE mov %psr, %l0
// OBSOLETE mov %wim, %l3
// OBSOLETE
// OBSOLETE srl %l3, %l0, %l4 ! wim >> cwp
// OBSOLETE cmp %l4, 1
// OBSOLETE bne window_fine ! Branch if not in the invalid window
// OBSOLETE nop
// OBSOLETE
// OBSOLETE ! Handle window overflow
// OBSOLETE
// OBSOLETE mov %g1, %l4 ! Save g1, we use it to hold the wim
// OBSOLETE srl %l3, 1, %g1 ! Rotate wim right
// OBSOLETE tst %g1
// OBSOLETE bg good_wim ! Branch if new wim is non-zero
// OBSOLETE nop
// OBSOLETE
// OBSOLETE ! At this point, we need to bring a 1 into the high order bit of the wim.
// OBSOLETE ! Since we don't want to make any assumptions about the number of register
// OBSOLETE ! windows, we figure it out dynamically so as to setup the wim correctly.
// OBSOLETE
// OBSOLETE not %g1 ! Fill g1 with ones
// OBSOLETE mov %g1, %wim ! Fill the wim with ones
// OBSOLETE nop
// OBSOLETE nop
// OBSOLETE nop
// OBSOLETE mov %wim, %g1 ! Read back the wim
// OBSOLETE inc %g1 ! Now g1 has 1 just to left of wim
// OBSOLETE srl %g1, 1, %g1 ! Now put 1 at top of wim
// OBSOLETE mov %g0, %wim ! Clear wim so that subsequent save
// OBSOLETE nop ! won't trap
// OBSOLETE nop
// OBSOLETE nop
// OBSOLETE
// OBSOLETE good_wim:
// OBSOLETE save %g0, %g0, %g0 ! Slip into next window
// OBSOLETE mov %g1, %wim ! Install the new wim
// OBSOLETE
// OBSOLETE std %l0, [%sp + 0 * 4] ! save L & I registers
// OBSOLETE std %l2, [%sp + 2 * 4]
// OBSOLETE std %l4, [%sp + 4 * 4]
// OBSOLETE std %l6, [%sp + 6 * 4]
// OBSOLETE
// OBSOLETE std %i0, [%sp + 8 * 4]
// OBSOLETE std %i2, [%sp + 10 * 4]
// OBSOLETE std %i4, [%sp + 12 * 4]
// OBSOLETE std %i6, [%sp + 14 * 4]
// OBSOLETE
// OBSOLETE restore ! Go back to trap window.
// OBSOLETE mov %l4, %g1 ! Restore %g1
// OBSOLETE
// OBSOLETE window_fine:
// OBSOLETE sethi %hi(in_trap_handler), %l4
// OBSOLETE ld [%lo(in_trap_handler) + %l4], %l5
// OBSOLETE tst %l5
// OBSOLETE bg recursive_trap
// OBSOLETE inc %l5
// OBSOLETE
// OBSOLETE set trapstack+1000*4, %sp ! Switch to trap stack
// OBSOLETE
// OBSOLETE recursive_trap:
// OBSOLETE st %l5, [%lo(in_trap_handler) + %l4]
// OBSOLETE sub %sp,(16+1+6+1+80)*4,%sp ! Make room for input & locals
// OBSOLETE ! + hidden arg + arg spill
// OBSOLETE ! + doubleword alignment
// OBSOLETE ! + registers[72] local var
// OBSOLETE
// OBSOLETE std %g0, [%sp + (24 + 0) * 4] ! registers[Gx]
// OBSOLETE std %g2, [%sp + (24 + 2) * 4]
// OBSOLETE std %g4, [%sp + (24 + 4) * 4]
// OBSOLETE std %g6, [%sp + (24 + 6) * 4]
// OBSOLETE
// OBSOLETE std %i0, [%sp + (24 + 8) * 4] ! registers[Ox]
// OBSOLETE std %i2, [%sp + (24 + 10) * 4]
// OBSOLETE std %i4, [%sp + (24 + 12) * 4]
// OBSOLETE std %i6, [%sp + (24 + 14) * 4]
// OBSOLETE
// OBSOLETE mov %y, %l4
// OBSOLETE mov %tbr, %l5
// OBSOLETE st %l4, [%sp + (24 + 64) * 4] ! Y
// OBSOLETE st %l0, [%sp + (24 + 65) * 4] ! PSR
// OBSOLETE st %l3, [%sp + (24 + 66) * 4] ! WIM
// OBSOLETE st %l5, [%sp + (24 + 67) * 4] ! TBR
// OBSOLETE st %l1, [%sp + (24 + 68) * 4] ! PC
// OBSOLETE st %l2, [%sp + (24 + 69) * 4] ! NPC
// OBSOLETE
// OBSOLETE or %l0, 0xf20, %l4
// OBSOLETE mov %l4, %psr ! Turn on traps, disable interrupts
// OBSOLETE
// OBSOLETE set 0x1000, %l1
// OBSOLETE btst %l1, %l0 ! FP enabled?
// OBSOLETE be no_fpstore
// OBSOLETE nop
// OBSOLETE
// OBSOLETE ! Must save fsr first, to flush the FQ. This may cause a deferred fp trap, so
// OBSOLETE ! traps must be enabled to allow the trap handler to clean things up.
// OBSOLETE
// OBSOLETE st %fsr, [%sp + (24 + 70) * 4]
// OBSOLETE
// OBSOLETE std %f0, [%sp + (24 + 32) * 4]
// OBSOLETE std %f2, [%sp + (24 + 34) * 4]
// OBSOLETE std %f4, [%sp + (24 + 36) * 4]
// OBSOLETE std %f6, [%sp + (24 + 38) * 4]
// OBSOLETE std %f8, [%sp + (24 + 40) * 4]
// OBSOLETE std %f10, [%sp + (24 + 42) * 4]
// OBSOLETE std %f12, [%sp + (24 + 44) * 4]
// OBSOLETE std %f14, [%sp + (24 + 46) * 4]
// OBSOLETE std %f16, [%sp + (24 + 48) * 4]
// OBSOLETE std %f18, [%sp + (24 + 50) * 4]
// OBSOLETE std %f20, [%sp + (24 + 52) * 4]
// OBSOLETE std %f22, [%sp + (24 + 54) * 4]
// OBSOLETE std %f24, [%sp + (24 + 56) * 4]
// OBSOLETE std %f26, [%sp + (24 + 58) * 4]
// OBSOLETE std %f28, [%sp + (24 + 60) * 4]
// OBSOLETE std %f30, [%sp + (24 + 62) * 4]
// OBSOLETE no_fpstore:
// OBSOLETE
// OBSOLETE call _handle_exception
// OBSOLETE add %sp, 24 * 4, %o0 ! Pass address of registers
// OBSOLETE
// OBSOLETE ! Reload all of the registers that aren't on the stack
// OBSOLETE
// OBSOLETE ld [%sp + (24 + 1) * 4], %g1 ! registers[Gx]
// OBSOLETE ldd [%sp + (24 + 2) * 4], %g2
// OBSOLETE ldd [%sp + (24 + 4) * 4], %g4
// OBSOLETE ldd [%sp + (24 + 6) * 4], %g6
// OBSOLETE
// OBSOLETE ldd [%sp + (24 + 8) * 4], %i0 ! registers[Ox]
// OBSOLETE ldd [%sp + (24 + 10) * 4], %i2
// OBSOLETE ldd [%sp + (24 + 12) * 4], %i4
// OBSOLETE ldd [%sp + (24 + 14) * 4], %i6
// OBSOLETE
// OBSOLETE
// OBSOLETE ldd [%sp + (24 + 64) * 4], %l0 ! Y & PSR
// OBSOLETE ldd [%sp + (24 + 68) * 4], %l2 ! PC & NPC
// OBSOLETE
// OBSOLETE set 0x1000, %l5
// OBSOLETE btst %l5, %l1 ! FP enabled?
// OBSOLETE be no_fpreload
// OBSOLETE nop
// OBSOLETE
// OBSOLETE ldd [%sp + (24 + 32) * 4], %f0
// OBSOLETE ldd [%sp + (24 + 34) * 4], %f2
// OBSOLETE ldd [%sp + (24 + 36) * 4], %f4
// OBSOLETE ldd [%sp + (24 + 38) * 4], %f6
// OBSOLETE ldd [%sp + (24 + 40) * 4], %f8
// OBSOLETE ldd [%sp + (24 + 42) * 4], %f10
// OBSOLETE ldd [%sp + (24 + 44) * 4], %f12
// OBSOLETE ldd [%sp + (24 + 46) * 4], %f14
// OBSOLETE ldd [%sp + (24 + 48) * 4], %f16
// OBSOLETE ldd [%sp + (24 + 50) * 4], %f18
// OBSOLETE ldd [%sp + (24 + 52) * 4], %f20
// OBSOLETE ldd [%sp + (24 + 54) * 4], %f22
// OBSOLETE ldd [%sp + (24 + 56) * 4], %f24
// OBSOLETE ldd [%sp + (24 + 58) * 4], %f26
// OBSOLETE ldd [%sp + (24 + 60) * 4], %f28
// OBSOLETE ldd [%sp + (24 + 62) * 4], %f30
// OBSOLETE
// OBSOLETE ld [%sp + (24 + 70) * 4], %fsr
// OBSOLETE no_fpreload:
// OBSOLETE
// OBSOLETE restore ! Ensure that previous window is valid
// OBSOLETE save %g0, %g0, %g0 ! by causing a window_underflow trap
// OBSOLETE
// OBSOLETE mov %l0, %y
// OBSOLETE mov %l1, %psr ! Make sure that traps are disabled
// OBSOLETE ! for rett
// OBSOLETE sethi %hi(in_trap_handler), %l4
// OBSOLETE ld [%lo(in_trap_handler) + %l4], %l5
// OBSOLETE dec %l5
// OBSOLETE st %l5, [%lo(in_trap_handler) + %l4]
// OBSOLETE
// OBSOLETE jmpl %l2, %g0 ! Restore old PC
// OBSOLETE rett %l3 ! Restore old nPC
// OBSOLETE ");
// OBSOLETE
// OBSOLETE /* Convert ch from a hex digit to an int */
// OBSOLETE
// OBSOLETE static int
// OBSOLETE hex (unsigned char ch)
// OBSOLETE {
// OBSOLETE if (ch >= 'a' && ch <= 'f')
// OBSOLETE return ch-'a'+10;
// OBSOLETE if (ch >= '0' && ch <= '9')
// OBSOLETE return ch-'0';
// OBSOLETE if (ch >= 'A' && ch <= 'F')
// OBSOLETE return ch-'A'+10;
// OBSOLETE return -1;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static char remcomInBuffer[BUFMAX];
// OBSOLETE static char remcomOutBuffer[BUFMAX];
// OBSOLETE
// OBSOLETE /* scan for the sequence $<data>#<checksum> */
// OBSOLETE
// OBSOLETE unsigned char *
// OBSOLETE getpacket (void)
// OBSOLETE {
// OBSOLETE unsigned char *buffer = &remcomInBuffer[0];
// OBSOLETE unsigned char checksum;
// OBSOLETE unsigned char xmitcsum;
// OBSOLETE int count;
// OBSOLETE char ch;
// OBSOLETE
// OBSOLETE while (1)
// OBSOLETE {
// OBSOLETE /* wait around for the start character, ignore all other characters */
// OBSOLETE while ((ch = getDebugChar ()) != '$')
// OBSOLETE ;
// OBSOLETE
// OBSOLETE retry:
// OBSOLETE checksum = 0;
// OBSOLETE xmitcsum = -1;
// OBSOLETE count = 0;
// OBSOLETE
// OBSOLETE /* now, read until a # or end of buffer is found */
// OBSOLETE while (count < BUFMAX)
// OBSOLETE {
// OBSOLETE ch = getDebugChar ();
// OBSOLETE if (ch == '$')
// OBSOLETE goto retry;
// OBSOLETE if (ch == '#')
// OBSOLETE break;
// OBSOLETE checksum = checksum + ch;
// OBSOLETE buffer[count] = ch;
// OBSOLETE count = count + 1;
// OBSOLETE }
// OBSOLETE buffer[count] = 0;
// OBSOLETE
// OBSOLETE if (ch == '#')
// OBSOLETE {
// OBSOLETE ch = getDebugChar ();
// OBSOLETE xmitcsum = hex (ch) << 4;
// OBSOLETE ch = getDebugChar ();
// OBSOLETE xmitcsum += hex (ch);
// OBSOLETE
// OBSOLETE if (checksum != xmitcsum)
// OBSOLETE {
// OBSOLETE putDebugChar ('-'); /* failed checksum */
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE putDebugChar ('+'); /* successful transfer */
// OBSOLETE
// OBSOLETE /* if a sequence char is present, reply the sequence ID */
// OBSOLETE if (buffer[2] == ':')
// OBSOLETE {
// OBSOLETE putDebugChar (buffer[0]);
// OBSOLETE putDebugChar (buffer[1]);
// OBSOLETE
// OBSOLETE return &buffer[3];
// OBSOLETE }
// OBSOLETE
// OBSOLETE return &buffer[0];
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* send the packet in buffer. */
// OBSOLETE
// OBSOLETE static void
// OBSOLETE putpacket (unsigned char *buffer)
// OBSOLETE {
// OBSOLETE unsigned char checksum;
// OBSOLETE int count;
// OBSOLETE unsigned char ch;
// OBSOLETE
// OBSOLETE /* $<packet info>#<checksum>. */
// OBSOLETE do
// OBSOLETE {
// OBSOLETE putDebugChar('$');
// OBSOLETE checksum = 0;
// OBSOLETE count = 0;
// OBSOLETE
// OBSOLETE while (ch = buffer[count])
// OBSOLETE {
// OBSOLETE putDebugChar (ch);
// OBSOLETE checksum += ch;
// OBSOLETE count += 1;
// OBSOLETE }
// OBSOLETE
// OBSOLETE putDebugChar('#');
// OBSOLETE putDebugChar(hexchars[checksum >> 4]);
// OBSOLETE putDebugChar(hexchars[checksum & 0xf]);
// OBSOLETE
// OBSOLETE }
// OBSOLETE while (getDebugChar() != '+');
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Indicate to caller of mem2hex or hex2mem that there has been an
// OBSOLETE error. */
// OBSOLETE static volatile int mem_err = 0;
// OBSOLETE
// OBSOLETE /* Convert the memory pointed to by mem into hex, placing result in buf.
// OBSOLETE * Return a pointer to the last char put in buf (null), in case of mem fault,
// OBSOLETE * return 0.
// OBSOLETE * If MAY_FAULT is non-zero, then we will handle memory faults by returning
// OBSOLETE * a 0, else treat a fault like any other fault in the stub.
// OBSOLETE */
// OBSOLETE
// OBSOLETE static unsigned char *
// OBSOLETE mem2hex (unsigned char *mem, unsigned char *buf, int count, int may_fault)
// OBSOLETE {
// OBSOLETE unsigned char ch;
// OBSOLETE
// OBSOLETE set_mem_fault_trap(may_fault);
// OBSOLETE
// OBSOLETE while (count-- > 0)
// OBSOLETE {
// OBSOLETE ch = *mem++;
// OBSOLETE if (mem_err)
// OBSOLETE return 0;
// OBSOLETE *buf++ = hexchars[ch >> 4];
// OBSOLETE *buf++ = hexchars[ch & 0xf];
// OBSOLETE }
// OBSOLETE
// OBSOLETE *buf = 0;
// OBSOLETE
// OBSOLETE set_mem_fault_trap(0);
// OBSOLETE
// OBSOLETE return buf;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* convert the hex array pointed to by buf into binary to be placed in mem
// OBSOLETE * return a pointer to the character AFTER the last byte written */
// OBSOLETE
// OBSOLETE static char *
// OBSOLETE hex2mem (unsigned char *buf, unsigned char *mem, int count, int may_fault)
// OBSOLETE {
// OBSOLETE int i;
// OBSOLETE unsigned char ch;
// OBSOLETE
// OBSOLETE set_mem_fault_trap(may_fault);
// OBSOLETE
// OBSOLETE for (i=0; i<count; i++)
// OBSOLETE {
// OBSOLETE ch = hex(*buf++) << 4;
// OBSOLETE ch |= hex(*buf++);
// OBSOLETE *mem++ = ch;
// OBSOLETE if (mem_err)
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE set_mem_fault_trap(0);
// OBSOLETE
// OBSOLETE return mem;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* This table contains the mapping between SPARC hardware trap types, and
// OBSOLETE signals, which are primarily what GDB understands. It also indicates
// OBSOLETE which hardware traps we need to commandeer when initializing the stub. */
// OBSOLETE
// OBSOLETE static struct hard_trap_info
// OBSOLETE {
// OBSOLETE unsigned char tt; /* Trap type code for SPARClite */
// OBSOLETE unsigned char signo; /* Signal that we map this trap into */
// OBSOLETE } hard_trap_info[] = {
// OBSOLETE {0x01, SIGSEGV}, /* instruction access error */
// OBSOLETE {0x02, SIGILL}, /* privileged instruction */
// OBSOLETE {0x03, SIGILL}, /* illegal instruction */
// OBSOLETE {0x04, SIGEMT}, /* fp disabled */
// OBSOLETE {0x07, SIGBUS}, /* mem address not aligned */
// OBSOLETE {0x09, SIGSEGV}, /* data access exception */
// OBSOLETE {0x0a, SIGEMT}, /* tag overflow */
// OBSOLETE {0x20, SIGBUS}, /* r register access error */
// OBSOLETE {0x21, SIGBUS}, /* instruction access error */
// OBSOLETE {0x24, SIGEMT}, /* cp disabled */
// OBSOLETE {0x29, SIGBUS}, /* data access error */
// OBSOLETE {0x2a, SIGFPE}, /* divide by zero */
// OBSOLETE {0x2b, SIGBUS}, /* data store error */
// OBSOLETE {0x80+1, SIGTRAP}, /* ta 1 - normal breakpoint instruction */
// OBSOLETE {0xff, SIGTRAP}, /* hardware breakpoint */
// OBSOLETE {0, 0} /* Must be last */
// OBSOLETE };
// OBSOLETE
// OBSOLETE /* Set up exception handlers for tracing and breakpoints */
// OBSOLETE
// OBSOLETE void
// OBSOLETE set_debug_traps (void)
// OBSOLETE {
// OBSOLETE struct hard_trap_info *ht;
// OBSOLETE
// OBSOLETE /* Only setup fp traps if the FP is disabled. */
// OBSOLETE
// OBSOLETE for (ht = hard_trap_info;
// OBSOLETE ht->tt != 0 && ht->signo != 0;
// OBSOLETE ht++)
// OBSOLETE if (ht->tt != 4 || ! (read_psr () & 0x1000))
// OBSOLETE exceptionHandler(ht->tt, trap_low);
// OBSOLETE
// OBSOLETE initialized = 1;
// OBSOLETE }
// OBSOLETE
// OBSOLETE asm ("
// OBSOLETE ! Trap handler for memory errors. This just sets mem_err to be non-zero. It
// OBSOLETE ! assumes that %l1 is non-zero. This should be safe, as it is doubtful that
// OBSOLETE ! 0 would ever contain code that could mem fault. This routine will skip
// OBSOLETE ! past the faulting instruction after setting mem_err.
// OBSOLETE
// OBSOLETE .text
// OBSOLETE .align 4
// OBSOLETE
// OBSOLETE _fltr_set_mem_err:
// OBSOLETE sethi %hi(_mem_err), %l0
// OBSOLETE st %l1, [%l0 + %lo(_mem_err)]
// OBSOLETE jmpl %l2, %g0
// OBSOLETE rett %l2+4
// OBSOLETE ");
// OBSOLETE
// OBSOLETE static void
// OBSOLETE set_mem_fault_trap (int enable)
// OBSOLETE {
// OBSOLETE extern void fltr_set_mem_err();
// OBSOLETE mem_err = 0;
// OBSOLETE
// OBSOLETE if (enable)
// OBSOLETE exceptionHandler(9, fltr_set_mem_err);
// OBSOLETE else
// OBSOLETE exceptionHandler(9, trap_low);
// OBSOLETE }
// OBSOLETE
// OBSOLETE asm ("
// OBSOLETE .text
// OBSOLETE .align 4
// OBSOLETE
// OBSOLETE _dummy_hw_breakpoint:
// OBSOLETE jmpl %l2, %g0
// OBSOLETE rett %l2+4
// OBSOLETE nop
// OBSOLETE nop
// OBSOLETE ");
// OBSOLETE
// OBSOLETE static void
// OBSOLETE get_in_break_mode (void)
// OBSOLETE {
// OBSOLETE extern void dummy_hw_breakpoint();
// OBSOLETE
// OBSOLETE exceptionHandler (255, dummy_hw_breakpoint);
// OBSOLETE
// OBSOLETE asm ("ta 255");
// OBSOLETE
// OBSOLETE exceptionHandler (255, trap_low);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Convert the SPARC hardware trap type code to a unix signal number. */
// OBSOLETE
// OBSOLETE static int
// OBSOLETE computeSignal (int tt)
// OBSOLETE {
// OBSOLETE struct hard_trap_info *ht;
// OBSOLETE
// OBSOLETE for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
// OBSOLETE if (ht->tt == tt)
// OBSOLETE return ht->signo;
// OBSOLETE
// OBSOLETE return SIGHUP; /* default for things we don't know about */
// OBSOLETE }
// OBSOLETE
// OBSOLETE /*
// OBSOLETE * While we find nice hex chars, build an int.
// OBSOLETE * Return number of chars processed.
// OBSOLETE */
// OBSOLETE
// OBSOLETE static int
// OBSOLETE hexToInt(char **ptr, int *intValue)
// OBSOLETE {
// OBSOLETE int numChars = 0;
// OBSOLETE int hexValue;
// OBSOLETE
// OBSOLETE *intValue = 0;
// OBSOLETE
// OBSOLETE while (**ptr)
// OBSOLETE {
// OBSOLETE hexValue = hex(**ptr);
// OBSOLETE if (hexValue < 0)
// OBSOLETE break;
// OBSOLETE
// OBSOLETE *intValue = (*intValue << 4) | hexValue;
// OBSOLETE numChars ++;
// OBSOLETE
// OBSOLETE (*ptr)++;
// OBSOLETE }
// OBSOLETE
// OBSOLETE return (numChars);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /*
// OBSOLETE * This function does all command procesing for interfacing to gdb. It
// OBSOLETE * returns 1 if you should skip the instruction at the trap address, 0
// OBSOLETE * otherwise.
// OBSOLETE */
// OBSOLETE
// OBSOLETE static void
// OBSOLETE handle_exception (unsigned long *registers)
// OBSOLETE {
// OBSOLETE int tt; /* Trap type */
// OBSOLETE int sigval;
// OBSOLETE int addr;
// OBSOLETE int length;
// OBSOLETE char *ptr;
// OBSOLETE unsigned long *sp;
// OBSOLETE unsigned long dsr;
// OBSOLETE
// OBSOLETE /* First, we must force all of the windows to be spilled out */
// OBSOLETE
// OBSOLETE asm(" save %sp, -64, %sp
// OBSOLETE save %sp, -64, %sp
// OBSOLETE save %sp, -64, %sp
// OBSOLETE save %sp, -64, %sp
// OBSOLETE save %sp, -64, %sp
// OBSOLETE save %sp, -64, %sp
// OBSOLETE save %sp, -64, %sp
// OBSOLETE save %sp, -64, %sp
// OBSOLETE restore
// OBSOLETE restore
// OBSOLETE restore
// OBSOLETE restore
// OBSOLETE restore
// OBSOLETE restore
// OBSOLETE restore
// OBSOLETE restore
// OBSOLETE ");
// OBSOLETE
// OBSOLETE get_in_break_mode (); /* Enable DSU register writes */
// OBSOLETE
// OBSOLETE registers[DIA1] = read_asi (1, 0xff00);
// OBSOLETE registers[DIA2] = read_asi (1, 0xff04);
// OBSOLETE registers[DDA1] = read_asi (1, 0xff08);
// OBSOLETE registers[DDA2] = read_asi (1, 0xff0c);
// OBSOLETE registers[DDV1] = read_asi (1, 0xff10);
// OBSOLETE registers[DDV2] = read_asi (1, 0xff14);
// OBSOLETE registers[DCR] = read_asi (1, 0xff18);
// OBSOLETE registers[DSR] = read_asi (1, 0xff1c);
// OBSOLETE
// OBSOLETE if (registers[PC] == (unsigned long)breakinst)
// OBSOLETE {
// OBSOLETE registers[PC] = registers[NPC];
// OBSOLETE registers[NPC] += 4;
// OBSOLETE }
// OBSOLETE sp = (unsigned long *)registers[SP];
// OBSOLETE
// OBSOLETE dsr = (unsigned long)registers[DSR];
// OBSOLETE if (dsr & 0x3c)
// OBSOLETE tt = 255;
// OBSOLETE else
// OBSOLETE tt = (registers[TBR] >> 4) & 0xff;
// OBSOLETE
// OBSOLETE /* reply to host that an exception has occurred */
// OBSOLETE sigval = computeSignal(tt);
// OBSOLETE ptr = remcomOutBuffer;
// OBSOLETE
// OBSOLETE *ptr++ = 'T';
// OBSOLETE *ptr++ = hexchars[sigval >> 4];
// OBSOLETE *ptr++ = hexchars[sigval & 0xf];
// OBSOLETE
// OBSOLETE *ptr++ = hexchars[PC >> 4];
// OBSOLETE *ptr++ = hexchars[PC & 0xf];
// OBSOLETE *ptr++ = ':';
// OBSOLETE ptr = mem2hex((char *)&registers[PC], ptr, 4, 0);
// OBSOLETE *ptr++ = ';';
// OBSOLETE
// OBSOLETE *ptr++ = hexchars[FP >> 4];
// OBSOLETE *ptr++ = hexchars[FP & 0xf];
// OBSOLETE *ptr++ = ':';
// OBSOLETE ptr = mem2hex(sp + 8 + 6, ptr, 4, 0); /* FP */
// OBSOLETE *ptr++ = ';';
// OBSOLETE
// OBSOLETE *ptr++ = hexchars[SP >> 4];
// OBSOLETE *ptr++ = hexchars[SP & 0xf];
// OBSOLETE *ptr++ = ':';
// OBSOLETE ptr = mem2hex((char *)&sp, ptr, 4, 0);
// OBSOLETE *ptr++ = ';';
// OBSOLETE
// OBSOLETE *ptr++ = hexchars[NPC >> 4];
// OBSOLETE *ptr++ = hexchars[NPC & 0xf];
// OBSOLETE *ptr++ = ':';
// OBSOLETE ptr = mem2hex((char *)&registers[NPC], ptr, 4, 0);
// OBSOLETE *ptr++ = ';';
// OBSOLETE
// OBSOLETE *ptr++ = hexchars[O7 >> 4];
// OBSOLETE *ptr++ = hexchars[O7 & 0xf];
// OBSOLETE *ptr++ = ':';
// OBSOLETE ptr = mem2hex((char *)&registers[O7], ptr, 4, 0);
// OBSOLETE *ptr++ = ';';
// OBSOLETE
// OBSOLETE *ptr++ = 0;
// OBSOLETE
// OBSOLETE putpacket(remcomOutBuffer);
// OBSOLETE
// OBSOLETE while (1)
// OBSOLETE {
// OBSOLETE remcomOutBuffer[0] = 0;
// OBSOLETE
// OBSOLETE ptr = getpacket();
// OBSOLETE switch (*ptr++)
// OBSOLETE {
// OBSOLETE case '?':
// OBSOLETE remcomOutBuffer[0] = 'S';
// OBSOLETE remcomOutBuffer[1] = hexchars[sigval >> 4];
// OBSOLETE remcomOutBuffer[2] = hexchars[sigval & 0xf];
// OBSOLETE remcomOutBuffer[3] = 0;
// OBSOLETE break;
// OBSOLETE
// OBSOLETE case 'd':
// OBSOLETE /* toggle debug flag */
// OBSOLETE break;
// OBSOLETE
// OBSOLETE case 'g': /* return the value of the CPU registers */
// OBSOLETE memcpy (&registers[L0], sp, 16 * 4); /* Copy L & I regs from stack */
// OBSOLETE mem2hex ((char *)registers, remcomOutBuffer, NUMREGBYTES, 0);
// OBSOLETE break;
// OBSOLETE
// OBSOLETE case 'G': /* Set the value of all registers */
// OBSOLETE case 'P': /* Set the value of one register */
// OBSOLETE {
// OBSOLETE unsigned long *newsp, psr;
// OBSOLETE
// OBSOLETE psr = registers[PSR];
// OBSOLETE
// OBSOLETE if (ptr[-1] == 'P')
// OBSOLETE {
// OBSOLETE int regno;
// OBSOLETE
// OBSOLETE if (hexToInt (&ptr, &regno)
// OBSOLETE && *ptr++ == '=')
// OBSOLETE if (regno >= L0 && regno <= I7)
// OBSOLETE hex2mem (ptr, sp + regno - L0, 4, 0);
// OBSOLETE else
// OBSOLETE hex2mem (ptr, (char *)&registers[regno], 4, 0);
// OBSOLETE else
// OBSOLETE {
// OBSOLETE strcpy (remcomOutBuffer, "E01");
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE hex2mem (ptr, (char *)registers, NUMREGBYTES, 0);
// OBSOLETE memcpy (sp, &registers[L0], 16 * 4); /* Copy L & I regs to stack */
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* See if the stack pointer has moved. If so, then copy the saved
// OBSOLETE locals and ins to the new location. This keeps the window
// OBSOLETE overflow and underflow routines happy. */
// OBSOLETE
// OBSOLETE newsp = (unsigned long *)registers[SP];
// OBSOLETE if (sp != newsp)
// OBSOLETE sp = memcpy(newsp, sp, 16 * 4);
// OBSOLETE
// OBSOLETE /* Don't allow CWP to be modified. */
// OBSOLETE
// OBSOLETE if (psr != registers[PSR])
// OBSOLETE registers[PSR] = (psr & 0x1f) | (registers[PSR] & ~0x1f);
// OBSOLETE
// OBSOLETE strcpy(remcomOutBuffer,"OK");
// OBSOLETE }
// OBSOLETE break;
// OBSOLETE
// OBSOLETE case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
// OBSOLETE /* Try to read %x,%x. */
// OBSOLETE
// OBSOLETE if (hexToInt(&ptr, &addr)
// OBSOLETE && *ptr++ == ','
// OBSOLETE && hexToInt(&ptr, &length))
// OBSOLETE {
// OBSOLETE if (mem2hex((char *)addr, remcomOutBuffer, length, 1))
// OBSOLETE break;
// OBSOLETE
// OBSOLETE strcpy (remcomOutBuffer, "E03");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE strcpy(remcomOutBuffer,"E01");
// OBSOLETE break;
// OBSOLETE
// OBSOLETE case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
// OBSOLETE /* Try to read '%x,%x:'. */
// OBSOLETE
// OBSOLETE if (hexToInt(&ptr, &addr)
// OBSOLETE && *ptr++ == ','
// OBSOLETE && hexToInt(&ptr, &length)
// OBSOLETE && *ptr++ == ':')
// OBSOLETE {
// OBSOLETE if (hex2mem(ptr, (char *)addr, length, 1))
// OBSOLETE strcpy(remcomOutBuffer, "OK");
// OBSOLETE else
// OBSOLETE strcpy(remcomOutBuffer, "E03");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE strcpy(remcomOutBuffer, "E02");
// OBSOLETE break;
// OBSOLETE
// OBSOLETE case 'c': /* cAA..AA Continue at address AA..AA(optional) */
// OBSOLETE /* try to read optional parameter, pc unchanged if no parm */
// OBSOLETE if (hexToInt(&ptr, &addr))
// OBSOLETE {
// OBSOLETE registers[PC] = addr;
// OBSOLETE registers[NPC] = addr + 4;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Need to flush the instruction cache here, as we may have deposited a
// OBSOLETE breakpoint, and the icache probably has no way of knowing that a data ref to
// OBSOLETE some location may have changed something that is in the instruction cache.
// OBSOLETE */
// OBSOLETE
// OBSOLETE flush_i_cache ();
// OBSOLETE
// OBSOLETE if (!(registers[DSR] & 0x1) /* DSU enabled? */
// OBSOLETE && !(registers[DCR] & 0x200)) /* Are we in break state? */
// OBSOLETE { /* Yes, set the DSU regs */
// OBSOLETE write_asi (1, 0xff00, registers[DIA1]);
// OBSOLETE write_asi (1, 0xff04, registers[DIA2]);
// OBSOLETE write_asi (1, 0xff08, registers[DDA1]);
// OBSOLETE write_asi (1, 0xff0c, registers[DDA2]);
// OBSOLETE write_asi (1, 0xff10, registers[DDV1]);
// OBSOLETE write_asi (1, 0xff14, registers[DDV2]);
// OBSOLETE write_asi (1, 0xff1c, registers[DSR]);
// OBSOLETE write_asi (1, 0xff18, registers[DCR] | 0x200); /* Clear break */
// OBSOLETE }
// OBSOLETE
// OBSOLETE return;
// OBSOLETE
// OBSOLETE /* kill the program */
// OBSOLETE case 'k' : /* do nothing */
// OBSOLETE break;
// OBSOLETE #if 0
// OBSOLETE case 't': /* Test feature */
// OBSOLETE asm (" std %f30,[%sp]");
// OBSOLETE break;
// OBSOLETE #endif
// OBSOLETE case 'r': /* Reset */
// OBSOLETE asm ("call 0
// OBSOLETE nop ");
// OBSOLETE break;
// OBSOLETE } /* switch */
// OBSOLETE
// OBSOLETE /* reply to the request */
// OBSOLETE putpacket(remcomOutBuffer);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* This function will generate a breakpoint exception. It is used at the
// OBSOLETE beginning of a program to sync up with a debugger and can be used
// OBSOLETE otherwise as a quick means to stop program execution and "break" into
// OBSOLETE the debugger. */
// OBSOLETE
// OBSOLETE void
// OBSOLETE breakpoint (void)
// OBSOLETE {
// OBSOLETE if (!initialized)
// OBSOLETE return;
// OBSOLETE
// OBSOLETE asm(" .globl _breakinst
// OBSOLETE
// OBSOLETE _breakinst: ta 1
// OBSOLETE ");
// OBSOLETE }

View file

@ -1,869 +0,0 @@
// OBSOLETE /* Target dependent code for the Fujitsu SPARClite for GDB, the GNU debugger.
// OBSOLETE Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001
// OBSOLETE Free Software Foundation, Inc.
// 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 "breakpoint.h"
// OBSOLETE #include "target.h"
// OBSOLETE #include "serial.h"
// OBSOLETE #include "regcache.h"
// OBSOLETE #include <sys/types.h>
// OBSOLETE
// OBSOLETE #if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN__)
// OBSOLETE #define HAVE_SOCKETS
// OBSOLETE #include <sys/time.h>
// OBSOLETE #include <sys/socket.h>
// OBSOLETE #include <netinet/in.h>
// OBSOLETE #include <netdb.h>
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE static struct target_ops sparclite_ops;
// OBSOLETE
// OBSOLETE static char *remote_target_name = NULL;
// OBSOLETE static struct serial *remote_desc = NULL;
// OBSOLETE static int serial_flag;
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE static int udp_fd = -1;
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE static struct serial *open_tty (char *name);
// OBSOLETE static int send_resp (struct serial *desc, char c);
// OBSOLETE static void close_tty (void * ignore);
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE static int recv_udp_buf (int fd, unsigned char *buf, int len, int timeout);
// OBSOLETE static int send_udp_buf (int fd, unsigned char *buf, int len);
// OBSOLETE #endif
// OBSOLETE static void sparclite_open (char *name, int from_tty);
// OBSOLETE static void sparclite_close (int quitting);
// OBSOLETE static void download (char *target_name, char *args, int from_tty,
// OBSOLETE void (*write_routine) (bfd * from_bfd,
// OBSOLETE asection * from_sec,
// OBSOLETE file_ptr from_addr,
// OBSOLETE bfd_vma to_addr, int len),
// OBSOLETE void (*start_routine) (bfd_vma entry));
// OBSOLETE static void sparclite_serial_start (bfd_vma entry);
// OBSOLETE static void sparclite_serial_write (bfd * from_bfd, asection * from_sec,
// OBSOLETE file_ptr from_addr,
// OBSOLETE bfd_vma to_addr, int len);
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE static unsigned short calc_checksum (unsigned char *buffer, int count);
// OBSOLETE static void sparclite_udp_start (bfd_vma entry);
// OBSOLETE static void sparclite_udp_write (bfd * from_bfd, asection * from_sec,
// OBSOLETE file_ptr from_addr, bfd_vma to_addr,
// OBSOLETE int len);
// OBSOLETE #endif
// OBSOLETE static void sparclite_download (char *filename, int from_tty);
// OBSOLETE
// OBSOLETE #define DDA2_SUP_ASI 0xb000000
// OBSOLETE #define DDA1_SUP_ASI 0xb0000
// OBSOLETE
// OBSOLETE #define DDA2_ASI_MASK 0xff000000
// OBSOLETE #define DDA1_ASI_MASK 0xff0000
// OBSOLETE #define DIA2_SUP_MODE 0x8000
// OBSOLETE #define DIA1_SUP_MODE 0x4000
// OBSOLETE #define DDA2_ENABLE 0x100
// OBSOLETE #define DDA1_ENABLE 0x80
// OBSOLETE #define DIA2_ENABLE 0x40
// OBSOLETE #define DIA1_ENABLE 0x20
// OBSOLETE #define DSINGLE_STEP 0x10 /* not used */
// OBSOLETE #define DDV_TYPE_MASK 0xc
// OBSOLETE #define DDV_TYPE_LOAD 0x0
// OBSOLETE #define DDV_TYPE_STORE 0x4
// OBSOLETE #define DDV_TYPE_ACCESS 0x8
// OBSOLETE #define DDV_TYPE_ALWAYS 0xc
// OBSOLETE #define DDV_COND 0x2
// OBSOLETE #define DDV_MASK 0x1
// OBSOLETE
// OBSOLETE int
// OBSOLETE sparclite_insert_watchpoint (CORE_ADDR addr, int len, int type)
// OBSOLETE {
// OBSOLETE CORE_ADDR dcr;
// OBSOLETE
// OBSOLETE dcr = read_register (DCR_REGNUM);
// OBSOLETE
// OBSOLETE if (!(dcr & DDA1_ENABLE))
// OBSOLETE {
// OBSOLETE write_register (DDA1_REGNUM, addr);
// OBSOLETE dcr &= ~(DDA1_ASI_MASK | DDV_TYPE_MASK);
// OBSOLETE dcr |= (DDA1_SUP_ASI | DDA1_ENABLE);
// OBSOLETE if (type == 1)
// OBSOLETE {
// OBSOLETE write_register (DDV1_REGNUM, 0);
// OBSOLETE write_register (DDV2_REGNUM, 0xffffffff);
// OBSOLETE dcr |= (DDV_TYPE_LOAD & (~DDV_COND & ~DDV_MASK));
// OBSOLETE }
// OBSOLETE else if (type == 0)
// OBSOLETE {
// OBSOLETE write_register (DDV1_REGNUM, 0);
// OBSOLETE write_register (DDV2_REGNUM, 0xffffffff);
// OBSOLETE dcr |= (DDV_TYPE_STORE & (~DDV_COND & ~DDV_MASK));
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE write_register (DDV1_REGNUM, 0);
// OBSOLETE write_register (DDV2_REGNUM, 0xffffffff);
// OBSOLETE dcr |= (DDV_TYPE_ACCESS);
// OBSOLETE }
// OBSOLETE write_register (DCR_REGNUM, dcr);
// OBSOLETE }
// OBSOLETE else if (!(dcr & DDA2_ENABLE))
// OBSOLETE {
// OBSOLETE write_register (DDA2_REGNUM, addr);
// OBSOLETE dcr &= ~(DDA2_ASI_MASK & DDV_TYPE_MASK);
// OBSOLETE dcr |= (DDA2_SUP_ASI | DDA2_ENABLE);
// OBSOLETE if (type == 1)
// OBSOLETE {
// OBSOLETE write_register (DDV1_REGNUM, 0);
// OBSOLETE write_register (DDV2_REGNUM, 0xffffffff);
// OBSOLETE dcr |= (DDV_TYPE_LOAD & ~DDV_COND & ~DDV_MASK);
// OBSOLETE }
// OBSOLETE else if (type == 0)
// OBSOLETE {
// OBSOLETE write_register (DDV1_REGNUM, 0);
// OBSOLETE write_register (DDV2_REGNUM, 0xffffffff);
// OBSOLETE dcr |= (DDV_TYPE_STORE & ~DDV_COND & ~DDV_MASK);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE write_register (DDV1_REGNUM, 0);
// OBSOLETE write_register (DDV2_REGNUM, 0xffffffff);
// OBSOLETE dcr |= (DDV_TYPE_ACCESS);
// OBSOLETE }
// OBSOLETE write_register (DCR_REGNUM, dcr);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE return -1;
// OBSOLETE
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE int
// OBSOLETE sparclite_remove_watchpoint (CORE_ADDR addr, int len, int type)
// OBSOLETE {
// OBSOLETE CORE_ADDR dcr, dda1, dda2;
// OBSOLETE
// OBSOLETE dcr = read_register (DCR_REGNUM);
// OBSOLETE dda1 = read_register (DDA1_REGNUM);
// OBSOLETE dda2 = read_register (DDA2_REGNUM);
// OBSOLETE
// OBSOLETE if ((dcr & DDA1_ENABLE) && addr == dda1)
// OBSOLETE write_register (DCR_REGNUM, (dcr & ~DDA1_ENABLE));
// OBSOLETE else if ((dcr & DDA2_ENABLE) && addr == dda2)
// OBSOLETE write_register (DCR_REGNUM, (dcr & ~DDA2_ENABLE));
// OBSOLETE else
// OBSOLETE return -1;
// OBSOLETE
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE int
// OBSOLETE sparclite_insert_hw_breakpoint (CORE_ADDR addr, int len)
// OBSOLETE {
// OBSOLETE CORE_ADDR dcr;
// OBSOLETE
// OBSOLETE dcr = read_register (DCR_REGNUM);
// OBSOLETE
// OBSOLETE if (!(dcr & DIA1_ENABLE))
// OBSOLETE {
// OBSOLETE write_register (DIA1_REGNUM, addr);
// OBSOLETE write_register (DCR_REGNUM, (dcr | DIA1_ENABLE | DIA1_SUP_MODE));
// OBSOLETE }
// OBSOLETE else if (!(dcr & DIA2_ENABLE))
// OBSOLETE {
// OBSOLETE write_register (DIA2_REGNUM, addr);
// OBSOLETE write_register (DCR_REGNUM, (dcr | DIA2_ENABLE | DIA2_SUP_MODE));
// OBSOLETE }
// OBSOLETE else
// OBSOLETE return -1;
// OBSOLETE
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE int
// OBSOLETE sparclite_remove_hw_breakpoint (CORE_ADDR addr, int shadow)
// OBSOLETE {
// OBSOLETE CORE_ADDR dcr, dia1, dia2;
// OBSOLETE
// OBSOLETE dcr = read_register (DCR_REGNUM);
// OBSOLETE dia1 = read_register (DIA1_REGNUM);
// OBSOLETE dia2 = read_register (DIA2_REGNUM);
// OBSOLETE
// OBSOLETE if ((dcr & DIA1_ENABLE) && addr == dia1)
// OBSOLETE write_register (DCR_REGNUM, (dcr & ~DIA1_ENABLE));
// OBSOLETE else if ((dcr & DIA2_ENABLE) && addr == dia2)
// OBSOLETE write_register (DCR_REGNUM, (dcr & ~DIA2_ENABLE));
// OBSOLETE else
// OBSOLETE return -1;
// OBSOLETE
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE int
// OBSOLETE sparclite_check_watch_resources (int type, int cnt, int ot)
// OBSOLETE {
// OBSOLETE /* Watchpoints not supported on simulator. */
// OBSOLETE if (strcmp (target_shortname, "sim") == 0)
// OBSOLETE return 0;
// OBSOLETE
// OBSOLETE if (type == bp_hardware_breakpoint)
// OBSOLETE {
// OBSOLETE if (TARGET_HW_BREAK_LIMIT == 0)
// OBSOLETE return 0;
// OBSOLETE else if (cnt <= TARGET_HW_BREAK_LIMIT)
// OBSOLETE return 1;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE if (TARGET_HW_WATCH_LIMIT == 0)
// OBSOLETE return 0;
// OBSOLETE else if (ot)
// OBSOLETE return -1;
// OBSOLETE else if (cnt <= TARGET_HW_WATCH_LIMIT)
// OBSOLETE return 1;
// OBSOLETE }
// OBSOLETE return -1;
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE sparclite_stopped_data_address (void)
// OBSOLETE {
// OBSOLETE CORE_ADDR dsr, dda1, dda2;
// OBSOLETE
// OBSOLETE dsr = read_register (DSR_REGNUM);
// OBSOLETE dda1 = read_register (DDA1_REGNUM);
// OBSOLETE dda2 = read_register (DDA2_REGNUM);
// OBSOLETE
// OBSOLETE if (dsr & 0x10)
// OBSOLETE return dda1;
// OBSOLETE else if (dsr & 0x20)
// OBSOLETE return dda2;
// OBSOLETE else
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static struct serial *
// OBSOLETE open_tty (char *name)
// OBSOLETE {
// OBSOLETE struct serial *desc;
// OBSOLETE
// OBSOLETE desc = serial_open (name);
// OBSOLETE if (!desc)
// OBSOLETE perror_with_name (name);
// OBSOLETE
// OBSOLETE if (baud_rate != -1)
// OBSOLETE {
// OBSOLETE if (serial_setbaudrate (desc, baud_rate))
// OBSOLETE {
// OBSOLETE serial_close (desc);
// OBSOLETE perror_with_name (name);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE serial_raw (desc);
// OBSOLETE
// OBSOLETE serial_flush_input (desc);
// OBSOLETE
// OBSOLETE return desc;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Read a single character from the remote end, masking it down to 7 bits. */
// OBSOLETE
// OBSOLETE static int
// OBSOLETE readchar (struct serial *desc, int timeout)
// OBSOLETE {
// OBSOLETE int ch;
// OBSOLETE char s[10];
// OBSOLETE
// OBSOLETE ch = serial_readchar (desc, timeout);
// OBSOLETE
// OBSOLETE switch (ch)
// OBSOLETE {
// OBSOLETE case SERIAL_EOF:
// OBSOLETE error ("SPARClite remote connection closed");
// OBSOLETE case SERIAL_ERROR:
// OBSOLETE perror_with_name ("SPARClite communication error");
// OBSOLETE case SERIAL_TIMEOUT:
// OBSOLETE error ("SPARClite remote timeout");
// OBSOLETE default:
// OBSOLETE if (remote_debug > 0)
// OBSOLETE {
// OBSOLETE sprintf (s, "[%02x]", ch & 0xff);
// OBSOLETE puts_debug ("read -->", s, "<--");
// OBSOLETE }
// OBSOLETE return ch;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE debug_serial_write (struct serial *desc, char *buf, int len)
// OBSOLETE {
// OBSOLETE char s[10];
// OBSOLETE
// OBSOLETE serial_write (desc, buf, len);
// OBSOLETE if (remote_debug > 0)
// OBSOLETE {
// OBSOLETE while (len-- > 0)
// OBSOLETE {
// OBSOLETE sprintf (s, "[%02x]", *buf & 0xff);
// OBSOLETE puts_debug ("Sent -->", s, "<--");
// OBSOLETE buf++;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE
// OBSOLETE static int
// OBSOLETE send_resp (struct serial *desc, char c)
// OBSOLETE {
// OBSOLETE debug_serial_write (desc, &c, 1);
// OBSOLETE return readchar (desc, remote_timeout);
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE close_tty (void *ignore)
// OBSOLETE {
// OBSOLETE if (!remote_desc)
// OBSOLETE return;
// OBSOLETE
// OBSOLETE serial_close (remote_desc);
// OBSOLETE
// OBSOLETE remote_desc = NULL;
// OBSOLETE }
// OBSOLETE
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE static int
// OBSOLETE recv_udp_buf (int fd, unsigned char *buf, int len, int timeout)
// OBSOLETE {
// OBSOLETE int cc;
// OBSOLETE fd_set readfds;
// OBSOLETE
// OBSOLETE FD_ZERO (&readfds);
// OBSOLETE FD_SET (fd, &readfds);
// OBSOLETE
// OBSOLETE if (timeout >= 0)
// OBSOLETE {
// OBSOLETE struct timeval timebuf;
// OBSOLETE
// OBSOLETE timebuf.tv_sec = timeout;
// OBSOLETE timebuf.tv_usec = 0;
// OBSOLETE cc = select (fd + 1, &readfds, 0, 0, &timebuf);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE cc = select (fd + 1, &readfds, 0, 0, 0);
// OBSOLETE
// OBSOLETE if (cc == 0)
// OBSOLETE return 0;
// OBSOLETE
// OBSOLETE if (cc != 1)
// OBSOLETE perror_with_name ("recv_udp_buf: Bad return value from select:");
// OBSOLETE
// OBSOLETE cc = recv (fd, buf, len, 0);
// OBSOLETE
// OBSOLETE if (cc < 0)
// OBSOLETE perror_with_name ("Got an error from recv: ");
// OBSOLETE }
// OBSOLETE
// OBSOLETE static int
// OBSOLETE send_udp_buf (int fd, unsigned char *buf, int len)
// OBSOLETE {
// OBSOLETE int cc;
// OBSOLETE
// OBSOLETE cc = send (fd, buf, len, 0);
// OBSOLETE
// OBSOLETE if (cc == len)
// OBSOLETE return;
// OBSOLETE
// OBSOLETE if (cc < 0)
// OBSOLETE perror_with_name ("Got an error from send: ");
// OBSOLETE
// OBSOLETE error ("Short count in send: tried %d, sent %d\n", len, cc);
// OBSOLETE }
// OBSOLETE #endif /* HAVE_SOCKETS */
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclite_open (char *name, int from_tty)
// OBSOLETE {
// OBSOLETE struct cleanup *old_chain;
// OBSOLETE int c;
// OBSOLETE char *p;
// OBSOLETE
// OBSOLETE if (!name)
// OBSOLETE error ("You need to specify what device or hostname is associated with the SparcLite board.");
// OBSOLETE
// OBSOLETE target_preopen (from_tty);
// OBSOLETE
// OBSOLETE unpush_target (&sparclite_ops);
// OBSOLETE
// OBSOLETE if (remote_target_name)
// OBSOLETE xfree (remote_target_name);
// OBSOLETE
// OBSOLETE remote_target_name = xstrdup (name);
// OBSOLETE
// OBSOLETE /* We need a 'serial' or 'udp' keyword to disambiguate host:port, which can
// OBSOLETE mean either a serial port on a terminal server, or the IP address of a
// OBSOLETE SPARClite demo board. If there's no colon, then it pretty much has to be
// OBSOLETE a local device (except for DOS... grrmble) */
// OBSOLETE
// OBSOLETE p = strchr (name, ' ');
// OBSOLETE
// OBSOLETE if (p)
// OBSOLETE {
// OBSOLETE *p++ = '\000';
// OBSOLETE while ((*p != '\000') && isspace (*p))
// OBSOLETE p++;
// OBSOLETE
// OBSOLETE if (strncmp (name, "serial", strlen (name)) == 0)
// OBSOLETE serial_flag = 1;
// OBSOLETE else if (strncmp (name, "udp", strlen (name)) == 0)
// OBSOLETE serial_flag = 0;
// OBSOLETE else
// OBSOLETE error ("Must specify either `serial' or `udp'.");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE p = name;
// OBSOLETE
// OBSOLETE if (!strchr (name, ':'))
// OBSOLETE serial_flag = 1; /* No colon is unambiguous (local device) */
// OBSOLETE else
// OBSOLETE error ("Usage: target sparclite serial /dev/ttyb\n\
// OBSOLETE or: target sparclite udp host");
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (serial_flag)
// OBSOLETE {
// OBSOLETE remote_desc = open_tty (p);
// OBSOLETE
// OBSOLETE old_chain = make_cleanup (close_tty, 0 /*ignore*/);
// OBSOLETE
// OBSOLETE c = send_resp (remote_desc, 0x00);
// OBSOLETE
// OBSOLETE if (c != 0xaa)
// OBSOLETE error ("Unknown response (0x%x) from SparcLite. Try resetting the board.",
// OBSOLETE c);
// OBSOLETE
// OBSOLETE c = send_resp (remote_desc, 0x55);
// OBSOLETE
// OBSOLETE if (c != 0x55)
// OBSOLETE error ("Sparclite appears to be ill.");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE struct hostent *he;
// OBSOLETE struct sockaddr_in sockaddr;
// OBSOLETE unsigned char buffer[100];
// OBSOLETE int cc;
// OBSOLETE
// OBSOLETE /* Setup the socket. Must be raw UDP. */
// OBSOLETE
// OBSOLETE he = gethostbyname (p);
// OBSOLETE
// OBSOLETE if (!he)
// OBSOLETE error ("No such host %s.", p);
// OBSOLETE
// OBSOLETE udp_fd = socket (PF_INET, SOCK_DGRAM, 0);
// OBSOLETE
// OBSOLETE old_chain = make_cleanup (close, udp_fd);
// OBSOLETE
// OBSOLETE sockaddr.sin_family = PF_INET;
// OBSOLETE sockaddr.sin_port = htons (7000);
// OBSOLETE memcpy (&sockaddr.sin_addr.s_addr, he->h_addr, sizeof (struct in_addr));
// OBSOLETE
// OBSOLETE if (connect (udp_fd, &sockaddr, sizeof (sockaddr)))
// OBSOLETE perror_with_name ("Connect failed");
// OBSOLETE
// OBSOLETE buffer[0] = 0x5;
// OBSOLETE buffer[1] = 0;
// OBSOLETE
// OBSOLETE send_udp_buf (udp_fd, buffer, 2); /* Request version */
// OBSOLETE cc = recv_udp_buf (udp_fd, buffer, sizeof (buffer), 5); /* Get response */
// OBSOLETE if (cc == 0)
// OBSOLETE error ("SPARClite isn't responding.");
// OBSOLETE
// OBSOLETE if (cc < 3)
// OBSOLETE error ("SPARClite appears to be ill.");
// OBSOLETE #else
// OBSOLETE error ("UDP downloading is not supported for DOS hosts.");
// OBSOLETE #endif /* HAVE_SOCKETS */
// OBSOLETE }
// OBSOLETE
// OBSOLETE printf_unfiltered ("[SPARClite appears to be alive]\n");
// OBSOLETE
// OBSOLETE push_target (&sparclite_ops);
// OBSOLETE
// OBSOLETE discard_cleanups (old_chain);
// OBSOLETE
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclite_close (int quitting)
// OBSOLETE {
// OBSOLETE if (serial_flag)
// OBSOLETE close_tty (0);
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE else if (udp_fd != -1)
// OBSOLETE close (udp_fd);
// OBSOLETE #endif
// OBSOLETE }
// OBSOLETE
// OBSOLETE #define LOAD_ADDRESS 0x40000000
// OBSOLETE
// OBSOLETE static void
// OBSOLETE download (char *target_name, char *args, int from_tty,
// OBSOLETE void (*write_routine) (bfd *from_bfd, asection *from_sec,
// OBSOLETE file_ptr from_addr, bfd_vma to_addr, int len),
// OBSOLETE void (*start_routine) (bfd_vma entry))
// OBSOLETE {
// OBSOLETE struct cleanup *old_chain;
// OBSOLETE asection *section;
// OBSOLETE bfd *pbfd;
// OBSOLETE bfd_vma entry;
// OBSOLETE int i;
// OBSOLETE #define WRITESIZE 1024
// OBSOLETE char *filename;
// OBSOLETE int quiet;
// OBSOLETE int nostart;
// OBSOLETE
// OBSOLETE quiet = 0;
// OBSOLETE nostart = 0;
// OBSOLETE filename = NULL;
// OBSOLETE
// OBSOLETE while (*args != '\000')
// OBSOLETE {
// OBSOLETE char *arg;
// OBSOLETE
// OBSOLETE while (isspace (*args))
// OBSOLETE args++;
// OBSOLETE
// OBSOLETE arg = args;
// OBSOLETE
// OBSOLETE while ((*args != '\000') && !isspace (*args))
// OBSOLETE args++;
// OBSOLETE
// OBSOLETE if (*args != '\000')
// OBSOLETE *args++ = '\000';
// OBSOLETE
// OBSOLETE if (*arg != '-')
// OBSOLETE filename = arg;
// OBSOLETE else if (strncmp (arg, "-quiet", strlen (arg)) == 0)
// OBSOLETE quiet = 1;
// OBSOLETE else if (strncmp (arg, "-nostart", strlen (arg)) == 0)
// OBSOLETE nostart = 1;
// OBSOLETE else
// OBSOLETE error ("unknown option `%s'", arg);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (!filename)
// OBSOLETE filename = get_exec_file (1);
// OBSOLETE
// OBSOLETE pbfd = bfd_openr (filename, gnutarget);
// OBSOLETE if (pbfd == NULL)
// OBSOLETE {
// OBSOLETE perror_with_name (filename);
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE old_chain = make_cleanup_bfd_close (pbfd);
// OBSOLETE
// OBSOLETE if (!bfd_check_format (pbfd, bfd_object))
// OBSOLETE error ("\"%s\" is not an object file: %s", filename,
// OBSOLETE bfd_errmsg (bfd_get_error ()));
// OBSOLETE
// OBSOLETE for (section = pbfd->sections; section; section = section->next)
// OBSOLETE {
// OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)
// OBSOLETE {
// OBSOLETE bfd_vma section_address;
// OBSOLETE bfd_size_type section_size;
// OBSOLETE file_ptr fptr;
// OBSOLETE const char *section_name;
// OBSOLETE
// OBSOLETE section_name = bfd_get_section_name (pbfd, section);
// OBSOLETE
// OBSOLETE section_address = bfd_get_section_vma (pbfd, section);
// OBSOLETE
// OBSOLETE /* Adjust sections from a.out files, since they don't
// OBSOLETE carry their addresses with. */
// OBSOLETE if (bfd_get_flavour (pbfd) == bfd_target_aout_flavour)
// OBSOLETE {
// OBSOLETE if (strcmp (section_name, ".text") == 0)
// OBSOLETE section_address = bfd_get_start_address (pbfd);
// OBSOLETE else if (strcmp (section_name, ".data") == 0)
// OBSOLETE {
// OBSOLETE /* Read the first 8 bytes of the data section.
// OBSOLETE There should be the string 'DaTa' followed by
// OBSOLETE a word containing the actual section address. */
// OBSOLETE struct data_marker
// OBSOLETE {
// OBSOLETE char signature[4]; /* 'DaTa' */
// OBSOLETE unsigned char sdata[4]; /* &sdata */
// OBSOLETE }
// OBSOLETE marker;
// OBSOLETE bfd_get_section_contents (pbfd, section, &marker, 0,
// OBSOLETE sizeof (marker));
// OBSOLETE if (strncmp (marker.signature, "DaTa", 4) == 0)
// OBSOLETE {
// OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
// OBSOLETE section_address = bfd_getb32 (marker.sdata);
// OBSOLETE else
// OBSOLETE section_address = bfd_getl32 (marker.sdata);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE section_size = bfd_get_section_size_before_reloc (section);
// OBSOLETE
// OBSOLETE if (!quiet)
// OBSOLETE printf_filtered ("[Loading section %s at 0x%x (%d bytes)]\n",
// OBSOLETE bfd_get_section_name (pbfd, section),
// OBSOLETE section_address,
// OBSOLETE section_size);
// OBSOLETE
// OBSOLETE fptr = 0;
// OBSOLETE while (section_size > 0)
// OBSOLETE {
// OBSOLETE int count;
// OBSOLETE static char inds[] = "|/-\\";
// OBSOLETE static int k = 0;
// OBSOLETE
// OBSOLETE QUIT;
// OBSOLETE
// OBSOLETE count = min (section_size, WRITESIZE);
// OBSOLETE
// OBSOLETE write_routine (pbfd, section, fptr, section_address, count);
// OBSOLETE
// OBSOLETE if (!quiet)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("\r%c", inds[k++ % 4]);
// OBSOLETE gdb_flush (gdb_stdout);
// OBSOLETE }
// OBSOLETE
// OBSOLETE section_address += count;
// OBSOLETE fptr += count;
// OBSOLETE section_size -= count;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (!nostart)
// OBSOLETE {
// OBSOLETE entry = bfd_get_start_address (pbfd);
// OBSOLETE
// OBSOLETE if (!quiet)
// OBSOLETE printf_unfiltered ("[Starting %s at 0x%x]\n", filename, entry);
// OBSOLETE
// OBSOLETE start_routine (entry);
// OBSOLETE }
// OBSOLETE
// OBSOLETE do_cleanups (old_chain);
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclite_serial_start (bfd_vma entry)
// OBSOLETE {
// OBSOLETE char buffer[5];
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE buffer[0] = 0x03;
// OBSOLETE store_unsigned_integer (buffer + 1, 4, entry);
// OBSOLETE
// OBSOLETE debug_serial_write (remote_desc, buffer, 1 + 4);
// OBSOLETE i = readchar (remote_desc, remote_timeout);
// OBSOLETE if (i != 0x55)
// OBSOLETE error ("Can't start SparcLite. Error code %d\n", i);
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclite_serial_write (bfd *from_bfd, asection *from_sec, file_ptr from_addr,
// OBSOLETE bfd_vma to_addr, int len)
// OBSOLETE {
// OBSOLETE char buffer[4 + 4 + WRITESIZE]; /* addr + len + data */
// OBSOLETE unsigned char checksum;
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE store_unsigned_integer (buffer, 4, to_addr); /* Address */
// OBSOLETE store_unsigned_integer (buffer + 4, 4, len); /* Length */
// OBSOLETE
// OBSOLETE bfd_get_section_contents (from_bfd, from_sec, buffer + 8, from_addr, len);
// OBSOLETE
// OBSOLETE checksum = 0;
// OBSOLETE for (i = 0; i < len; i++)
// OBSOLETE checksum += buffer[8 + i];
// OBSOLETE
// OBSOLETE i = send_resp (remote_desc, 0x01);
// OBSOLETE
// OBSOLETE if (i != 0x5a)
// OBSOLETE error ("Bad response from load command (0x%x)", i);
// OBSOLETE
// OBSOLETE debug_serial_write (remote_desc, buffer, 4 + 4 + len);
// OBSOLETE i = readchar (remote_desc, remote_timeout);
// OBSOLETE
// OBSOLETE if (i != checksum)
// OBSOLETE error ("Bad checksum from load command (0x%x)", i);
// OBSOLETE }
// OBSOLETE
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE
// OBSOLETE static unsigned short
// OBSOLETE calc_checksum (unsigned char *buffer, int count)
// OBSOLETE {
// OBSOLETE unsigned short checksum;
// OBSOLETE
// OBSOLETE checksum = 0;
// OBSOLETE for (; count > 0; count -= 2, buffer += 2)
// OBSOLETE checksum += (*buffer << 8) | *(buffer + 1);
// OBSOLETE
// OBSOLETE if (count != 0)
// OBSOLETE checksum += *buffer << 8;
// OBSOLETE
// OBSOLETE return checksum;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclite_udp_start (bfd_vma entry)
// OBSOLETE {
// OBSOLETE unsigned char buffer[6];
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE buffer[0] = 0x3;
// OBSOLETE buffer[1] = 0;
// OBSOLETE buffer[2] = entry >> 24;
// OBSOLETE buffer[3] = entry >> 16;
// OBSOLETE buffer[4] = entry >> 8;
// OBSOLETE buffer[5] = entry;
// OBSOLETE
// OBSOLETE send_udp_buf (udp_fd, buffer, 6); /* Send start addr */
// OBSOLETE i = recv_udp_buf (udp_fd, buffer, sizeof (buffer), -1); /* Get response */
// OBSOLETE
// OBSOLETE if (i < 1 || buffer[0] != 0x55)
// OBSOLETE error ("Failed to take start address.");
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclite_udp_write (bfd *from_bfd, asection *from_sec, file_ptr from_addr,
// OBSOLETE bfd_vma to_addr, int len)
// OBSOLETE {
// OBSOLETE unsigned char buffer[2000];
// OBSOLETE unsigned short checksum;
// OBSOLETE static int pkt_num = 0;
// OBSOLETE static unsigned long old_addr = -1;
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE while (1)
// OBSOLETE {
// OBSOLETE if (to_addr != old_addr)
// OBSOLETE {
// OBSOLETE buffer[0] = 0x1; /* Load command */
// OBSOLETE buffer[1] = 0x1; /* Loading address */
// OBSOLETE buffer[2] = to_addr >> 24;
// OBSOLETE buffer[3] = to_addr >> 16;
// OBSOLETE buffer[4] = to_addr >> 8;
// OBSOLETE buffer[5] = to_addr;
// OBSOLETE
// OBSOLETE checksum = 0;
// OBSOLETE for (i = 0; i < 6; i++)
// OBSOLETE checksum += buffer[i];
// OBSOLETE checksum &= 0xff;
// OBSOLETE
// OBSOLETE send_udp_buf (udp_fd, buffer, 6);
// OBSOLETE i = recv_udp_buf (udp_fd, buffer, sizeof buffer, -1);
// OBSOLETE
// OBSOLETE if (i < 1)
// OBSOLETE error ("Got back short checksum for load addr.");
// OBSOLETE
// OBSOLETE if (checksum != buffer[0])
// OBSOLETE error ("Got back bad checksum for load addr.");
// OBSOLETE
// OBSOLETE pkt_num = 0; /* Load addr resets packet seq # */
// OBSOLETE old_addr = to_addr;
// OBSOLETE }
// OBSOLETE
// OBSOLETE bfd_get_section_contents (from_bfd, from_sec, buffer + 6, from_addr,
// OBSOLETE len);
// OBSOLETE
// OBSOLETE checksum = calc_checksum (buffer + 6, len);
// OBSOLETE
// OBSOLETE buffer[0] = 0x1; /* Load command */
// OBSOLETE buffer[1] = 0x2; /* Loading data */
// OBSOLETE buffer[2] = pkt_num >> 8;
// OBSOLETE buffer[3] = pkt_num;
// OBSOLETE buffer[4] = checksum >> 8;
// OBSOLETE buffer[5] = checksum;
// OBSOLETE
// OBSOLETE send_udp_buf (udp_fd, buffer, len + 6);
// OBSOLETE i = recv_udp_buf (udp_fd, buffer, sizeof buffer, 3);
// OBSOLETE
// OBSOLETE if (i == 0)
// OBSOLETE {
// OBSOLETE fprintf_unfiltered (gdb_stderr, "send_data: timeout sending %d bytes to address 0x%x retrying\n", len, to_addr);
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (buffer[0] != 0xff)
// OBSOLETE error ("Got back bad response for load data.");
// OBSOLETE
// OBSOLETE old_addr += len;
// OBSOLETE pkt_num++;
// OBSOLETE
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE #endif /* HAVE_SOCKETS */
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclite_download (char *filename, int from_tty)
// OBSOLETE {
// OBSOLETE if (!serial_flag)
// OBSOLETE #ifdef HAVE_SOCKETS
// OBSOLETE download (remote_target_name, filename, from_tty, sparclite_udp_write,
// OBSOLETE sparclite_udp_start);
// OBSOLETE #else
// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* sparclite_open should prevent this! */
// OBSOLETE #endif
// OBSOLETE else
// OBSOLETE download (remote_target_name, filename, from_tty, sparclite_serial_write,
// OBSOLETE sparclite_serial_start);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Set up the sparclite target vector. */
// OBSOLETE
// OBSOLETE static void
// OBSOLETE init_sparclite_ops (void)
// OBSOLETE {
// OBSOLETE sparclite_ops.to_shortname = "sparclite";
// OBSOLETE sparclite_ops.to_longname = "SPARClite download target";
// OBSOLETE sparclite_ops.to_doc = "Download to a remote SPARClite target board via serial of UDP.\n\
// OBSOLETE Specify the device it is connected to (e.g. /dev/ttya).";
// OBSOLETE sparclite_ops.to_open = sparclite_open;
// OBSOLETE sparclite_ops.to_close = sparclite_close;
// OBSOLETE sparclite_ops.to_load = sparclite_download;
// OBSOLETE sparclite_ops.to_stratum = download_stratum;
// OBSOLETE sparclite_ops.to_magic = OPS_MAGIC;
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE _initialize_sparcl_tdep (void)
// OBSOLETE {
// OBSOLETE init_sparclite_ops ();
// OBSOLETE add_target (&sparclite_ops);
// OBSOLETE }

View file

@ -1,316 +0,0 @@
// OBSOLETE /* Remote target glue for the SPARC Sparclet ROM monitor.
// OBSOLETE
// OBSOLETE Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free
// OBSOLETE Software Foundation, Inc.
// OBSOLETE
// OBSOLETE This file is part of GDB.
// OBSOLETE
// OBSOLETE This program is free software; you can redistribute it and/or modify
// OBSOLETE it under the terms of the GNU General Public License as published by
// OBSOLETE the Free Software Foundation; either version 2 of the License, or
// OBSOLETE (at your option) any later version.
// OBSOLETE
// OBSOLETE This program is distributed in the hope that it will be useful,
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// OBSOLETE GNU General Public License for more details.
// OBSOLETE
// OBSOLETE You should have received a copy of the GNU General Public License
// OBSOLETE along with this program; if not, write to the Free Software
// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
// OBSOLETE Boston, MA 02111-1307, USA. */
// OBSOLETE
// OBSOLETE
// OBSOLETE #include "defs.h"
// OBSOLETE #include "gdbcore.h"
// OBSOLETE #include "target.h"
// OBSOLETE #include "monitor.h"
// OBSOLETE #include "serial.h"
// OBSOLETE #include "srec.h"
// OBSOLETE #include "symtab.h"
// OBSOLETE #include "symfile.h" /* for generic_load */
// OBSOLETE #include "regcache.h"
// OBSOLETE #include <time.h>
// OBSOLETE
// OBSOLETE extern void report_transfer_performance (unsigned long, time_t, time_t);
// OBSOLETE
// OBSOLETE static struct target_ops sparclet_ops;
// OBSOLETE
// OBSOLETE static void sparclet_open (char *args, int from_tty);
// OBSOLETE
// OBSOLETE /* This array of registers need to match the indexes used by GDB.
// OBSOLETE This exists because the various ROM monitors use different strings
// OBSOLETE than does GDB, and don't necessarily support all the registers
// OBSOLETE either. So, typing "info reg sp" becomes a "r30". */
// OBSOLETE
// OBSOLETE /*PSR 0x00000080 impl ver icc AW LE EE EC EF PIL S PS ET CWP WIM
// OBSOLETE 0x0 0x0 0x0 0 0 0 0 0 0x0 1 0 0 0x00 0x2
// OBSOLETE 0000010
// OBSOLETE INS LOCALS OUTS GLOBALS
// OBSOLETE 0 0x00000000 0x00000000 0x00000000 0x00000000
// OBSOLETE 1 0x00000000 0x00000000 0x00000000 0x00000000
// OBSOLETE 2 0x00000000 0x00000000 0x00000000 0x00000000
// OBSOLETE 3 0x00000000 0x00000000 0x00000000 0x00000000
// OBSOLETE 4 0x00000000 0x00000000 0x00000000 0x00000000
// OBSOLETE 5 0x00000000 0x00001000 0x00000000 0x00000000
// OBSOLETE 6 0x00000000 0x00000000 0x123f0000 0x00000000
// OBSOLETE 7 0x00000000 0x00000000 0x00000000 0x00000000
// OBSOLETE pc: 0x12010000 0x00000000 unimp
// OBSOLETE npc: 0x12010004 0x00001000 unimp 0x1000
// OBSOLETE tbr: 0x00000000
// OBSOLETE y: 0x00000000
// OBSOLETE */
// OBSOLETE /* these correspond to the offsets from tm-* files from config directories */
// OBSOLETE
// OBSOLETE /* is wim part of psr?? */
// OBSOLETE /* monitor wants lower case */
// OBSOLETE static char *sparclet_regnames[] = {
// OBSOLETE "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
// OBSOLETE "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7",
// OBSOLETE "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
// OBSOLETE "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7",
// OBSOLETE
// OBSOLETE "", "", "", "", "", "", "", "", /* no FPU regs */
// OBSOLETE "", "", "", "", "", "", "", "",
// OBSOLETE "", "", "", "", "", "", "", "",
// OBSOLETE "", "", "", "", "", "", "", "",
// OBSOLETE /* no CPSR, FPSR */
// OBSOLETE "y", "psr", "wim", "tbr", "pc", "npc", "", "",
// OBSOLETE
// OBSOLETE "ccsr", "ccpr", "cccrcr", "ccor", "ccobr", "ccibr", "ccir", "",
// OBSOLETE
// OBSOLETE /* ASR15 ASR19 (don't display them) */
// OBSOLETE "asr1", "", "asr17", "asr18", "", "asr20", "asr21", "asr22",
// OBSOLETE /*
// OBSOLETE "awr0", "awr1", "awr2", "awr3", "awr4", "awr5", "awr6", "awr7",
// OBSOLETE "awr8", "awr9", "awr10", "awr11", "awr12", "awr13", "awr14", "awr15",
// OBSOLETE "awr16", "awr17", "awr18", "awr19", "awr20", "awr21", "awr22", "awr23",
// OBSOLETE "awr24", "awr25", "awr26", "awr27", "awr28", "awr29", "awr30", "awr31",
// OBSOLETE "apsr",
// OBSOLETE */
// OBSOLETE };
// OBSOLETE
// OBSOLETE
// OBSOLETE
// OBSOLETE /* Function: sparclet_supply_register
// OBSOLETE Just returns with no action.
// OBSOLETE This function is required, because parse_register_dump (monitor.c)
// OBSOLETE expects to be able to call it. If we don't supply something, it will
// OBSOLETE call a null pointer and core-dump. Since this function does not
// OBSOLETE actually do anything, GDB will request the registers individually. */
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclet_supply_register (char *regname, int regnamelen, char *val, int vallen)
// OBSOLETE {
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclet_load (struct serial *desc, char *file, int hashmark)
// OBSOLETE {
// OBSOLETE bfd *abfd;
// OBSOLETE asection *s;
// OBSOLETE int i;
// OBSOLETE CORE_ADDR load_offset;
// OBSOLETE time_t start_time, end_time;
// OBSOLETE unsigned long data_count = 0;
// OBSOLETE
// OBSOLETE /* enable user to specify address for downloading as 2nd arg to load */
// OBSOLETE
// OBSOLETE i = sscanf (file, "%*s 0x%lx", &load_offset);
// OBSOLETE if (i >= 1)
// OBSOLETE {
// OBSOLETE char *p;
// OBSOLETE
// OBSOLETE for (p = file; *p != '\000' && !isspace (*p); p++);
// OBSOLETE
// OBSOLETE *p = '\000';
// OBSOLETE }
// OBSOLETE else
// OBSOLETE load_offset = 0;
// OBSOLETE
// OBSOLETE abfd = bfd_openr (file, 0);
// OBSOLETE if (!abfd)
// OBSOLETE {
// OBSOLETE printf_filtered ("Unable to open file %s\n", file);
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (bfd_check_format (abfd, bfd_object) == 0)
// OBSOLETE {
// OBSOLETE printf_filtered ("File is not an object file\n");
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE
// OBSOLETE start_time = time (NULL);
// OBSOLETE
// OBSOLETE for (s = abfd->sections; s; s = s->next)
// OBSOLETE if (s->flags & SEC_LOAD)
// OBSOLETE {
// OBSOLETE bfd_size_type section_size;
// OBSOLETE bfd_vma vma;
// OBSOLETE
// OBSOLETE vma = bfd_get_section_vma (abfd, s) + load_offset;
// OBSOLETE section_size = bfd_section_size (abfd, s);
// OBSOLETE
// OBSOLETE data_count += section_size;
// OBSOLETE
// OBSOLETE printf_filtered ("%s\t: 0x%4x .. 0x%4x ",
// OBSOLETE bfd_get_section_name (abfd, s), vma,
// OBSOLETE vma + section_size);
// OBSOLETE gdb_flush (gdb_stdout);
// OBSOLETE
// OBSOLETE monitor_printf ("load c r %x %x\r", vma, section_size);
// OBSOLETE
// OBSOLETE monitor_expect ("load: loading ", NULL, 0);
// OBSOLETE monitor_expect ("\r", NULL, 0);
// OBSOLETE
// OBSOLETE for (i = 0; i < section_size; i += 2048)
// OBSOLETE {
// OBSOLETE int numbytes;
// OBSOLETE char buf[2048];
// OBSOLETE
// OBSOLETE numbytes = min (sizeof buf, section_size - i);
// OBSOLETE
// OBSOLETE bfd_get_section_contents (abfd, s, buf, i, numbytes);
// OBSOLETE
// OBSOLETE serial_write (desc, buf, numbytes);
// OBSOLETE
// OBSOLETE if (hashmark)
// OBSOLETE {
// OBSOLETE putchar_unfiltered ('#');
// OBSOLETE gdb_flush (gdb_stdout);
// OBSOLETE }
// OBSOLETE } /* Per-packet (or S-record) loop */
// OBSOLETE
// OBSOLETE monitor_expect_prompt (NULL, 0);
// OBSOLETE
// OBSOLETE putchar_unfiltered ('\n');
// OBSOLETE } /* Loadable sections */
// OBSOLETE
// OBSOLETE monitor_printf ("reg pc %x\r", bfd_get_start_address (abfd));
// OBSOLETE monitor_expect_prompt (NULL, 0);
// OBSOLETE monitor_printf ("reg npc %x\r", bfd_get_start_address (abfd) + 4);
// OBSOLETE monitor_expect_prompt (NULL, 0);
// OBSOLETE
// OBSOLETE monitor_printf ("run\r");
// OBSOLETE
// OBSOLETE end_time = time (NULL);
// OBSOLETE
// OBSOLETE if (hashmark)
// OBSOLETE putchar_unfiltered ('\n');
// OBSOLETE
// OBSOLETE report_transfer_performance (data_count, start_time, end_time);
// OBSOLETE
// OBSOLETE pop_target ();
// OBSOLETE push_remote_target (monitor_get_dev_name (), 1);
// OBSOLETE
// OBSOLETE throw_exception (RETURN_QUIT);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Define the monitor command strings. Since these are passed directly
// OBSOLETE through to a printf style function, we may include formatting
// OBSOLETE strings. We also need a CR or LF on the end. */
// OBSOLETE
// OBSOLETE /* need to pause the monitor for timing reasons, so slow it down */
// OBSOLETE
// OBSOLETE static char *sparclet_inits[] =
// OBSOLETE {"\n\r\r\n", NULL};
// OBSOLETE
// OBSOLETE static struct monitor_ops sparclet_cmds;
// OBSOLETE
// OBSOLETE static void
// OBSOLETE init_sparclet_cmds (void)
// OBSOLETE {
// OBSOLETE sparclet_cmds.flags = MO_CLR_BREAK_USES_ADDR |
// OBSOLETE MO_HEX_PREFIX |
// OBSOLETE MO_NO_ECHO_ON_OPEN |
// OBSOLETE MO_NO_ECHO_ON_SETMEM |
// OBSOLETE MO_RUN_FIRST_TIME |
// OBSOLETE MO_GETMEM_READ_SINGLE; /* flags */
// OBSOLETE sparclet_cmds.init = sparclet_inits; /* Init strings */
// OBSOLETE sparclet_cmds.cont = "cont\r"; /* continue command */
// OBSOLETE sparclet_cmds.step = "step\r"; /* single step */
// OBSOLETE sparclet_cmds.stop = "\r"; /* break interrupts the program */
// OBSOLETE sparclet_cmds.set_break = "+bp %x\r"; /* set a breakpoint */
// OBSOLETE sparclet_cmds.clr_break = "-bp %x\r"; /* can't use "br" because only 2 hw bps are supported */
// OBSOLETE sparclet_cmds.clr_all_break = "-bp %x\r"; /* clear a breakpoint */
// OBSOLETE "-bp\r"; /* clear all breakpoints */
// OBSOLETE sparclet_cmds.fill = "fill %x -n %x -v %x -b\r"; /* fill (start length val) */
// OBSOLETE /* can't use "fi" because it takes words, not bytes */
// OBSOLETE /* ex [addr] [-n count] [-b|-s|-l] default: ex cur -n 1 -b */
// OBSOLETE sparclet_cmds.setmem.cmdb = "ex %x -b\r%x\rq\r"; /* setmem.cmdb (addr, value) */
// OBSOLETE sparclet_cmds.setmem.cmdw = "ex %x -s\r%x\rq\r"; /* setmem.cmdw (addr, value) */
// OBSOLETE sparclet_cmds.setmem.cmdl = "ex %x -l\r%x\rq\r"; /* setmem.cmdl (addr, value) */
// OBSOLETE sparclet_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */
// OBSOLETE sparclet_cmds.setmem.resp_delim = NULL; /*": " *//* setmem.resp_delim */
// OBSOLETE sparclet_cmds.setmem.term = NULL; /*"? " *//* setmem.term */
// OBSOLETE sparclet_cmds.setmem.term_cmd = NULL; /*"q\r" *//* setmem.term_cmd */
// OBSOLETE /* since the parsing of multiple bytes is difficult due to
// OBSOLETE interspersed addresses, we'll only read 1 value at a time,
// OBSOLETE even tho these can handle a count */
// OBSOLETE /* we can use -n to set count to read, but may have to parse? */
// OBSOLETE sparclet_cmds.getmem.cmdb = "ex %x -n 1 -b\r"; /* getmem.cmdb (addr, #bytes) */
// OBSOLETE sparclet_cmds.getmem.cmdw = "ex %x -n 1 -s\r"; /* getmem.cmdw (addr, #swords) */
// OBSOLETE sparclet_cmds.getmem.cmdl = "ex %x -n 1 -l\r"; /* getmem.cmdl (addr, #words) */
// OBSOLETE sparclet_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, #dwords) */
// OBSOLETE sparclet_cmds.getmem.resp_delim = ": "; /* getmem.resp_delim */
// OBSOLETE sparclet_cmds.getmem.term = NULL; /* getmem.term */
// OBSOLETE sparclet_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */
// OBSOLETE sparclet_cmds.setreg.cmd = "reg %s 0x%x\r"; /* setreg.cmd (name, value) */
// OBSOLETE sparclet_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */
// OBSOLETE sparclet_cmds.setreg.term = NULL; /* setreg.term */
// OBSOLETE sparclet_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */
// OBSOLETE sparclet_cmds.getreg.cmd = "reg %s\r"; /* getreg.cmd (name) */
// OBSOLETE sparclet_cmds.getreg.resp_delim = " "; /* getreg.resp_delim */
// OBSOLETE sparclet_cmds.getreg.term = NULL; /* getreg.term */
// OBSOLETE sparclet_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */
// OBSOLETE sparclet_cmds.dump_registers = "reg\r"; /* dump_registers */
// OBSOLETE sparclet_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */
// OBSOLETE sparclet_cmds.supply_register = sparclet_supply_register; /* supply_register */
// OBSOLETE sparclet_cmds.load_routine = sparclet_load; /* load_routine */
// OBSOLETE sparclet_cmds.load = NULL; /* download command (srecs on console) */
// OBSOLETE sparclet_cmds.loadresp = NULL; /* load response */
// OBSOLETE sparclet_cmds.prompt = "monitor>"; /* monitor command prompt */
// OBSOLETE /* yikes! gdb core dumps without this delimitor!! */
// OBSOLETE sparclet_cmds.line_term = "\r"; /* end-of-command delimitor */
// OBSOLETE sparclet_cmds.cmd_end = NULL; /* optional command terminator */
// OBSOLETE sparclet_cmds.target = &sparclet_ops; /* target operations */
// OBSOLETE sparclet_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
// OBSOLETE sparclet_cmds.regnames = sparclet_regnames; /* registers names */
// OBSOLETE sparclet_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
// OBSOLETE };
// OBSOLETE
// OBSOLETE static void
// OBSOLETE sparclet_open (char *args, int from_tty)
// OBSOLETE {
// OBSOLETE monitor_open (args, &sparclet_cmds, from_tty);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE _initialize_sparclet (void)
// OBSOLETE {
// OBSOLETE int i;
// OBSOLETE init_sparclet_cmds ();
// OBSOLETE
// OBSOLETE for (i = 0; i < NUM_REGS; i++)
// OBSOLETE if (sparclet_regnames[i][0] == 'c' ||
// OBSOLETE sparclet_regnames[i][0] == 'a')
// OBSOLETE sparclet_regnames[i] = 0; /* mon can't report c* or a* regs */
// OBSOLETE
// OBSOLETE sparclet_regnames[0] = 0; /* mon won't report %G0 */
// OBSOLETE
// OBSOLETE init_monitor_ops (&sparclet_ops);
// OBSOLETE sparclet_ops.to_shortname = "sparclet"; /* for the target command */
// OBSOLETE sparclet_ops.to_longname = "SPARC Sparclet monitor";
// OBSOLETE /* use SW breaks; target only supports 2 HW breakpoints */
// OBSOLETE sparclet_ops.to_insert_breakpoint = memory_insert_breakpoint;
// OBSOLETE sparclet_ops.to_remove_breakpoint = memory_remove_breakpoint;
// OBSOLETE
// OBSOLETE sparclet_ops.to_doc =
// OBSOLETE "Use a board running the Sparclet debug monitor.\n\
// OBSOLETE Specify the serial device it is connected to (e.g. /dev/ttya).";
// OBSOLETE
// OBSOLETE sparclet_ops.to_open = sparclet_open;
// OBSOLETE add_target (&sparclet_ops);
// OBSOLETE }

File diff suppressed because it is too large Load diff

View file

@ -1,902 +0,0 @@
// OBSOLETE /* Sequent Symmetry host interface, for GDB when running under Unix.
// OBSOLETE
// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1999,
// OBSOLETE 2000, 2001, 2003 Free Software Foundation, Inc.
// 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 /* FIXME, some 387-specific items of use taken from i387-tdep.c -- ought to be
// OBSOLETE merged back in. */
// OBSOLETE
// OBSOLETE #include "defs.h"
// OBSOLETE #include "frame.h"
// OBSOLETE #include "inferior.h"
// OBSOLETE #include "symtab.h"
// OBSOLETE #include "target.h"
// OBSOLETE #include "regcache.h"
// OBSOLETE
// OBSOLETE /* FIXME: What is the _INKERNEL define for? */
// OBSOLETE #define _INKERNEL
// OBSOLETE #include <signal.h>
// OBSOLETE #undef _INKERNEL
// OBSOLETE #include "gdb_wait.h"
// OBSOLETE #include <sys/param.h>
// OBSOLETE #include <sys/user.h>
// OBSOLETE #include <sys/proc.h>
// OBSOLETE #include <sys/dir.h>
// OBSOLETE #include <sys/ioctl.h>
// OBSOLETE #include "gdb_stat.h"
// OBSOLETE #ifdef _SEQUENT_
// OBSOLETE #include <sys/ptrace.h>
// OBSOLETE #else
// OBSOLETE /* Dynix has only machine/ptrace.h, which is already included by sys/user.h */
// OBSOLETE /* Dynix has no mptrace call */
// OBSOLETE #define mptrace ptrace
// OBSOLETE #endif
// OBSOLETE #include "gdbcore.h"
// OBSOLETE #include <fcntl.h>
// OBSOLETE #include <sgtty.h>
// OBSOLETE #define TERMINAL struct sgttyb
// OBSOLETE
// OBSOLETE #include "gdbcore.h"
// OBSOLETE
// OBSOLETE void
// OBSOLETE store_inferior_registers (int regno)
// OBSOLETE {
// OBSOLETE struct pt_regset regs;
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE /* FIXME: Fetching the registers is a kludge to initialize all elements
// OBSOLETE in the fpu and fpa status. This works for normal debugging, but
// OBSOLETE might cause problems when calling functions in the inferior.
// OBSOLETE At least fpu_control and fpa_pcr (probably more) should be added
// OBSOLETE to the registers array to solve this properly. */
// OBSOLETE mptrace (XPT_RREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
// OBSOLETE
// OBSOLETE regs.pr_eax = *(int *) &deprecated_registers[REGISTER_BYTE (0)];
// OBSOLETE regs.pr_ebx = *(int *) &deprecated_registers[REGISTER_BYTE (5)];
// OBSOLETE regs.pr_ecx = *(int *) &deprecated_registers[REGISTER_BYTE (2)];
// OBSOLETE regs.pr_edx = *(int *) &deprecated_registers[REGISTER_BYTE (1)];
// OBSOLETE regs.pr_esi = *(int *) &deprecated_registers[REGISTER_BYTE (6)];
// OBSOLETE regs.pr_edi = *(int *) &deprecated_registers[REGISTER_BYTE (7)];
// OBSOLETE regs.pr_esp = *(int *) &deprecated_registers[REGISTER_BYTE (14)];
// OBSOLETE regs.pr_ebp = *(int *) &deprecated_registers[REGISTER_BYTE (15)];
// OBSOLETE regs.pr_eip = *(int *) &deprecated_registers[REGISTER_BYTE (16)];
// OBSOLETE regs.pr_flags = *(int *) &deprecated_registers[REGISTER_BYTE (17)];
// OBSOLETE for (i = 0; i < 31; i++)
// OBSOLETE {
// OBSOLETE regs.pr_fpa.fpa_regs[i] =
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (FP1_REGNUM + i)];
// OBSOLETE }
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[0], &deprecated_registers[REGISTER_BYTE (ST0_REGNUM)], 10);
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[1], &deprecated_registers[REGISTER_BYTE (ST1_REGNUM)], 10);
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[2], &deprecated_registers[REGISTER_BYTE (ST2_REGNUM)], 10);
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[3], &deprecated_registers[REGISTER_BYTE (ST3_REGNUM)], 10);
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[4], &deprecated_registers[REGISTER_BYTE (ST4_REGNUM)], 10);
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[5], &deprecated_registers[REGISTER_BYTE (ST5_REGNUM)], 10);
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[6], &deprecated_registers[REGISTER_BYTE (ST6_REGNUM)], 10);
// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[7], &deprecated_registers[REGISTER_BYTE (ST7_REGNUM)], 10);
// OBSOLETE mptrace (XPT_WREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE fetch_inferior_registers (int regno)
// OBSOLETE {
// OBSOLETE int i;
// OBSOLETE struct pt_regset regs;
// OBSOLETE
// OBSOLETE deprecated_registers_fetched ();
// OBSOLETE
// OBSOLETE mptrace (XPT_RREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EAX_REGNUM)] = regs.pr_eax;
// OBSOLETE *(int *) &rdeprecated_egisters[REGISTER_BYTE (EBX_REGNUM)] = regs.pr_ebx;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (ECX_REGNUM)] = regs.pr_ecx;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EDX_REGNUM)] = regs.pr_edx;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (ESI_REGNUM)] = regs.pr_esi;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EDI_REGNUM)] = regs.pr_edi;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EBP_REGNUM)] = regs.pr_ebp;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (ESP_REGNUM)] = regs.pr_esp;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EIP_REGNUM)] = regs.pr_eip;
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EFLAGS_REGNUM)] = regs.pr_flags;
// OBSOLETE for (i = 0; i < FPA_NREGS; i++)
// OBSOLETE {
// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (FP1_REGNUM + i)] =
// OBSOLETE regs.pr_fpa.fpa_regs[i];
// OBSOLETE }
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST0_REGNUM)], regs.pr_fpu.fpu_stack[0], 10);
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST1_REGNUM)], regs.pr_fpu.fpu_stack[1], 10);
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST2_REGNUM)], regs.pr_fpu.fpu_stack[2], 10);
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST3_REGNUM)], regs.pr_fpu.fpu_stack[3], 10);
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST4_REGNUM)], regs.pr_fpu.fpu_stack[4], 10);
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST5_REGNUM)], regs.pr_fpu.fpu_stack[5], 10);
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST6_REGNUM)], regs.pr_fpu.fpu_stack[6], 10);
// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST7_REGNUM)], regs.pr_fpu.fpu_stack[7], 10);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* FIXME: This should be merged with i387-tdep.c as well. */
// OBSOLETE static
// OBSOLETE print_fpu_status (struct pt_regset ep)
// OBSOLETE {
// OBSOLETE int i;
// OBSOLETE int bothstatus;
// OBSOLETE int top;
// OBSOLETE int fpreg;
// OBSOLETE unsigned char *p;
// OBSOLETE
// OBSOLETE printf_unfiltered ("80387:");
// OBSOLETE if (ep.pr_fpu.fpu_ip == 0)
// OBSOLETE {
// OBSOLETE printf_unfiltered (" not in use.\n");
// OBSOLETE return;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE printf_unfiltered ("\n");
// OBSOLETE }
// OBSOLETE if (ep.pr_fpu.fpu_status != 0)
// OBSOLETE {
// OBSOLETE print_387_status_word (ep.pr_fpu.fpu_status);
// OBSOLETE }
// OBSOLETE print_387_control_word (ep.pr_fpu.fpu_control);
// OBSOLETE printf_unfiltered ("last exception: ");
// OBSOLETE printf_unfiltered ("opcode 0x%x; ", ep.pr_fpu.fpu_rsvd4);
// OBSOLETE printf_unfiltered ("pc 0x%x:0x%x; ", ep.pr_fpu.fpu_cs, ep.pr_fpu.fpu_ip);
// OBSOLETE printf_unfiltered ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset, ep.pr_fpu.fpu_op_sel);
// OBSOLETE
// OBSOLETE top = (ep.pr_fpu.fpu_status >> 11) & 7;
// OBSOLETE
// OBSOLETE printf_unfiltered ("regno tag msb lsb value\n");
// OBSOLETE for (fpreg = 7; fpreg >= 0; fpreg--)
// OBSOLETE {
// OBSOLETE double val;
// OBSOLETE
// OBSOLETE printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
// OBSOLETE
// OBSOLETE switch ((ep.pr_fpu.fpu_tag >> (fpreg * 2)) & 3)
// OBSOLETE {
// OBSOLETE case 0:
// OBSOLETE printf_unfiltered ("valid ");
// OBSOLETE break;
// OBSOLETE case 1:
// OBSOLETE printf_unfiltered ("zero ");
// OBSOLETE break;
// OBSOLETE case 2:
// OBSOLETE printf_unfiltered ("trap ");
// OBSOLETE break;
// OBSOLETE case 3:
// OBSOLETE printf_unfiltered ("empty ");
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE for (i = 9; i >= 0; i--)
// OBSOLETE printf_unfiltered ("%02x", ep.pr_fpu.fpu_stack[fpreg][i]);
// OBSOLETE
// OBSOLETE i387_to_double ((char *) ep.pr_fpu.fpu_stack[fpreg], (char *) &val);
// OBSOLETE printf_unfiltered (" %g\n", val);
// OBSOLETE }
// OBSOLETE if (ep.pr_fpu.fpu_rsvd1)
// OBSOLETE warning ("rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
// OBSOLETE if (ep.pr_fpu.fpu_rsvd2)
// OBSOLETE warning ("rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
// OBSOLETE if (ep.pr_fpu.fpu_rsvd3)
// OBSOLETE warning ("rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
// OBSOLETE if (ep.pr_fpu.fpu_rsvd5)
// OBSOLETE warning ("rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
// OBSOLETE }
// OBSOLETE
// OBSOLETE
// OBSOLETE print_1167_control_word (unsigned int pcr)
// OBSOLETE {
// OBSOLETE int pcr_tmp;
// OBSOLETE
// OBSOLETE pcr_tmp = pcr & FPA_PCR_MODE;
// OBSOLETE printf_unfiltered ("\tMODE= %#x; RND= %#x ", pcr_tmp, pcr_tmp & 12);
// OBSOLETE switch (pcr_tmp & 12)
// OBSOLETE {
// OBSOLETE case 0:
// OBSOLETE printf_unfiltered ("RN (Nearest Value)");
// OBSOLETE break;
// OBSOLETE case 1:
// OBSOLETE printf_unfiltered ("RZ (Zero)");
// OBSOLETE break;
// OBSOLETE case 2:
// OBSOLETE printf_unfiltered ("RP (Positive Infinity)");
// OBSOLETE break;
// OBSOLETE case 3:
// OBSOLETE printf_unfiltered ("RM (Negative Infinity)");
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE printf_unfiltered ("; IRND= %d ", pcr_tmp & 2);
// OBSOLETE if (0 == pcr_tmp & 2)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("(same as RND)\n");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE printf_unfiltered ("(toward zero)\n");
// OBSOLETE }
// OBSOLETE pcr_tmp = pcr & FPA_PCR_EM;
// OBSOLETE printf_unfiltered ("\tEM= %#x", pcr_tmp);
// OBSOLETE if (pcr_tmp & FPA_PCR_EM_DM)
// OBSOLETE printf_unfiltered (" DM");
// OBSOLETE if (pcr_tmp & FPA_PCR_EM_UOM)
// OBSOLETE printf_unfiltered (" UOM");
// OBSOLETE if (pcr_tmp & FPA_PCR_EM_PM)
// OBSOLETE printf_unfiltered (" PM");
// OBSOLETE if (pcr_tmp & FPA_PCR_EM_UM)
// OBSOLETE printf_unfiltered (" UM");
// OBSOLETE if (pcr_tmp & FPA_PCR_EM_OM)
// OBSOLETE printf_unfiltered (" OM");
// OBSOLETE if (pcr_tmp & FPA_PCR_EM_ZM)
// OBSOLETE printf_unfiltered (" ZM");
// OBSOLETE if (pcr_tmp & FPA_PCR_EM_IM)
// OBSOLETE printf_unfiltered (" IM");
// OBSOLETE printf_unfiltered ("\n");
// OBSOLETE pcr_tmp = FPA_PCR_CC;
// OBSOLETE printf_unfiltered ("\tCC= %#x", pcr_tmp);
// OBSOLETE if (pcr_tmp & FPA_PCR_20MHZ)
// OBSOLETE printf_unfiltered (" 20MHZ");
// OBSOLETE if (pcr_tmp & FPA_PCR_CC_Z)
// OBSOLETE printf_unfiltered (" Z");
// OBSOLETE if (pcr_tmp & FPA_PCR_CC_C2)
// OBSOLETE printf_unfiltered (" C2");
// OBSOLETE
// OBSOLETE /* Dynix defines FPA_PCR_CC_C0 to 0x100 and ptx defines
// OBSOLETE FPA_PCR_CC_C1 to 0x100. Use whichever is defined and assume
// OBSOLETE the OS knows what it is doing. */
// OBSOLETE #ifdef FPA_PCR_CC_C1
// OBSOLETE if (pcr_tmp & FPA_PCR_CC_C1)
// OBSOLETE printf_unfiltered (" C1");
// OBSOLETE #else
// OBSOLETE if (pcr_tmp & FPA_PCR_CC_C0)
// OBSOLETE printf_unfiltered (" C0");
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE switch (pcr_tmp)
// OBSOLETE {
// OBSOLETE case FPA_PCR_CC_Z:
// OBSOLETE printf_unfiltered (" (Equal)");
// OBSOLETE break;
// OBSOLETE #ifdef FPA_PCR_CC_C1
// OBSOLETE case FPA_PCR_CC_C1:
// OBSOLETE #else
// OBSOLETE case FPA_PCR_CC_C0:
// OBSOLETE #endif
// OBSOLETE printf_unfiltered (" (Less than)");
// OBSOLETE break;
// OBSOLETE case 0:
// OBSOLETE printf_unfiltered (" (Greater than)");
// OBSOLETE break;
// OBSOLETE case FPA_PCR_CC_Z |
// OBSOLETE #ifdef FPA_PCR_CC_C1
// OBSOLETE FPA_PCR_CC_C1
// OBSOLETE #else
// OBSOLETE FPA_PCR_CC_C0
// OBSOLETE #endif
// OBSOLETE | FPA_PCR_CC_C2:
// OBSOLETE printf_unfiltered (" (Unordered)");
// OBSOLETE break;
// OBSOLETE default:
// OBSOLETE printf_unfiltered (" (Undefined)");
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE printf_unfiltered ("\n");
// OBSOLETE pcr_tmp = pcr & FPA_PCR_AE;
// OBSOLETE printf_unfiltered ("\tAE= %#x", pcr_tmp);
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_DE)
// OBSOLETE printf_unfiltered (" DE");
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_UOE)
// OBSOLETE printf_unfiltered (" UOE");
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_PE)
// OBSOLETE printf_unfiltered (" PE");
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_UE)
// OBSOLETE printf_unfiltered (" UE");
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_OE)
// OBSOLETE printf_unfiltered (" OE");
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_ZE)
// OBSOLETE printf_unfiltered (" ZE");
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_EE)
// OBSOLETE printf_unfiltered (" EE");
// OBSOLETE if (pcr_tmp & FPA_PCR_AE_IE)
// OBSOLETE printf_unfiltered (" IE");
// OBSOLETE printf_unfiltered ("\n");
// OBSOLETE }
// OBSOLETE
// OBSOLETE print_1167_regs (long regs[FPA_NREGS])
// OBSOLETE {
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE union
// OBSOLETE {
// OBSOLETE double d;
// OBSOLETE long l[2];
// OBSOLETE }
// OBSOLETE xd;
// OBSOLETE union
// OBSOLETE {
// OBSOLETE float f;
// OBSOLETE long l;
// OBSOLETE }
// OBSOLETE xf;
// OBSOLETE
// OBSOLETE
// OBSOLETE for (i = 0; i < FPA_NREGS; i++)
// OBSOLETE {
// OBSOLETE xf.l = regs[i];
// OBSOLETE printf_unfiltered ("%%fp%d: raw= %#x, single= %f", i + 1, regs[i], xf.f);
// OBSOLETE if (!(i & 1))
// OBSOLETE {
// OBSOLETE printf_unfiltered ("\n");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE xd.l[1] = regs[i];
// OBSOLETE xd.l[0] = regs[i + 1];
// OBSOLETE printf_unfiltered (", double= %f\n", xd.d);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE print_fpa_status (struct pt_regset ep)
// OBSOLETE {
// OBSOLETE
// OBSOLETE printf_unfiltered ("WTL 1167:");
// OBSOLETE if (ep.pr_fpa.fpa_pcr != 0)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("\n");
// OBSOLETE print_1167_control_word (ep.pr_fpa.fpa_pcr);
// OBSOLETE print_1167_regs (ep.pr_fpa.fpa_regs);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE printf_unfiltered (" not in use.\n");
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE #if 0 /* disabled because it doesn't go through the target vector. */
// OBSOLETE i386_float_info (void)
// OBSOLETE {
// OBSOLETE char ubuf[UPAGES * NBPG];
// OBSOLETE struct pt_regset regset;
// OBSOLETE
// OBSOLETE if (have_inferior_p ())
// OBSOLETE {
// OBSOLETE PTRACE_READ_REGS (PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regset);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE int corechan = bfd_cache_lookup (core_bfd);
// OBSOLETE if (lseek (corechan, 0, 0) < 0)
// OBSOLETE {
// OBSOLETE perror ("seek on core file");
// OBSOLETE }
// OBSOLETE if (myread (corechan, ubuf, UPAGES * NBPG) < 0)
// OBSOLETE {
// OBSOLETE perror ("read on core file");
// OBSOLETE }
// OBSOLETE /* only interested in the floating point registers */
// OBSOLETE regset.pr_fpu = ((struct user *) ubuf)->u_fpusave;
// OBSOLETE regset.pr_fpa = ((struct user *) ubuf)->u_fpasave;
// OBSOLETE }
// OBSOLETE print_fpu_status (regset);
// OBSOLETE print_fpa_status (regset);
// OBSOLETE }
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE static volatile int got_sigchld;
// OBSOLETE
// OBSOLETE /*ARGSUSED */
// OBSOLETE /* This will eventually be more interesting. */
// OBSOLETE void
// OBSOLETE sigchld_handler (int signo)
// OBSOLETE {
// OBSOLETE got_sigchld++;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /*
// OBSOLETE * Signals for which the default action does not cause the process
// OBSOLETE * to die. See <sys/signal.h> for where this came from (alas, we
// OBSOLETE * can't use those macros directly)
// OBSOLETE */
// OBSOLETE #ifndef sigmask
// OBSOLETE #define sigmask(s) (1 << ((s) - 1))
// OBSOLETE #endif
// OBSOLETE #define SIGNALS_DFL_SAFE sigmask(SIGSTOP) | sigmask(SIGTSTP) | \
// OBSOLETE sigmask(SIGTTIN) | sigmask(SIGTTOU) | sigmask(SIGCHLD) | \
// OBSOLETE sigmask(SIGCONT) | sigmask(SIGWINCH) | sigmask(SIGPWR) | \
// OBSOLETE sigmask(SIGURG) | sigmask(SIGPOLL)
// OBSOLETE
// OBSOLETE #ifdef ATTACH_DETACH
// OBSOLETE /*
// OBSOLETE * Thanks to XPT_MPDEBUGGER, we have to mange child_wait().
// OBSOLETE */
// OBSOLETE ptid_t
// OBSOLETE child_wait (ptid_t ptid, struct target_waitstatus *status)
// OBSOLETE {
// OBSOLETE int save_errno, rv, xvaloff, saoff, sa_hand;
// OBSOLETE struct pt_stop pt;
// OBSOLETE struct user u;
// OBSOLETE sigset_t set;
// OBSOLETE /* Host signal number for a signal which the inferior terminates with, or
// OBSOLETE 0 if it hasn't terminated due to a signal. */
// OBSOLETE static int death_by_signal = 0;
// OBSOLETE #ifdef SVR4_SHARED_LIBS /* use this to distinguish ptx 2 vs ptx 4 */
// OBSOLETE prstatus_t pstatus;
// OBSOLETE #endif
// OBSOLETE int pid = PIDGET (ptid);
// OBSOLETE
// OBSOLETE do
// OBSOLETE {
// OBSOLETE set_sigint_trap (); /* Causes SIGINT to be passed on to the
// OBSOLETE attached process. */
// OBSOLETE save_errno = errno;
// OBSOLETE
// OBSOLETE got_sigchld = 0;
// OBSOLETE
// OBSOLETE sigemptyset (&set);
// OBSOLETE
// OBSOLETE while (got_sigchld == 0)
// OBSOLETE {
// OBSOLETE sigsuspend (&set);
// OBSOLETE }
// OBSOLETE
// OBSOLETE clear_sigint_trap ();
// OBSOLETE
// OBSOLETE rv = mptrace (XPT_STOPSTAT, 0, (char *) &pt, 0);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE printf ("XPT_STOPSTAT: errno %d\n", errno); /* DEBUG */
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE
// OBSOLETE pid = pt.ps_pid;
// OBSOLETE
// OBSOLETE if (pid != PIDGET (inferior_ptid))
// OBSOLETE {
// OBSOLETE /* NOTE: the mystery fork in csh/tcsh needs to be ignored.
// OBSOLETE * We should not return new children for the initial run
// OBSOLETE * of a process until it has done the exec.
// OBSOLETE */
// OBSOLETE /* inferior probably forked; send it on its way */
// OBSOLETE rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE printf ("child_wait: XPT_UNDEBUG: pid %d: %s\n", pid,
// OBSOLETE safe_strerror (errno));
// OBSOLETE }
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE /* FIXME: Do we deal with fork notification correctly? */
// OBSOLETE switch (pt.ps_reason)
// OBSOLETE {
// OBSOLETE case PTS_FORK:
// OBSOLETE /* multi proc: treat like PTS_EXEC */
// OBSOLETE /*
// OBSOLETE * Pretend this didn't happen, since gdb isn't set up
// OBSOLETE * to deal with stops on fork.
// OBSOLETE */
// OBSOLETE rv = ptrace (PT_CONTSIG, pid, 1, 0);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE printf ("PTS_FORK: PT_CONTSIG: error %d\n", errno);
// OBSOLETE }
// OBSOLETE continue;
// OBSOLETE case PTS_EXEC:
// OBSOLETE /*
// OBSOLETE * Pretend this is a SIGTRAP.
// OBSOLETE */
// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED;
// OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP;
// OBSOLETE break;
// OBSOLETE case PTS_EXIT:
// OBSOLETE /*
// OBSOLETE * Note: we stop before the exit actually occurs. Extract
// OBSOLETE * the exit code from the uarea. If we're stopped in the
// OBSOLETE * exit() system call, the exit code will be in
// OBSOLETE * u.u_ap[0]. An exit due to an uncaught signal will have
// OBSOLETE * something else in here, see the comment in the default:
// OBSOLETE * case, below. Finally,let the process exit.
// OBSOLETE */
// OBSOLETE if (death_by_signal)
// OBSOLETE {
// OBSOLETE status->kind = TARGET_WAITKIND_SIGNALED;
// OBSOLETE status->value.sig = target_signal_from_host (death_by_signal);
// OBSOLETE death_by_signal = 0;
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE xvaloff = (unsigned long) &u.u_ap[0] - (unsigned long) &u;
// OBSOLETE errno = 0;
// OBSOLETE rv = ptrace (PT_RUSER, pid, (char *) xvaloff, 0);
// OBSOLETE status->kind = TARGET_WAITKIND_EXITED;
// OBSOLETE status->value.integer = rv;
// OBSOLETE /*
// OBSOLETE * addr & data to mptrace() don't matter here, since
// OBSOLETE * the process is already dead.
// OBSOLETE */
// OBSOLETE rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE printf ("child_wait: PTS_EXIT: XPT_UNDEBUG: pid %d error %d\n", pid,
// OBSOLETE errno);
// OBSOLETE }
// OBSOLETE break;
// OBSOLETE case PTS_WATCHPT_HIT:
// OBSOLETE internal_error (__FILE__, __LINE__,
// OBSOLETE "PTS_WATCHPT_HIT\n");
// OBSOLETE break;
// OBSOLETE default:
// OBSOLETE /* stopped by signal */
// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED;
// OBSOLETE status->value.sig = target_signal_from_host (pt.ps_reason);
// OBSOLETE death_by_signal = 0;
// OBSOLETE
// OBSOLETE if (0 == (SIGNALS_DFL_SAFE & sigmask (pt.ps_reason)))
// OBSOLETE {
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE /* else default action of signal is to die */
// OBSOLETE #ifdef SVR4_SHARED_LIBS
// OBSOLETE rv = ptrace (PT_GET_PRSTATUS, pid, (char *) &pstatus, 0);
// OBSOLETE if (-1 == rv)
// OBSOLETE error ("child_wait: signal %d PT_GET_PRSTATUS: %s\n",
// OBSOLETE pt.ps_reason, safe_strerror (errno));
// OBSOLETE if (pstatus.pr_cursig != pt.ps_reason)
// OBSOLETE {
// OBSOLETE printf ("pstatus signal %d, pt signal %d\n",
// OBSOLETE pstatus.pr_cursig, pt.ps_reason);
// OBSOLETE }
// OBSOLETE sa_hand = (int) pstatus.pr_action.sa_handler;
// OBSOLETE #else
// OBSOLETE saoff = (unsigned long) &u.u_sa[0] - (unsigned long) &u;
// OBSOLETE saoff += sizeof (struct sigaction) * (pt.ps_reason - 1);
// OBSOLETE errno = 0;
// OBSOLETE sa_hand = ptrace (PT_RUSER, pid, (char *) saoff, 0);
// OBSOLETE if (errno)
// OBSOLETE error ("child_wait: signal %d: RUSER: %s\n",
// OBSOLETE pt.ps_reason, safe_strerror (errno));
// OBSOLETE #endif
// OBSOLETE if ((int) SIG_DFL == sa_hand)
// OBSOLETE {
// OBSOLETE /* we will be dying */
// OBSOLETE death_by_signal = pt.ps_reason;
// OBSOLETE }
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE
// OBSOLETE }
// OBSOLETE while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */
// OBSOLETE
// OBSOLETE return pid_to_ptid (pid);
// OBSOLETE }
// OBSOLETE #else /* !ATTACH_DETACH */
// OBSOLETE /*
// OBSOLETE * Simple child_wait() based on inftarg.c child_wait() for use until
// OBSOLETE * the MPDEBUGGER child_wait() works properly. This will go away when
// OBSOLETE * that is fixed.
// OBSOLETE */
// OBSOLETE ptid_t
// OBSOLETE child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
// OBSOLETE {
// OBSOLETE int save_errno;
// OBSOLETE int status;
// OBSOLETE int pid = PIDGET (ptid);
// OBSOLETE
// OBSOLETE do
// OBSOLETE {
// OBSOLETE pid = wait (&status);
// OBSOLETE save_errno = errno;
// OBSOLETE
// OBSOLETE if (pid == -1)
// OBSOLETE {
// OBSOLETE if (save_errno == EINTR)
// OBSOLETE continue;
// OBSOLETE fprintf (stderr, "Child process unexpectedly missing: %s.\n",
// OBSOLETE safe_strerror (save_errno));
// OBSOLETE ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
// OBSOLETE ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
// OBSOLETE return pid_to_ptid (-1);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */
// OBSOLETE store_waitstatus (ourstatus, status);
// OBSOLETE return pid_to_ptid (pid);
// OBSOLETE }
// OBSOLETE #endif /* ATTACH_DETACH */
// OBSOLETE
// OBSOLETE
// OBSOLETE
// OBSOLETE /* This function simply calls ptrace with the given arguments.
// OBSOLETE It exists so that all calls to ptrace are isolated in this
// OBSOLETE machine-dependent file. */
// OBSOLETE int
// OBSOLETE call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data)
// OBSOLETE {
// OBSOLETE return ptrace (request, pid, addr, data);
// OBSOLETE }
// OBSOLETE
// OBSOLETE int
// OBSOLETE call_mptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data)
// OBSOLETE {
// OBSOLETE return mptrace (request, pid, addr, data);
// OBSOLETE }
// OBSOLETE
// OBSOLETE #if defined (DEBUG_PTRACE)
// OBSOLETE /* For the rest of the file, use an extra level of indirection */
// OBSOLETE /* This lets us breakpoint usefully on call_ptrace. */
// OBSOLETE #define ptrace call_ptrace
// OBSOLETE #define mptrace call_mptrace
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE void
// OBSOLETE kill_inferior (void)
// OBSOLETE {
// OBSOLETE if (ptid_equal (inferior_ptid, null_ptid))
// OBSOLETE return;
// OBSOLETE
// OBSOLETE /* For MPDEBUGGER, don't use PT_KILL, since the child will stop
// OBSOLETE again with a PTS_EXIT. Just hit him with SIGKILL (so he stops)
// OBSOLETE and detach. */
// OBSOLETE
// OBSOLETE kill (PIDGET (inferior_ptid), SIGKILL);
// OBSOLETE #ifdef ATTACH_DETACH
// OBSOLETE detach (SIGKILL);
// OBSOLETE #else /* ATTACH_DETACH */
// OBSOLETE ptrace (PT_KILL, PIDGET (inferior_ptid), 0, 0);
// OBSOLETE wait ((int *) NULL);
// OBSOLETE #endif /* ATTACH_DETACH */
// OBSOLETE target_mourn_inferior ();
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Resume execution of the inferior process.
// OBSOLETE If STEP is nonzero, single-step it.
// OBSOLETE If SIGNAL is nonzero, give it that signal. */
// OBSOLETE
// OBSOLETE void
// OBSOLETE child_resume (ptid_t ptid, int step, enum target_signal signal)
// OBSOLETE {
// OBSOLETE int pid = PIDGET (ptid);
// OBSOLETE
// OBSOLETE errno = 0;
// OBSOLETE
// OBSOLETE if (pid == -1)
// OBSOLETE pid = PIDGET (inferior_ptid);
// OBSOLETE
// OBSOLETE /* An address of (PTRACE_ARG3_TYPE)1 tells ptrace to continue from where
// OBSOLETE it was. (If GDB wanted it to start some other way, we have already
// OBSOLETE written a new PC value to the child.)
// OBSOLETE
// OBSOLETE If this system does not support PT_SSTEP, a higher level function will
// OBSOLETE have called single_step() to transmute the step request into a
// OBSOLETE continue request (by setting breakpoints on all possible successor
// OBSOLETE instructions), so we don't have to worry about that here. */
// OBSOLETE
// OBSOLETE if (step)
// OBSOLETE ptrace (PT_SSTEP, pid, (PTRACE_ARG3_TYPE) 1, signal);
// OBSOLETE else
// OBSOLETE ptrace (PT_CONTSIG, pid, (PTRACE_ARG3_TYPE) 1, signal);
// OBSOLETE
// OBSOLETE if (errno)
// OBSOLETE perror_with_name ("ptrace");
// OBSOLETE }
// OBSOLETE
// OBSOLETE #ifdef ATTACH_DETACH
// OBSOLETE /* Start debugging the process whose number is PID. */
// OBSOLETE int
// OBSOLETE attach (int pid)
// OBSOLETE {
// OBSOLETE sigset_t set;
// OBSOLETE int rv;
// OBSOLETE
// OBSOLETE rv = mptrace (XPT_DEBUG, pid, 0, 0);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE error ("mptrace(XPT_DEBUG): %s", safe_strerror (errno));
// OBSOLETE }
// OBSOLETE rv = mptrace (XPT_SIGNAL, pid, 0, SIGSTOP);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE error ("mptrace(XPT_SIGNAL): %s", safe_strerror (errno));
// OBSOLETE }
// OBSOLETE attach_flag = 1;
// OBSOLETE return pid;
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE detach (int signo)
// OBSOLETE {
// OBSOLETE int rv;
// OBSOLETE
// OBSOLETE rv = mptrace (XPT_UNDEBUG, PIDGET (inferior_ptid), 1, signo);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE error ("mptrace(XPT_UNDEBUG): %s", safe_strerror (errno));
// OBSOLETE }
// OBSOLETE attach_flag = 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE #endif /* ATTACH_DETACH */
// OBSOLETE
// OBSOLETE /* Default the type of the ptrace transfer to int. */
// OBSOLETE #ifndef PTRACE_XFER_TYPE
// OBSOLETE #define PTRACE_XFER_TYPE int
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE
// OBSOLETE /* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
// OBSOLETE in the NEW_SUN_PTRACE case.
// OBSOLETE It ought to be straightforward. But it appears that writing did
// OBSOLETE not write the data that I specified. I cannot understand where
// OBSOLETE it got the data that it actually did write. */
// OBSOLETE
// OBSOLETE /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
// OBSOLETE to debugger memory starting at MYADDR. Copy to inferior if
// OBSOLETE WRITE is nonzero. TARGET is ignored.
// OBSOLETE
// OBSOLETE Returns the length copied, which is either the LEN argument or zero.
// OBSOLETE This xfer function does not do partial moves, since child_ops
// OBSOLETE doesn't allow memory operations to cross below us in the target stack
// OBSOLETE anyway. */
// OBSOLETE
// OBSOLETE int
// OBSOLETE child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
// OBSOLETE struct mem_attrib *attrib,
// OBSOLETE struct target_ops *target)
// OBSOLETE {
// OBSOLETE register int i;
// OBSOLETE /* Round starting address down to longword boundary. */
// OBSOLETE register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
// OBSOLETE /* Round ending address up; get number of longwords that makes. */
// OBSOLETE register int count
// OBSOLETE = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
// OBSOLETE / sizeof (PTRACE_XFER_TYPE);
// OBSOLETE /* Allocate buffer of that many longwords. */
// OBSOLETE /* FIXME (alloca): This code, cloned from infptrace.c, is unsafe
// OBSOLETE because it uses alloca to allocate a buffer of arbitrary size.
// OBSOLETE For very large xfers, this could crash GDB's stack. */
// OBSOLETE register PTRACE_XFER_TYPE *buffer
// OBSOLETE = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
// OBSOLETE
// OBSOLETE if (write)
// OBSOLETE {
// OBSOLETE /* Fill start and end extra bytes of buffer with existing memory data. */
// OBSOLETE
// OBSOLETE if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
// OBSOLETE {
// OBSOLETE /* Need part of initial word -- fetch it. */
// OBSOLETE buffer[0] = ptrace (PT_RTEXT, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) addr,
// OBSOLETE 0);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (count > 1) /* FIXME, avoid if even boundary */
// OBSOLETE {
// OBSOLETE buffer[count - 1]
// OBSOLETE = ptrace (PT_RTEXT, PIDGET (inferior_ptid),
// OBSOLETE ((PTRACE_ARG3_TYPE)
// OBSOLETE (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))),
// OBSOLETE 0);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Copy data to be written over corresponding part of buffer */
// OBSOLETE
// OBSOLETE memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
// OBSOLETE myaddr,
// OBSOLETE len);
// OBSOLETE
// OBSOLETE /* Write the entire buffer. */
// OBSOLETE
// OBSOLETE for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
// OBSOLETE {
// OBSOLETE errno = 0;
// OBSOLETE ptrace (PT_WDATA, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) addr,
// OBSOLETE buffer[i]);
// OBSOLETE if (errno)
// OBSOLETE {
// OBSOLETE /* Using the appropriate one (I or D) is necessary for
// OBSOLETE Gould NP1, at least. */
// OBSOLETE errno = 0;
// OBSOLETE ptrace (PT_WTEXT, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) addr,
// OBSOLETE buffer[i]);
// OBSOLETE }
// OBSOLETE if (errno)
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE /* Read all the longwords */
// OBSOLETE for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
// OBSOLETE {
// OBSOLETE errno = 0;
// OBSOLETE buffer[i] = ptrace (PT_RTEXT, PIDGET (inferior_ptid),
// OBSOLETE (PTRACE_ARG3_TYPE) addr, 0);
// OBSOLETE if (errno)
// OBSOLETE return 0;
// OBSOLETE QUIT;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Copy appropriate bytes out of the buffer. */
// OBSOLETE memcpy (myaddr,
// OBSOLETE (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
// OBSOLETE len);
// OBSOLETE }
// OBSOLETE return len;
// OBSOLETE }
// OBSOLETE
// OBSOLETE
// OBSOLETE void
// OBSOLETE _initialize_symm_nat (void)
// OBSOLETE {
// OBSOLETE #ifdef ATTACH_DETACH
// OBSOLETE /*
// OBSOLETE * the MPDEBUGGER is necessary for process tree debugging and attach
// OBSOLETE * to work, but it alters the behavior of debugged processes, so other
// OBSOLETE * things (at least child_wait()) will have to change to accomodate
// OBSOLETE * that.
// OBSOLETE *
// OBSOLETE * Note that attach is not implemented in dynix 3, and not in ptx
// OBSOLETE * until version 2.1 of the OS.
// OBSOLETE */
// OBSOLETE int rv;
// OBSOLETE sigset_t set;
// OBSOLETE struct sigaction sact;
// OBSOLETE
// OBSOLETE rv = mptrace (XPT_MPDEBUGGER, 0, 0, 0);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE internal_error (__FILE__, __LINE__,
// OBSOLETE "_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s",
// OBSOLETE safe_strerror (errno));
// OBSOLETE }
// OBSOLETE
// OBSOLETE /*
// OBSOLETE * Under MPDEBUGGER, we get SIGCLHD when a traced process does
// OBSOLETE * anything of interest.
// OBSOLETE */
// OBSOLETE
// OBSOLETE /*
// OBSOLETE * Block SIGCHLD. We leave it blocked all the time, and then
// OBSOLETE * call sigsuspend() in child_wait() to wait for the child
// OBSOLETE * to do something. None of these ought to fail, but check anyway.
// OBSOLETE */
// OBSOLETE sigemptyset (&set);
// OBSOLETE rv = sigaddset (&set, SIGCHLD);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE internal_error (__FILE__, __LINE__,
// OBSOLETE "_initialize_symm_nat(): sigaddset(SIGCHLD): %s",
// OBSOLETE safe_strerror (errno));
// OBSOLETE }
// OBSOLETE rv = sigprocmask (SIG_BLOCK, &set, (sigset_t *) NULL);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE internal_error (__FILE__, __LINE__,
// OBSOLETE "_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s",
// OBSOLETE safe_strerror (errno));
// OBSOLETE }
// OBSOLETE
// OBSOLETE sact.sa_handler = sigchld_handler;
// OBSOLETE sigemptyset (&sact.sa_mask);
// OBSOLETE sact.sa_flags = SA_NOCLDWAIT; /* keep the zombies away */
// OBSOLETE rv = sigaction (SIGCHLD, &sact, (struct sigaction *) NULL);
// OBSOLETE if (-1 == rv)
// OBSOLETE {
// OBSOLETE internal_error (__FILE__, __LINE__,
// OBSOLETE "_initialize_symm_nat(): sigaction(SIGCHLD): %s",
// OBSOLETE safe_strerror (errno));
// OBSOLETE }
// OBSOLETE #endif
// OBSOLETE }

View file

@ -1,102 +0,0 @@
// OBSOLETE /* Sequent Symmetry target interface, for GDB.
// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2000
// OBSOLETE Free Software Foundation, Inc.
// 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 /* many 387-specific items of use taken from i386-dep.c */
// OBSOLETE
// OBSOLETE #include "defs.h"
// OBSOLETE #include "frame.h"
// OBSOLETE #include "inferior.h"
// OBSOLETE #include "symtab.h"
// OBSOLETE
// OBSOLETE #include <signal.h>
// OBSOLETE #include <sys/param.h>
// OBSOLETE #include <sys/user.h>
// OBSOLETE #include <sys/dir.h>
// OBSOLETE #include <sys/ioctl.h>
// OBSOLETE #include "gdb_stat.h"
// OBSOLETE #include "gdbcore.h"
// OBSOLETE #include <fcntl.h>
// OBSOLETE
// OBSOLETE void
// OBSOLETE symmetry_extract_return_value (struct type *type, char *regbuf, char *valbuf)
// OBSOLETE {
// OBSOLETE union
// OBSOLETE {
// OBSOLETE double d;
// OBSOLETE int l[2];
// OBSOLETE }
// OBSOLETE xd;
// OBSOLETE struct minimal_symbol *msymbol;
// OBSOLETE float f;
// OBSOLETE
// OBSOLETE if (TYPE_CODE_FLT == TYPE_CODE (type))
// OBSOLETE {
// OBSOLETE msymbol = lookup_minimal_symbol ("1167_flt", NULL, NULL);
// OBSOLETE if (msymbol != NULL)
// OBSOLETE {
// OBSOLETE /* found "1167_flt" means 1167, %fp2-%fp3 */
// OBSOLETE /* float & double; 19= %fp2, 20= %fp3 */
// OBSOLETE /* no single precision on 1167 */
// OBSOLETE xd.l[1] = *((int *) &regbuf[REGISTER_BYTE (19)]);
// OBSOLETE xd.l[0] = *((int *) &regbuf[REGISTER_BYTE (20)]);
// OBSOLETE switch (TYPE_LENGTH (type))
// OBSOLETE {
// OBSOLETE case 4:
// OBSOLETE /* FIXME: broken for cross-debugging. */
// OBSOLETE f = (float) xd.d;
// OBSOLETE memcpy (valbuf, &f, TYPE_LENGTH (type));
// OBSOLETE break;
// OBSOLETE case 8:
// OBSOLETE /* FIXME: broken for cross-debugging. */
// OBSOLETE memcpy (valbuf, &xd.d, TYPE_LENGTH (type));
// OBSOLETE break;
// OBSOLETE default:
// OBSOLETE error ("Unknown floating point size");
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE /* 387 %st(0), gcc uses this */
// OBSOLETE i387_to_double (((int *) &regbuf[REGISTER_BYTE (3)]),
// OBSOLETE &xd.d);
// OBSOLETE switch (TYPE_LENGTH (type))
// OBSOLETE {
// OBSOLETE case 4: /* float */
// OBSOLETE f = (float) xd.d;
// OBSOLETE /* FIXME: broken for cross-debugging. */
// OBSOLETE memcpy (valbuf, &f, 4);
// OBSOLETE break;
// OBSOLETE case 8: /* double */
// OBSOLETE /* FIXME: broken for cross-debugging. */
// OBSOLETE memcpy (valbuf, &xd.d, 8);
// OBSOLETE break;
// OBSOLETE default:
// OBSOLETE error ("Unknown floating point size");
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE memcpy (valbuf, regbuf, TYPE_LENGTH (type));
// OBSOLETE }
// OBSOLETE }

View file

@ -1,535 +0,0 @@
// OBSOLETE /* Target-machine dependent code for Zilog Z8000, for GDB.
// OBSOLETE
// OBSOLETE Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
// OBSOLETE 2002, 2003 Free Software Foundation, Inc.
// OBSOLETE
// OBSOLETE This file is part of GDB.
// OBSOLETE
// OBSOLETE This program is free software; you can redistribute it and/or modify
// OBSOLETE it under the terms of the GNU General Public License as published by
// OBSOLETE the Free Software Foundation; either version 2 of the License, or
// OBSOLETE (at your option) any later version.
// OBSOLETE
// OBSOLETE This program is distributed in the hope that it will be useful,
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// OBSOLETE GNU General Public License for more details.
// OBSOLETE
// OBSOLETE You should have received a copy of the GNU General Public License
// OBSOLETE along with this program; if not, write to the Free Software
// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
// OBSOLETE Boston, MA 02111-1307, USA. */
// OBSOLETE
// OBSOLETE /*
// OBSOLETE Contributed by Steve Chamberlain
// OBSOLETE sac@cygnus.com
// OBSOLETE */
// OBSOLETE
// OBSOLETE #include "defs.h"
// OBSOLETE #include "frame.h"
// OBSOLETE #include "symtab.h"
// OBSOLETE #include "gdbcmd.h"
// OBSOLETE #include "gdbtypes.h"
// OBSOLETE #include "dis-asm.h"
// OBSOLETE #include "gdbcore.h"
// OBSOLETE #include "regcache.h"
// OBSOLETE
// OBSOLETE #include "value.h" /* For read_register() */
// OBSOLETE
// OBSOLETE
// OBSOLETE static int read_memory_pointer (CORE_ADDR x);
// OBSOLETE
// OBSOLETE /* Return the saved PC from this frame.
// OBSOLETE
// OBSOLETE If the frame has a memory copy of SRP_REGNUM, use that. If not,
// OBSOLETE just use the register SRP_REGNUM itself. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE z8k_frame_saved_pc (struct frame_info *frame)
// OBSOLETE {
// OBSOLETE return read_memory_pointer (frame->frame + (BIG ? 4 : 2));
// OBSOLETE }
// OBSOLETE
// OBSOLETE #define IS_PUSHL(x) (BIG ? ((x & 0xfff0) == 0x91e0):((x & 0xfff0) == 0x91F0))
// OBSOLETE #define IS_PUSHW(x) (BIG ? ((x & 0xfff0) == 0x93e0):((x & 0xfff0)==0x93f0))
// OBSOLETE #define IS_MOVE_FP(x) (BIG ? x == 0xa1ea : x == 0xa1fa)
// OBSOLETE #define IS_MOV_SP_FP(x) (BIG ? x == 0x94ea : x == 0x0d76)
// OBSOLETE #define IS_SUB2_SP(x) (x==0x1b87)
// OBSOLETE #define IS_MOVK_R5(x) (x==0x7905)
// OBSOLETE #define IS_SUB_SP(x) ((x & 0xffff) == 0x020f)
// OBSOLETE #define IS_PUSH_FP(x) (BIG ? (x == 0x93ea) : (x == 0x93fa))
// OBSOLETE
// OBSOLETE /* work out how much local space is on the stack and
// OBSOLETE return the pc pointing to the first push */
// OBSOLETE
// OBSOLETE static CORE_ADDR
// OBSOLETE skip_adjust (CORE_ADDR pc, int *size)
// OBSOLETE {
// OBSOLETE *size = 0;
// OBSOLETE
// OBSOLETE if (IS_PUSH_FP (read_memory_short (pc))
// OBSOLETE && IS_MOV_SP_FP (read_memory_short (pc + 2)))
// OBSOLETE {
// OBSOLETE /* This is a function with an explict frame pointer */
// OBSOLETE pc += 4;
// OBSOLETE *size += 2; /* remember the frame pointer */
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* remember any stack adjustment */
// OBSOLETE if (IS_SUB_SP (read_memory_short (pc)))
// OBSOLETE {
// OBSOLETE *size += read_memory_short (pc + 2);
// OBSOLETE pc += 4;
// OBSOLETE }
// OBSOLETE return pc;
// OBSOLETE }
// OBSOLETE
// OBSOLETE static CORE_ADDR examine_frame (CORE_ADDR, CORE_ADDR * regs, CORE_ADDR);
// OBSOLETE static CORE_ADDR
// OBSOLETE examine_frame (CORE_ADDR pc, CORE_ADDR *regs, CORE_ADDR sp)
// OBSOLETE {
// OBSOLETE int w = read_memory_short (pc);
// OBSOLETE int offset = 0;
// OBSOLETE int regno;
// OBSOLETE
// OBSOLETE for (regno = 0; regno < NUM_REGS; regno++)
// OBSOLETE regs[regno] = 0;
// OBSOLETE
// OBSOLETE while (IS_PUSHW (w) || IS_PUSHL (w))
// OBSOLETE {
// OBSOLETE /* work out which register is being pushed to where */
// OBSOLETE if (IS_PUSHL (w))
// OBSOLETE {
// OBSOLETE regs[w & 0xf] = offset;
// OBSOLETE regs[(w & 0xf) + 1] = offset + 2;
// OBSOLETE offset += 4;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE regs[w & 0xf] = offset;
// OBSOLETE offset += 2;
// OBSOLETE }
// OBSOLETE pc += 2;
// OBSOLETE w = read_memory_short (pc);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if (IS_MOVE_FP (w))
// OBSOLETE {
// OBSOLETE /* We know the fp */
// OBSOLETE
// OBSOLETE }
// OBSOLETE else if (IS_SUB_SP (w))
// OBSOLETE {
// OBSOLETE /* Subtracting a value from the sp, so were in a function
// OBSOLETE which needs stack space for locals, but has no fp. We fake up
// OBSOLETE the values as if we had an fp */
// OBSOLETE regs[FP_REGNUM] = sp;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE /* This one didn't have an fp, we'll fake it up */
// OBSOLETE regs[SP_REGNUM] = sp;
// OBSOLETE }
// OBSOLETE /* stack pointer contains address of next frame */
// OBSOLETE /* regs[fp_regnum()] = fp; */
// OBSOLETE regs[SP_REGNUM] = sp;
// OBSOLETE return pc;
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE z8k_skip_prologue (CORE_ADDR start_pc)
// OBSOLETE {
// OBSOLETE CORE_ADDR dummy[NUM_REGS];
// OBSOLETE
// OBSOLETE return examine_frame (start_pc, dummy, 0);
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE z8k_addr_bits_remove (CORE_ADDR addr)
// OBSOLETE {
// OBSOLETE return (addr & PTR_MASK);
// OBSOLETE }
// OBSOLETE
// OBSOLETE static int
// OBSOLETE read_memory_pointer (CORE_ADDR x)
// OBSOLETE {
// OBSOLETE return read_memory_integer (ADDR_BITS_REMOVE (x), BIG ? 4 : 2);
// OBSOLETE }
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE z8k_frame_chain (struct frame_info *thisframe)
// OBSOLETE {
// OBSOLETE if (!inside_entry_file (get_frame_pc (thisframe)))
// OBSOLETE {
// OBSOLETE return read_memory_pointer (thisframe->frame);
// OBSOLETE }
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO.
// OBSOLETE This includes special registers such as pc and fp saved in special
// OBSOLETE ways in the stack frame. sp is even more special:
// OBSOLETE the address we return for it IS the sp for the next frame. */
// OBSOLETE
// OBSOLETE void
// OBSOLETE z8k_frame_init_saved_regs (struct frame_info *frame_info)
// OBSOLETE {
// OBSOLETE CORE_ADDR pc;
// OBSOLETE int w;
// OBSOLETE
// OBSOLETE frame_saved_regs_zalloc (frame_info);
// OBSOLETE pc = get_pc_function_start (get_frame_pc (frame_info));
// OBSOLETE
// OBSOLETE /* wander down the instruction stream */
// OBSOLETE examine_frame (pc, frame_info->saved_regs, frame_info->frame);
// OBSOLETE
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE z8k_push_dummy_frame (void)
// OBSOLETE {
// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check");
// OBSOLETE }
// OBSOLETE
// OBSOLETE int
// OBSOLETE gdb_print_insn_z8k (bfd_vma memaddr, disassemble_info *info)
// OBSOLETE {
// OBSOLETE if (BIG)
// OBSOLETE return print_insn_z8001 (memaddr, info);
// OBSOLETE else
// OBSOLETE return print_insn_z8002 (memaddr, info);
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
// OBSOLETE is not the address of a valid instruction, the address of the next
// OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word
// OBSOLETE of the instruction. */
// OBSOLETE
// OBSOLETE CORE_ADDR
// OBSOLETE NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, short *pword1)
// OBSOLETE {
// OBSOLETE char buf[2];
// OBSOLETE if (addr < lim + 8)
// OBSOLETE {
// OBSOLETE read_memory (addr, buf, 2);
// OBSOLETE *pword1 = extract_signed_integer (buf, 2);
// OBSOLETE
// OBSOLETE return addr + 2;
// OBSOLETE }
// OBSOLETE return 0;
// OBSOLETE }
// OBSOLETE
// OBSOLETE #if 0
// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO.
// OBSOLETE This includes special registers such as pc and fp saved in special
// OBSOLETE ways in the stack frame. sp is even more special:
// OBSOLETE the address we return for it IS the sp for the next frame.
// OBSOLETE
// OBSOLETE We cache the result of doing this in the frame_cache_obstack, since
// OBSOLETE it is fairly expensive. */
// OBSOLETE
// OBSOLETE void
// OBSOLETE frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp)
// OBSOLETE {
// OBSOLETE int locals;
// OBSOLETE CORE_ADDR pc;
// OBSOLETE CORE_ADDR adr;
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE memset (fsrp, 0, sizeof *fsrp);
// OBSOLETE
// OBSOLETE pc = skip_adjust (get_pc_function_start (get_frame_pc (fip)), &locals);
// OBSOLETE
// OBSOLETE {
// OBSOLETE adr = get_frame_base (fip) - locals;
// OBSOLETE for (i = 0; i < 8; i++)
// OBSOLETE {
// OBSOLETE int word = read_memory_short (pc);
// OBSOLETE
// OBSOLETE pc += 2;
// OBSOLETE if (IS_PUSHL (word))
// OBSOLETE {
// OBSOLETE fsrp->regs[word & 0xf] = adr;
// OBSOLETE fsrp->regs[(word & 0xf) + 1] = adr - 2;
// OBSOLETE adr -= 4;
// OBSOLETE }
// OBSOLETE else if (IS_PUSHW (word))
// OBSOLETE {
// OBSOLETE fsrp->regs[word & 0xf] = adr;
// OBSOLETE adr -= 2;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE break;
// OBSOLETE }
// OBSOLETE
// OBSOLETE }
// OBSOLETE
// OBSOLETE fsrp->regs[PC_REGNUM] = fip->frame + 4;
// OBSOLETE fsrp->regs[FP_REGNUM] = fip->frame;
// OBSOLETE
// OBSOLETE }
// OBSOLETE #endif
// OBSOLETE
// OBSOLETE int
// OBSOLETE z8k_saved_pc_after_call (struct frame_info *frame)
// OBSOLETE {
// OBSOLETE return ADDR_BITS_REMOVE
// OBSOLETE (read_memory_integer (read_register (SP_REGNUM), PTR_SIZE));
// OBSOLETE }
// OBSOLETE
// OBSOLETE
// OBSOLETE void
// OBSOLETE extract_return_value (struct type *type, char *regbuf, char *valbuf)
// OBSOLETE {
// OBSOLETE int b;
// OBSOLETE int len = TYPE_LENGTH (type);
// OBSOLETE
// OBSOLETE for (b = 0; b < len; b += 2)
// OBSOLETE {
// OBSOLETE int todo = len - b;
// OBSOLETE
// OBSOLETE if (todo > 2)
// OBSOLETE todo = 2;
// OBSOLETE memcpy (valbuf + b, regbuf + b, todo);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE write_return_value (struct type *type, char *valbuf)
// OBSOLETE {
// OBSOLETE int reg;
// OBSOLETE int len;
// OBSOLETE
// OBSOLETE for (len = 0; len < TYPE_LENGTH (type); len += 2)
// OBSOLETE deprecated_write_register_bytes (REGISTER_BYTE (len / 2 + 2),
// OBSOLETE valbuf + len, 2);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
// OBSOLETE {
// OBSOLETE write_register (2, addr);
// OBSOLETE }
// OBSOLETE
// OBSOLETE
// OBSOLETE static void
// OBSOLETE z8k_print_register_hook (int regno)
// OBSOLETE {
// OBSOLETE if ((regno & 1) == 0 && regno < 16)
// OBSOLETE {
// OBSOLETE unsigned char l[4];
// OBSOLETE
// OBSOLETE frame_register_read (deprecated_selected_frame, regno, l + 0);
// OBSOLETE frame_register_read (deprecated_selected_frame, regno + 1, l + 2);
// OBSOLETE printf_unfiltered ("\t");
// OBSOLETE printf_unfiltered ("0x%02x%02x%02x%02x", l[0], l[1], l[2], l[3]);
// OBSOLETE }
// OBSOLETE
// OBSOLETE if ((regno & 3) == 0 && regno < 16)
// OBSOLETE {
// OBSOLETE unsigned char l[8];
// OBSOLETE
// OBSOLETE frame_register_read (deprecated_selected_frame, regno, l + 0);
// OBSOLETE frame_register_read (deprecated_selected_frame, regno + 1, l + 2);
// OBSOLETE frame_register_read (deprecated_selected_frame, regno + 2, l + 4);
// OBSOLETE frame_register_read (deprecated_selected_frame, regno + 3, l + 6);
// OBSOLETE
// OBSOLETE printf_unfiltered ("\t");
// OBSOLETE printf_unfiltered ("0x%02x%02x%02x%02x%02x%02x%02x%02x",
// OBSOLETE l[0], l[1], l[2], l[3], l[4], l[5], l[6], l[7]);
// OBSOLETE }
// OBSOLETE if (regno == 15)
// OBSOLETE {
// OBSOLETE unsigned short rval;
// OBSOLETE int i;
// OBSOLETE
// OBSOLETE frame_register_read (deprecated_selected_frame, regno, (char *) (&rval));
// OBSOLETE
// OBSOLETE printf_unfiltered ("\n");
// OBSOLETE for (i = 0; i < 10; i += 2)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("(sp+%d=%04x)", i,
// OBSOLETE (unsigned int)read_memory_short (rval + i));
// OBSOLETE }
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE z8k_print_registers_info (struct gdbarch *gdbarch,
// OBSOLETE struct ui_file *file,
// OBSOLETE struct frame_info *frame,
// OBSOLETE int regnum, int print_all)
// OBSOLETE {
// OBSOLETE int i;
// OBSOLETE const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
// OBSOLETE char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
// OBSOLETE char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
// OBSOLETE
// OBSOLETE for (i = 0; i < numregs; i++)
// OBSOLETE {
// OBSOLETE /* Decide between printing all regs, non-float / vector regs, or
// OBSOLETE specific reg. */
// OBSOLETE if (regnum == -1)
// OBSOLETE {
// OBSOLETE if (!print_all)
// OBSOLETE {
// OBSOLETE if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
// OBSOLETE continue;
// OBSOLETE if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE if (i != regnum)
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* If the register name is empty, it is undefined for this
// OBSOLETE processor, so don't display anything. */
// OBSOLETE if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
// OBSOLETE continue;
// OBSOLETE
// OBSOLETE fputs_filtered (REGISTER_NAME (i), file);
// OBSOLETE print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
// OBSOLETE
// OBSOLETE /* Get the data in raw format. */
// OBSOLETE if (! frame_register_read (frame, i, raw_buffer))
// OBSOLETE {
// OBSOLETE fprintf_filtered (file, "*value not available*\n");
// OBSOLETE continue;
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
// OBSOLETE The function frame_register_read() should have returned the
// OBSOLETE pre-cooked register so no conversion is necessary. */
// OBSOLETE /* Convert raw data to virtual format if necessary. */
// OBSOLETE if (REGISTER_CONVERTIBLE (i))
// OBSOLETE {
// OBSOLETE REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
// OBSOLETE raw_buffer, virtual_buffer);
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE memcpy (virtual_buffer, raw_buffer,
// OBSOLETE REGISTER_VIRTUAL_SIZE (i));
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* If virtual format is floating, print it that way, and in raw
// OBSOLETE hex. */
// OBSOLETE if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
// OBSOLETE {
// OBSOLETE int j;
// OBSOLETE
// OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
// OBSOLETE file, 0, 1, 0, Val_pretty_default);
// OBSOLETE
// OBSOLETE fprintf_filtered (file, "\t(raw 0x");
// OBSOLETE for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
// OBSOLETE {
// OBSOLETE int idx;
// OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
// OBSOLETE idx = j;
// OBSOLETE else
// OBSOLETE idx = REGISTER_RAW_SIZE (i) - 1 - j;
// OBSOLETE fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
// OBSOLETE }
// OBSOLETE fprintf_filtered (file, ")");
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE /* Print the register in hex. */
// OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
// OBSOLETE file, 'x', 1, 0, Val_pretty_default);
// OBSOLETE /* If not a vector register, print it also according to its
// OBSOLETE natural format. */
// OBSOLETE if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
// OBSOLETE {
// OBSOLETE fprintf_filtered (file, "\t");
// OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
// OBSOLETE file, 0, 1, 0, Val_pretty_default);
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE /* Some z8k specific info. */
// OBSOLETE z8k_print_register_hook (i);
// OBSOLETE
// OBSOLETE fprintf_filtered (file, "\n");
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE z8k_do_registers_info (int regnum, int all)
// OBSOLETE {
// OBSOLETE z8k_print_registers_info (current_gdbarch, gdb_stdout,
// OBSOLETE deprecated_selected_frame, regnum, all);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE z8k_pop_frame (void)
// OBSOLETE {
// OBSOLETE }
// OBSOLETE
// OBSOLETE struct cmd_list_element *setmemorylist;
// OBSOLETE
// OBSOLETE void
// OBSOLETE z8k_set_pointer_size (int newsize)
// OBSOLETE {
// OBSOLETE static int oldsize = 0;
// OBSOLETE
// OBSOLETE if (oldsize != newsize)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("pointer size set to %d bits\n", newsize);
// OBSOLETE oldsize = newsize;
// OBSOLETE if (newsize == 32)
// OBSOLETE {
// OBSOLETE BIG = 1;
// OBSOLETE }
// OBSOLETE else
// OBSOLETE {
// OBSOLETE BIG = 0;
// OBSOLETE }
// OBSOLETE /* FIXME: This code should be using the GDBARCH framework to
// OBSOLETE handle changed type sizes. If this problem is ever fixed
// OBSOLETE (the direct reference to _initialize_gdbtypes() below
// OBSOLETE eliminated) then Makefile.in should be updated so that
// OBSOLETE z8k-tdep.c is again compiled with -Werror. */
// OBSOLETE _initialize_gdbtypes ();
// OBSOLETE }
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE segmented_command (char *args, int from_tty)
// OBSOLETE {
// OBSOLETE z8k_set_pointer_size (32);
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE unsegmented_command (char *args, int from_tty)
// OBSOLETE {
// OBSOLETE z8k_set_pointer_size (16);
// OBSOLETE }
// OBSOLETE
// OBSOLETE static void
// OBSOLETE set_memory (char *args, int from_tty)
// OBSOLETE {
// OBSOLETE printf_unfiltered ("\"set memory\" must be followed by the name of a memory subcommand.\n");
// OBSOLETE help_list (setmemorylist, "set memory ", -1, gdb_stdout);
// OBSOLETE }
// OBSOLETE
// OBSOLETE void
// OBSOLETE _initialize_z8ktdep (void)
// OBSOLETE {
// OBSOLETE tm_print_insn = gdb_print_insn_z8k;
// OBSOLETE
// OBSOLETE add_prefix_cmd ("memory", no_class, set_memory,
// OBSOLETE "set the memory model", &setmemorylist, "set memory ", 0,
// OBSOLETE &setlist);
// OBSOLETE add_cmd ("segmented", class_support, segmented_command,
// OBSOLETE "Set segmented memory model.", &setmemorylist);
// OBSOLETE add_cmd ("unsegmented", class_support, unsegmented_command,
// OBSOLETE "Set unsegmented memory model.", &setmemorylist);
// OBSOLETE
// OBSOLETE }