aboutsummaryrefslogtreecommitdiff
path: root/gdb/config/m68k
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-05-19 00:57:48 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-05-19 00:57:48 +0000
commit993583e53b5537544f01aa235f068318557f4753 (patch)
tree80f7fbf0af136f7c30264c36388804a6fce9a77c /gdb/config/m68k
parent27daf1a9146abed8dc51ff9e8f3bb1967b39da68 (diff)
downloadgdb-993583e53b5537544f01aa235f068318557f4753.zip
gdb-993583e53b5537544f01aa235f068318557f4753.tar.gz
gdb-993583e53b5537544f01aa235f068318557f4753.tar.bz2
* blockframe.c (get_prev_frame_info): If pc in sigtramp, set
signal_handler_caller. * tm-68k.h (FRAME_{CHAIN,SAVED_PC}): Deal with sigtramp. * tm-hp300bsd.h: Define SIGTRAMP_{START,END} not IN_SIGTRAMP. * inferior.h (IN_SIGTRAMP): Definition moved from infrun.c. Use SIGTRAMP_START if defined. * infcmd.c (step_1): Use SIGTRAMP_{START,END} if needed. * infrun.c (wait_for_inferior): Check IN_SIGTRAMP before SKIP_PROLOGUE.
Diffstat (limited to 'gdb/config/m68k')
-rw-r--r--gdb/config/m68k/tm-hp300bsd.h6
-rw-r--r--gdb/config/m68k/tm-m68k.h39
2 files changed, 35 insertions, 10 deletions
diff --git a/gdb/config/m68k/tm-hp300bsd.h b/gdb/config/m68k/tm-hp300bsd.h
index 6a19069..9184725 100644
--- a/gdb/config/m68k/tm-hp300bsd.h
+++ b/gdb/config/m68k/tm-hp300bsd.h
@@ -38,10 +38,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(hence STACK_END_ADDR as opposed to KERNEL_U_ADDR). This tests
for the whole u area, since we don't necessarily have hp300bsd
include files around. */
-#define IN_SIGTRAMP(pc, name) \
- ((pc) >= STACK_END_ADDR \
- && (pc) < STACK_END_ADDR + TARGET_UPAGES * TARGET_NBPG \
- )
+#define SIGTRAMP_START STACK_END_ADDR
+#define SIGTRAMP_END (STACK_END_ADDR + TARGET_UPAGES * TARGET_NBPG)
/* Address of end of stack space. */
diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h
index 96d71de..062445b 100644
--- a/gdb/config/m68k/tm-m68k.h
+++ b/gdb/config/m68k/tm-m68k.h
@@ -293,10 +293,15 @@ extern const struct ext_format ext_format_68881;
In the case of the 68000, the frame's nominal address
is the address of a 4-byte word containing the calling frame's address. */
+/* If we are chaining from sigtramp, then manufacture a sigtramp frame
+ (which isn't really on the stack. I'm not sure this is right for anything
+ but BSD4.3 on an hp300. */
#define FRAME_CHAIN(thisframe) \
- (!inside_entry_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
+ (thisframe->signal_handler_caller \
+ ? thisframe->frame \
+ : (!inside_entry_file ((thisframe)->pc) ? \
+ read_memory_integer ((thisframe)->frame, 4) :\
+ 0)
/* Define other aspects of the stack frame. */
@@ -304,9 +309,31 @@ extern const struct ext_format ext_format_68881;
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
+ do { \
+ if ((FI)->signal_handler_caller) \
+ (FRAMELESS) = 0; \
+ else \
+ (FRAMELESS) = frameless_look_for_prologue(FI); \
+ } while (0)
+
+/* This was determined by experimentation on hp300 BSD 4.3. Perhaps
+ it corresponds to some offset in /usr/include/sys/user.h or
+ something like that. Using some system include file would
+ have the advantage of probably being more robust in the face
+ of OS upgrades, but the disadvantage of being wrong for
+ cross-debugging. */
+
+#define SIG_PC_FP_OFFSET 530
+
+#define FRAME_SAVED_PC(FRAME) \
+ (((FRAME)->signal_handler_caller \
+ ? ((FRAME)->next \
+ ? read_memory_integer ((FRAME)->next->frame + SIG_PC_FP_OFFSET, 4) \
+ : read_memory_integer (read_register (SP_REGNUM) \
+ + SIG_PC_FP_OFFSET - 8, 4) \
+ ) \
+ : read_memory_integer ((FRAME)->frame + 4, 4)) \
+ )
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)