/* 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.
#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 */
}
}
\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;
/* 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));
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 */
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);
}