aboutsummaryrefslogtreecommitdiff
path: root/gdb/z8k-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-12-12 02:50:39 +0000
committerAndrew Cagney <cagney@redhat.com>1998-12-12 02:50:39 +0000
commit86a51f415d96f5ddeb8978b6bfe0e743689b670b (patch)
tree10cb3af9e25eccbc7ffd9adf8c48fe1ff0db996c /gdb/z8k-tdep.c
parent7381ab4534efc6778ed3d4d576fe9e70aa273951 (diff)
downloadgdb-86a51f415d96f5ddeb8978b6bfe0e743689b670b.zip
gdb-86a51f415d96f5ddeb8978b6bfe0e743689b670b.tar.gz
gdb-86a51f415d96f5ddeb8978b6bfe0e743689b670b.tar.bz2
CARP: Mechanism to replace EXTRA_FRAME_INFO.
Add two pointers (saved_regs, extra_info) to struct frame_info. Introduce new macro FRAME_INIT_SAVED_REGS which replaces FRAME_FIND_SAVED_REGS. Document. Use in mn10300 and rs6000 targets. Fix side effects on ALPHA, MIPS, Z8K and SPARC targets.
Diffstat (limited to 'gdb/z8k-tdep.c')
-rw-r--r--gdb/z8k-tdep.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c
index 2afacf2..0b5c1c2 100644
--- a/gdb/z8k-tdep.c
+++ b/gdb/z8k-tdep.c
@@ -80,10 +80,11 @@ skip_adjust (pc, size)
return pc;
}
-int
+static CORE_ADDR examine_frame PARAMS ((CORE_ADDR, CORE_ADDR *regs, CORE_ADDR));
+static CORE_ADDR
examine_frame (pc, regs, sp)
CORE_ADDR pc;
- struct frame_saved_regs *regs;
+ CORE_ADDR *regs;
CORE_ADDR sp;
{
int w = read_memory_short (pc);
@@ -91,20 +92,20 @@ examine_frame (pc, regs, sp)
int regno;
for (regno = 0; regno < NUM_REGS; regno++)
- regs->regs[regno] = 0;
+ regs[regno] = 0;
while (IS_PUSHW (w) || IS_PUSHL (w))
{
/* work out which register is being pushed to where */
if (IS_PUSHL (w))
{
- regs->regs[w & 0xf] = offset;
- regs->regs[(w & 0xf) + 1] = offset + 2;
+ regs[w & 0xf] = offset;
+ regs[(w & 0xf) + 1] = offset + 2;
offset += 4;
}
else
{
- regs->regs[w & 0xf] = offset;
+ regs[w & 0xf] = offset;
offset += 2;
}
pc += 2;
@@ -121,16 +122,16 @@ examine_frame (pc, regs, sp)
/* Subtracting a value from the sp, so were in a function
which needs stack space for locals, but has no fp. We fake up
the values as if we had an fp */
- regs->regs[FP_REGNUM] = sp;
+ regs[FP_REGNUM] = sp;
}
else
{
/* This one didn't have an fp, we'll fake it up */
- regs->regs[SP_REGNUM] = sp;
+ regs[SP_REGNUM] = sp;
}
/* stack pointer contains address of next frame */
- /* regs->regs[fp_regnum()] = fp;*/
- regs->regs[SP_REGNUM] = sp;
+ /* regs[fp_regnum()] = fp;*/
+ regs[SP_REGNUM] = sp;
return pc;
}
@@ -138,9 +139,9 @@ CORE_ADDR
z8k_skip_prologue (start_pc)
CORE_ADDR start_pc;
{
- struct frame_saved_regs dummy;
+ CORE_ADDR dummy[NUM_REGS];
- return examine_frame (start_pc, &dummy, 0);
+ return examine_frame (start_pc, dummy, 0);
}
CORE_ADDR
@@ -185,19 +186,17 @@ init_frame_pc ()
the address we return for it IS the sp for the next frame. */
void
-get_frame_saved_regs (frame_info, frame_saved_regs)
+z8k_frame_init_saved_regs (frame_info)
struct frame_info *frame_info;
- struct frame_saved_regs *frame_saved_regs;
-
{
CORE_ADDR pc;
int w;
- memset (frame_saved_regs, '\0', sizeof (*frame_saved_regs));
+ frame_saved_regs_zalloc (frame_info);
pc = get_pc_function_start (frame_info->pc);
-/* wander down the instruction stream */
- examine_frame (pc, frame_saved_regs, frame_info->frame);
+ /* wander down the instruction stream */
+ examine_frame (pc, frame_info->saved_regs, frame_info->frame);
}
@@ -240,6 +239,7 @@ NEXT_PROLOGUE_INSN (addr, lim, pword1)
return 0;
}
+#if 0
/* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special
@@ -291,6 +291,7 @@ frame_find_saved_regs (fip, fsrp)
fsrp->regs[FP_REGNUM] = fip->frame;
}
+#endif
int
saved_pc_after_call ()