aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-04-26 07:05:35 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-04-26 07:05:35 +0000
commit5868c862e2d178996aa66bf3553a6f59d1516e2e (patch)
tree97e07909585ce1ef25f0d67967be24a860bc5f98 /gdb
parentfd55a5dffb1d01e996ee08190487983ff4d974aa (diff)
downloadgdb-5868c862e2d178996aa66bf3553a6f59d1516e2e.zip
gdb-5868c862e2d178996aa66bf3553a6f59d1516e2e.tar.gz
gdb-5868c862e2d178996aa66bf3553a6f59d1516e2e.tar.bz2
* alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member.
* alpha-tdep.c (alpha_sigcontext_addr): New function. (alpha_find_saved_regs): Use alpha_sigcontext_addr. (alpha_gdbarch_init): Initialize tdep->sigcontext_addr. * alpha-linux-tdep.c: Include frame.h. (alpha_linux_sigcontext_addr): New function. (alpha_linux_init_abi): Set tdep->sigcontext_addr to alpha_linux_sigcontext_addr. * alpha-osf1-tdep.c: Include gdbcore.h. (alpha_osf1_sigcontext_addr): New function. (alpha_osf1_init_abi): Set tdep->sigcontext_addr to alpha_osf1_sigcontext_addr. * config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove. * config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog17
-rw-r--r--gdb/alpha-linux-tdep.c8
-rw-r--r--gdb/alpha-osf1-tdep.c9
-rw-r--r--gdb/alpha-tdep.c19
-rw-r--r--gdb/alpha-tdep.h4
-rw-r--r--gdb/config/alpha/tm-alpha.h6
-rw-r--r--gdb/config/alpha/tm-alphalinux.h6
7 files changed, 56 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 362b366..6084d5e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,20 @@
+2002-04-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member.
+ * alpha-tdep.c (alpha_sigcontext_addr): New function.
+ (alpha_find_saved_regs): Use alpha_sigcontext_addr.
+ (alpha_gdbarch_init): Initialize tdep->sigcontext_addr.
+ * alpha-linux-tdep.c: Include frame.h.
+ (alpha_linux_sigcontext_addr): New function.
+ (alpha_linux_init_abi): Set tdep->sigcontext_addr to
+ alpha_linux_sigcontext_addr.
+ * alpha-osf1-tdep.c: Include gdbcore.h.
+ (alpha_osf1_sigcontext_addr): New function.
+ (alpha_osf1_init_abi): Set tdep->sigcontext_addr to
+ alpha_osf1_sigcontext_addr.
+ * config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove.
+ * config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove.
+
2002-04-26 Andrew Cagney <ac131313@redhat.com>
* stack.c (selected_frame_level):
diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c
index 05a9544..d467840 100644
--- a/gdb/alpha-linux-tdep.c
+++ b/gdb/alpha-linux-tdep.c
@@ -19,6 +19,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "frame.h"
#include "gdbcore.h"
#include "value.h"
@@ -91,6 +92,12 @@ alpha_linux_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
return (alpha_linux_sigtramp_offset (pc) >= 0);
}
+static CORE_ADDR
+alpha_linux_sigcontext_addr (struct frame_info *frame)
+{
+ return (frame->frame - 0x298); /* sizeof(struct sigcontext) */
+}
+
static void
alpha_linux_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
@@ -100,6 +107,7 @@ alpha_linux_init_abi (struct gdbarch_info info,
set_gdbarch_pc_in_sigtramp (gdbarch, alpha_linux_pc_in_sigtramp);
tdep->dynamic_sigtramp_offset = alpha_linux_sigtramp_offset;
+ tdep->sigcontext_addr = alpha_linux_sigcontext_addr;
tdep->jb_pc = 2;
tdep->jb_elt_size = 8;
diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c
index be8f704..67c56cf 100644
--- a/gdb/alpha-osf1-tdep.c
+++ b/gdb/alpha-osf1-tdep.c
@@ -20,6 +20,7 @@
#include "defs.h"
#include "frame.h"
+#include "gdbcore.h"
#include "value.h"
#include "alpha-tdep.h"
@@ -43,6 +44,13 @@ alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
return (func_name != NULL && STREQ ("__sigtramp", func_name));
}
+static CORE_ADDR
+alpha_osf1_sigcontext_addr (struct frame_info *frame)
+{
+ return (read_memory_integer (frame->next ? frame->next->frame
+ : frame->frame, 8));
+}
+
static void
alpha_osf1_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
@@ -52,6 +60,7 @@ alpha_osf1_init_abi (struct gdbarch_info info,
set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame;
+ tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
tdep->jb_pc = 2;
tdep->jb_elt_size = 8;
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 6145e91..6f52097 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -344,6 +344,17 @@ alpha_register_virtual_size (int regno)
}
+static CORE_ADDR
+alpha_sigcontext_addr (struct frame_info *fi)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep->sigcontext_addr)
+ return (tdep->sigcontext_addr (fi));
+
+ return (0);
+}
+
/* Guaranteed to set frame->saved_regs to some values (it never leaves it
NULL). */
@@ -372,7 +383,12 @@ alpha_find_saved_regs (struct frame_info *frame)
{
CORE_ADDR sigcontext_addr;
- sigcontext_addr = SIGCONTEXT_ADDR (frame);
+ sigcontext_addr = alpha_sigcontext_addr (frame);
+ if (sigcontext_addr == 0)
+ {
+ /* Don't know where the sigcontext is; just bail. */
+ return;
+ }
for (ireg = 0; ireg < 32; ireg++)
{
reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8;
@@ -1997,6 +2013,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->dynamic_sigtramp_offset = NULL;
tdep->skip_sigtramp_frame = NULL;
+ tdep->sigcontext_addr = NULL;
tdep->jb_pc = -1; /* longjmp support not enabled by default */
diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
index 8b1cf3e..c3ee007 100644
--- a/gdb/alpha-tdep.h
+++ b/gdb/alpha-tdep.h
@@ -106,6 +106,10 @@ struct gdbarch_tdep
frame. */
CORE_ADDR (*skip_sigtramp_frame) (struct frame_info *, CORE_ADDR);
+ /* Translate a signal handler frame into the address of the sigcontext
+ structure for that signal handler. */
+ CORE_ADDR (*sigcontext_addr) (struct frame_info *);
+
int jb_pc; /* Offset to PC value in jump buffer.
If htis is negative, longjmp support
will be disabled. */
diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h
index b8bcb39..feb752a 100644
--- a/gdb/config/alpha/tm-alpha.h
+++ b/gdb/config/alpha/tm-alpha.h
@@ -83,10 +83,4 @@ extern void alpha_print_extra_frame_info (struct frame_info *);
alpha_setup_arbitrary_frame (argc, argv)
extern struct frame_info *alpha_setup_arbitrary_frame (int, CORE_ADDR *);
-/* Translate a signal handler frame into the address of the sigcontext
- structure. */
-
-#define SIGCONTEXT_ADDR(frame) \
- (read_memory_integer ((frame)->next ? frame->next->frame : frame->frame, 8))
-
#endif /* TM_ALPHA_H */
diff --git a/gdb/config/alpha/tm-alphalinux.h b/gdb/config/alpha/tm-alphalinux.h
index fae1743..27ff457 100644
--- a/gdb/config/alpha/tm-alphalinux.h
+++ b/gdb/config/alpha/tm-alphalinux.h
@@ -40,12 +40,6 @@ extern LONGEST alpha_linux_sigtramp_offset (CORE_ADDR);
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
-/* Translate a signal handler frame into the address of the sigcontext
- structure. */
-
-#undef SIGCONTEXT_ADDR
-#define SIGCONTEXT_ADDR(frame) ((frame)->frame - 0x298)
-
#include "tm-linux.h"
#endif /* TM_LINUXALPHA_H */