diff options
author | Kevin Buettner <kevinb@redhat.com> | 2002-04-12 19:48:37 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2002-04-12 19:48:37 +0000 |
commit | a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a (patch) | |
tree | d8e562d91ab3ab5adfb8ee60cce770ae0233b9fb | |
parent | f2172603b59bfb14b2d7eb82427b4a328150ea29 (diff) | |
download | gdb-a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a.zip gdb-a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a.tar.gz gdb-a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a.tar.bz2 |
Delete DEFAULT_LR_SAVE.
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/config/powerpc/tm-ppc-eabi.h | 3 | ||||
-rw-r--r-- | gdb/config/rs6000/tm-rs6000.h | 3 | ||||
-rw-r--r-- | gdb/ppc-tdep.h | 2 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 15 |
5 files changed, 23 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d3fa62e..aa4b1db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +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. diff --git a/gdb/config/powerpc/tm-ppc-eabi.h b/gdb/config/powerpc/tm-ppc-eabi.h index 1e6a053..e49b2bd 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 015a592..202ac77 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 ec64514..5dc2db2 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 86c07f4..f1649d0 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++) { |