2004-06-06 Randolph Chung <tausq@debian.org>
[deliverable/binutils-gdb.git] / gdb / ns32k-tdep.c
index d426113f22257705d00e7df19a6edf2fdf4cdbeb..71d4e4015966a649cd0a2b9fbe91bb13af48b212 100644 (file)
@@ -1,6 +1,7 @@
 /* Target dependent code for the NS32000, for GDB.
-   Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000,
+   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -308,10 +309,6 @@ ns32k_frame_chain (struct frame_info *frame)
   /* In the case of the NS32000 series, the frame's nominal address is the
      FP value, and that address is saved at the previous FP value as a
      4-byte word.  */
-
-  if (deprecated_inside_entry_file (get_frame_pc (frame)))
-    return 0;
-
   return (read_memory_integer (get_frame_base (frame), 4));
 }
 
@@ -334,9 +331,10 @@ ns32k_sigtramp_saved_pc (struct frame_info *frame)
     sigcontext_addr = read_memory_typed_address
       (read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr);
 
-  /* Don't cause a memory_error when accessing sigcontext in case the stack
+  /* Offset to saved PC in sigcontext, from <machine/signal.h>.  Don't
+     cause a memory_error when accessing sigcontext in case the stack
      layout has changed or the stack is corrupt.  */
-  target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes);
+  target_read_memory (sigcontext_addr + 20, buf, ptrbytes);
   return extract_typed_address (buf, builtin_type_void_func_ptr);
 }
 
@@ -400,22 +398,6 @@ ns32k_frame_init_saved_regs (struct frame_info *frame)
     }
 }
 
-static void
-ns32k_push_dummy_frame (void)
-{
-  CORE_ADDR sp = read_register (SP_REGNUM);
-  int regnum;
-
-  sp = push_word (sp, read_register (PC_REGNUM));
-  sp = push_word (sp, read_register (DEPRECATED_FP_REGNUM));
-  write_register (DEPRECATED_FP_REGNUM, sp);
-
-  for (regnum = 0; regnum < 8; regnum++)
-    sp = push_word (sp, read_register (regnum));
-
-  write_register (SP_REGNUM, sp);
-}
-
 static void
 ns32k_pop_frame (void)
 {
@@ -437,42 +419,6 @@ ns32k_pop_frame (void)
   flush_cached_frames ();
 }
 \f
-/* The NS32000 call dummy sequence:
-
-       enter   0xff,0                  82 ff 00
-       jsr     @0x00010203             7f ae c0 01 02 03
-       adjspd  0x69696969              7f a5 01 02 03 04
-       bpt                             f2
-
-   It is 16 bytes long.  */
-
-static LONGEST ns32k_call_dummy_words[] =
-{
-  0x7f00ff82,
-  0x0201c0ae,
-  0x01a57f03,
-  0xf2040302
-};
-static int sizeof_ns32k_call_dummy_words = sizeof (ns32k_call_dummy_words);
-
-#define NS32K_CALL_DUMMY_ADDR         5
-#define NS32K_CALL_DUMMY_NARGS        11
-
-static void
-ns32k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
-                      struct value **args, struct type *type, int gcc_p)
-{
-  int flipped;
-
-  flipped = fun | 0xc0000000;
-  flip_bytes (&flipped, 4);
-  store_unsigned_integer (dummy + NS32K_CALL_DUMMY_ADDR, 4, flipped);
-
-  flipped = - nargs * 4;
-  flip_bytes (&flipped, 4);
-  store_unsigned_integer (dummy + NS32K_CALL_DUMMY_NARGS, 4, flipped);
-}
-\f
 static void
 ns32k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 {
@@ -495,12 +441,6 @@ ns32k_store_return_value (struct type *valtype, char *valbuf)
                                   TYPE_LENGTH (valtype));
 }
 
-static CORE_ADDR
-ns32k_extract_struct_value_address (char *regbuf)
-{
-  return (extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (0), DEPRECATED_REGISTER_RAW_SIZE (0)));
-}
-\f
 void
 ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch)
 {
@@ -564,8 +504,6 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_saved_pc_after_call (gdbarch, ns32k_saved_pc_after_call);
 
   set_gdbarch_frame_num_args (gdbarch, umax_frame_num_args);
-  set_gdbarch_frameless_function_invocation (gdbarch,
-                                   generic_frameless_function_invocation_not);
   
   set_gdbarch_deprecated_frame_chain (gdbarch, ns32k_frame_chain);
   set_gdbarch_deprecated_frame_saved_pc (gdbarch, ns32k_frame_saved_pc);
@@ -582,28 +520,14 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_store_struct_return (gdbarch, ns32k_store_struct_return);
   set_gdbarch_deprecated_extract_return_value (gdbarch, ns32k_extract_return_value);
   set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
-                                            ns32k_extract_struct_value_address);
 
   /* Call dummy info */
-  set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
   set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame);
   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, ns32k_call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words);
-  set_gdbarch_deprecated_fix_call_dummy (gdbarch, ns32k_fix_call_dummy);
-  set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 3);
-  set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 15);
-  set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
-  set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
 
   /* Breakpoint info */
-  set_gdbarch_decr_pc_after_break (gdbarch, 0);
   set_gdbarch_breakpoint_from_pc (gdbarch, ns32k_breakpoint_from_pc);
 
-  /* Misc info */
-  set_gdbarch_function_start_offset (gdbarch, 0);
-
   /* Should be using push_dummy_call.  */
   set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
 
This page took 0.034548 seconds and 4 git commands to generate.