+2002-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-tdep.h (struct gdbarch_tdep): Add new member ``lr_frame_offset''.
+ * rs6000-tdep.c (rs6000_frame_saved_pc): Use ``lr_frame_offset''
+ from tdep struct instead of DEFAULT_LR_SAVE.
+ (rs6000_gdbarch_init): Initialize ``lr_frame_offset''.
+ * config/powerpc/tm-ppc-eabi.h (DEFAULT_LR_SAVE): Delete.
+ * config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Delete.
+
2002-04-12 Michael Snyder <msnyder@redhat.com>
* source.c: White space fix-up.
#undef SOFTWARE_SINGLE_STEP_P
#define SOFTWARE_SINGLE_STEP_P() 0
-#undef DEFAULT_LR_SAVE
-#define DEFAULT_LR_SAVE 4 /* eabi saves LR at 4 off of SP */
-
#undef PROCESS_LINENUMBER_HOOK
#undef TEXT_SEGMENT_BASE
prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
#define INIT_FRAME_PC(fromleaf, prev) /* nothing */
-/* Default offset from SP where the LR is stored */
-#define DEFAULT_LR_SAVE 8
-
/* Flag for machine-specific stuff in shared files. FIXME */
#define IBM6000_TARGET
int ppc_mq_regnum; /* Multiply/Divide extension register */
int ppc_vr0_regnum; /* First AltiVec register */
int ppc_vrsave_regnum; /* Last AltiVec register */
+ int lr_frame_offset; /* Offset to ABI specific location where
+ link register is saved. */
};
#endif
{
CORE_ADDR func_start;
struct rs6000_framedata fdata;
- int wordsize = TDEP->wordsize;
+ struct gdbarch_tdep *tdep = TDEP;
+ int wordsize = tdep->wordsize;
if (fi->signal_handler_caller)
return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize);
return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
wordsize);
else
- return read_memory_addr (FRAME_CHAIN (fi) + DEFAULT_LR_SAVE,
+ return read_memory_addr (FRAME_CHAIN (fi) + tdep->lr_frame_offset,
wordsize);
}
break;
}
- /* Calculate byte offsets in raw register array. */
+ /* Set lr_frame_offset. */
+ if (wordsize == 8)
+ tdep->lr_frame_offset = 16;
+ else if (sysv_abi)
+ tdep->lr_frame_offset = 4;
+ else
+ tdep->lr_frame_offset = 8;
+
+ /* Calculate byte offsets in raw register array. */
tdep->regoff = xmalloc (v->nregs * sizeof (int));
for (i = off = 0; i < v->nregs; i++)
{