From eba66671ed268463194d1fc9721840f7c9f84c22 Mon Sep 17 00:00:00 2001 From: gwr Date: Wed, 14 Jan 1998 18:42:05 +0000 Subject: [PATCH] Define FRAME_SAVED_PC to use the common sigtramp_saved_pc() just like the i386 does. The previous definition was a SunOS-specific hack, and if that is really still needed somwhere, it can still be used by defining sigtramp_saved_pc as m68k_sigtramp_saved_pc in the target-specific tm.h file. The common sigtramp_saved_pc() fucntion uses SIGCONTEXT_PC_OFFSET to find the return PC (the best way). Do not define SIG_PC_FP_OFFSET here. (very machine-specific!) --- gnu/dist/gdb/config/m68k/tm-m68k.h | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/gnu/dist/gdb/config/m68k/tm-m68k.h b/gnu/dist/gdb/config/m68k/tm-m68k.h index 4d284b52f4c3..2d53a0b5cf02 100644 --- a/gnu/dist/gdb/config/m68k/tm-m68k.h +++ b/gnu/dist/gdb/config/m68k/tm-m68k.h @@ -255,8 +255,8 @@ extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *)); (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) \ - (thisframe->signal_handler_caller \ - ? thisframe->frame \ + ((thisframe)->signal_handler_caller \ + ? (thisframe)->frame \ : (!inside_entry_file ((thisframe)->pc) \ ? read_memory_integer ((thisframe)->frame, 4) \ : 0)) @@ -266,6 +266,7 @@ extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *)); /* A macro that tells us whether the function invocation represented 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) \ do { \ if ((FI)->signal_handler_caller) \ @@ -274,24 +275,14 @@ extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *)); (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 +/* Saved Pc. Get it from sigcontext if within sigtramp. */ #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)) \ - ) + ((FRAME)->signal_handler_caller \ + ? sigtramp_saved_pc (FRAME) \ + : read_memory_integer ((FRAME)->frame + 4, 4)) + +extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *)); #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)