]> Git Repo - binutils.git/blobdiff - gdb/sparc-tdep.c
* Makefile.in (dcache_h): Remove redundant definition.
[binutils.git] / gdb / sparc-tdep.c
index dc7b1910ba92dc19bba2c90a60f3c45925cb027e..060d29a4989159275ead9515a2bad94fd8a1df94 100644 (file)
@@ -1,5 +1,6 @@
 /* Target-dependent code for the SPARC for GDB, the GNU debugger.
-   Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
+   Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -22,7 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "inferior.h"
 #include "obstack.h"
 #include "target.h"
-#include "ieee-float.h"
+#include "value.h"
 
 #include "symfile.h" /* for objfiles.h */
 #include "objfiles.h" /* for find_pc_section */
@@ -131,9 +132,6 @@ single_step (ignore)
     }
 }
 \f
-#define        FRAME_SAVED_L0  0                           /* Byte offset from SP */
-#define        FRAME_SAVED_I0  (8 * REGISTER_RAW_SIZE (0)) /* Byte offset from SP */
-
 CORE_ADDR
 sparc_frame_chain (thisframe)
      FRAME thisframe;
@@ -161,12 +159,44 @@ sparc_extract_struct_value_address (regbuf)
 /* Find the pc saved in frame FRAME.  */
 
 CORE_ADDR
-frame_saved_pc (frame)
+sparc_frame_saved_pc (frame)
      FRAME frame;
 {
   char buf[MAX_REGISTER_RAW_SIZE];
   CORE_ADDR addr;
 
+  if (frame->signal_handler_caller)
+    {
+      /* This is the signal trampoline frame.
+        Get the saved PC from the sigcontext structure.  */
+
+#ifndef SIGCONTEXT_PC_OFFSET
+#define SIGCONTEXT_PC_OFFSET 12
+#endif
+
+      CORE_ADDR sigcontext_addr;
+      char scbuf[TARGET_PTR_BIT / HOST_CHAR_BIT];
+      int saved_pc_offset = SIGCONTEXT_PC_OFFSET;
+      char *name = NULL;
+
+      /* Solaris2 ucbsigvechandler passes a pointer to a sigcontext
+        as the third parameter.  The offset to the saved pc is 12.  */
+      find_pc_partial_function (frame->pc, &name,
+                               (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+      if (name && STREQ (name, "ucbsigvechandler"))
+       saved_pc_offset = 12;
+
+      /* The sigcontext address is contained in register O2.  */
+      get_saved_register (buf, (int *)NULL, (CORE_ADDR *)NULL,
+                         frame, O0_REGNUM + 2, (enum lval_type *)NULL);
+      sigcontext_addr = extract_address (buf, REGISTER_RAW_SIZE (O0_REGNUM));
+
+      /* 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 + saved_pc_offset,
+                         scbuf, sizeof (scbuf));
+      return extract_address (scbuf, sizeof (scbuf));
+    }
   addr = (frame->bottom + FRAME_SAVED_I0 +
          REGISTER_RAW_SIZE (I7_REGNUM) * (I7_REGNUM - I0_REGNUM));
   read_memory (addr, buf, REGISTER_RAW_SIZE (I7_REGNUM));
@@ -571,16 +601,6 @@ sparc_pc_adjust(pc)
   else
     return pc+8;
 }
-
-
-/* Structure of SPARC extended floating point numbers.
-   This information is not currently used by GDB, since no current SPARC
-   implementations support extended float.  */
-
-const struct ext_format ext_format_sparc = {
-/* tot sbyte smask expbyte manbyte */
-   16, 0,    0x80, 0,1,           4,8,         /* sparc */
-};
 \f
 #ifdef USE_PROC_FS     /* Target dependent support for /proc */
 
@@ -778,8 +798,8 @@ in_solib_trampoline(pc, name)
   s = find_pc_section(pc);
   
   retval = (s != NULL
-           && s->sec_ptr->name != NULL
-           && STREQ (s->sec_ptr->name, ".plt"));
+           && s->the_bfd_section->name != NULL
+           && STREQ (s->the_bfd_section->name, ".plt"));
   return(retval);
 }
 
This page took 0.022817 seconds and 4 git commands to generate.