aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2002-04-12 19:48:37 +0000
committerKevin Buettner <kevinb@redhat.com>2002-04-12 19:48:37 +0000
commita88376a3e1a5e2358f568a4a7aed6d4d99e1e87a (patch)
treed8e562d91ab3ab5adfb8ee60cce770ae0233b9fb /gdb/rs6000-tdep.c
parentf2172603b59bfb14b2d7eb82427b4a328150ea29 (diff)
downloadgdb-a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a.zip
gdb-a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a.tar.gz
gdb-a88376a3e1a5e2358f568a4a7aed6d4d99e1e87a.tar.bz2
Delete DEFAULT_LR_SAVE.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c15
1 files changed, 12 insertions, 3 deletions
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++)
{