From: Kevin Buettner Date: Fri, 12 Apr 2002 19:48:37 +0000 (+0000) Subject: Delete DEFAULT_LR_SAVE. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a;p=binutils-gdb.git Delete DEFAULT_LR_SAVE. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d3fa62eddd6..aa4b1dbb12c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2002-04-12 Kevin Buettner + + * 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 * source.c: White space fix-up. diff --git a/gdb/config/powerpc/tm-ppc-eabi.h b/gdb/config/powerpc/tm-ppc-eabi.h index 1e6a05366c7..e49b2bd0c97 100644 --- a/gdb/config/powerpc/tm-ppc-eabi.h +++ b/gdb/config/powerpc/tm-ppc-eabi.h @@ -28,9 +28,6 @@ #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 diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h index 015a5928b6f..202ac7751a7 100644 --- a/gdb/config/rs6000/tm-rs6000.h +++ b/gdb/config/rs6000/tm-rs6000.h @@ -93,9 +93,6 @@ extern void aix_process_linenos (void); 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 diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index ec64514321f..5dc2db25d36 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -67,6 +67,8 @@ struct gdbarch_tdep 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 diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 86c07f42661..f1649d011e6 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1319,7 +1319,8 @@ rs6000_frame_saved_pc (struct frame_info *fi) { 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); @@ -1342,7 +1343,7 @@ rs6000_frame_saved_pc (struct frame_info *fi) 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); } @@ -2585,7 +2586,15 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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++) {