aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
authorK. Richard Pixley <rich@cygnus>1993-03-31 00:29:22 +0000
committerK. Richard Pixley <rich@cygnus>1993-03-31 00:29:22 +0000
commit2093fe684049c2e47bcc438adbb39c308e4db840 (patch)
treec99c8e18940b20a00568c98d8c936e4ccb886dab /gdb/sparc-tdep.c
parentdeae7611a31f74bf325b7ebf7f0e982e0f9f8056 (diff)
downloadgdb-2093fe684049c2e47bcc438adbb39c308e4db840.zip
gdb-2093fe684049c2e47bcc438adbb39c308e4db840.tar.gz
gdb-2093fe684049c2e47bcc438adbb39c308e4db840.tar.bz2
Teach sparc solaris to next over shared library functions.
* solib.[hc] (find_pc_section_from_so_list): new function and prototype. * sparc-tdep.c (in_solib_trampoline): new function. * symfile.[hc] (find_pc_section): new function and prototypes. * target.[hc] (find_pc_section_from_targets): new function and prototypes. * config/sparc/tm-sun4sol2.h (IN_SOLIB_TRAMPOLINE): redefine to in_solib_trampoline.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c48
1 files changed, 39 insertions, 9 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index acb26dd..61af732 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1,5 +1,5 @@
/* Target-dependent code for the SPARC for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,11 +23,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "obstack.h"
#include "target.h"
#include "ieee-float.h"
+#include "symfile.h" /* for find_pc_section */
#ifdef USE_PROC_FS
#include <sys/procfs.h>
-#else
-#include <sys/ptrace.h>
#endif
#include "gdbcore.h"
@@ -191,15 +190,21 @@ frame_saved_pc (frame)
* difficulty.
*/
FRAME
-setup_arbitrary_frame (frame, stack)
- FRAME_ADDR frame, stack;
+setup_arbitrary_frame (argc, argv)
+ int argc;
+ FRAME_ADDR *argv;
{
- FRAME fid = create_new_frame (frame, 0);
+ FRAME fid;
+
+ if (argc != 2)
+ error ("Sparc frame specifications require two arguments: fp and sp");
+
+ fid = create_new_frame (argv[0], 0);
if (!fid)
fatal ("internal: create_new_frame returned invalid frame id");
- fid->bottom = stack;
+ fid->bottom = argv[1];
fid->pc = FRAME_SAVED_PC (fid);
return fid;
}
@@ -228,7 +233,7 @@ setup_arbitrary_frame (frame, stack)
* original contents of g1. A * indicates that the actual value of
* the instruction is modified below.
*/
-static int save_insn_opcodes[] = {
+static unsigned int save_insn_opcodes[] = {
0x03000000, 0x82007ee0, 0x9de38001, 0x03000000,
0x82007ee0, 0x91d02001, 0x01000000 };
@@ -279,7 +284,8 @@ do_save_insn (size)
t %g0,1
sethi %hi(0),%g0 */
-static int restore_insn_opcodes[] = { 0x81e80000, 0x91d02001, 0x01000000 };
+static unsigned int restore_insn_opcodes[] = {
+ 0x81e80000, 0x91d02001, 0x01000000 };
static void
do_restore_insn ()
@@ -831,3 +837,27 @@ get_longjmp_target(pc)
return 1;
}
#endif /* GET_LONGJMP_TARGET */
+
+/* So far used only for sparc solaris. In sparc solaris, we recognize
+ a trampoline by it's section name. That is, if the pc is in a
+ section named ".plt" then we are in a trampline.
+
+ Section and offset tracking belongs in objfiles. FIXME. */
+
+int
+in_solib_trampoline(pc, name)
+ CORE_ADDR pc;
+ char *name;
+{
+ struct section_table *s;
+ int retval = 0;
+
+ s = find_pc_section(pc);
+
+ retval = (s != NULL
+ && s->sec_ptr != NULL
+ && s->sec_ptr->name != NULL
+ && STREQ (s->sec_ptr->name, ".plt"));
+ return(retval);
+}
+