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.
Tue May 18 14:08:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+ * 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.
+
* infptrace.c: Remove unused KERNEL_U_ADDR_HPUX code.
* infcmd.c (step_1): Fix poorly worded error message.
(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. */
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. */
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)
{
struct minimal_symbol *msymbol;
- /* FIXME: we should be using containing_function_bounds or
- a cleaned up version thereof. */
+ /* FIXME: This should be using containing_function_bounds or a
+ cleaned-up version thereof, to deal with things like the
+ end of the text segment. */
msymbol = lookup_minimal_symbol_by_pc (stop_pc);
target_terminal_ours ();
printf_filtered ("Current function has no line number information.\n");
fflush (stdout);
- /* No info or after _etext ("Can't happen") */
if (msymbol == NULL || SYMBOL_NAME (msymbol + 1) == NULL)
- error ("Cannot find bounds of current function.");
+ {
+ /* If sigtramp is in the u area, check for it. */
+#if defined SIGTRAMP_START
+ if (IN_SIGTRAMP (stop_pc, (char *)NULL))
+ {
+ step_range_start = SIGTRAMP_START;
+ step_range_end = SIGTRAMP_END;
+ }
+ else
+#endif
+ error ("Cannot find bounds of current function.");
+ }
+ else
+ {
+ step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
+ step_range_end = SYMBOL_VALUE_ADDRESS (msymbol + 1);
+ }
printf_filtered ("Single stepping until function exit.\n");
fflush (stdout);
-
- step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
- step_range_end = SYMBOL_VALUE_ADDRESS (msymbol + 1);
}
}
else