aboutsummaryrefslogtreecommitdiff
path: root/gdb/vax-tdep.c
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-04-22 19:44:05 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-04-22 19:44:05 +0000
commitab62c900e2060381046d1fe998b1516fc81c8072 (patch)
tree9bb4dc8e0eab43b5bca77aaf8fcc23abd7780ea9 /gdb/vax-tdep.c
parent7232b100b9274cbd08ce3fed4ef4ac093ec4b0cb (diff)
downloadgdb-ab62c900e2060381046d1fe998b1516fc81c8072.zip
gdb-ab62c900e2060381046d1fe998b1516fc81c8072.tar.gz
gdb-ab62c900e2060381046d1fe998b1516fc81c8072.tar.bz2
* vax-tdep.c (vax_frame_init_saved_regs): New function.
* config/vax/tm-vax.h (FRAME_FIND_SAVED_REGS): Remove. (FRAME_INIT_SAVED_REGS): New macro.
Diffstat (limited to 'gdb/vax-tdep.c')
-rw-r--r--gdb/vax-tdep.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 053041e..15cff55 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -93,6 +93,40 @@ vax_register_virtual_type (int regno)
return (builtin_type_int);
}
+void
+vax_frame_init_saved_regs (struct frame_info *frame)
+{
+ int regnum, regmask;
+ CORE_ADDR next_addr;
+
+ if (frame->saved_regs)
+ return;
+
+ frame_saved_regs_zalloc (frame);
+
+ regmask = read_memory_integer (frame->frame + 4, 4) >> 16;
+
+ next_addr = frame->frame + 16;
+
+ /* regmask's low bit is for register 0, which is the first one
+ what would be pushed. */
+ for (regnum = 0; regnum < AP_REGNUM; regnum++)
+ {
+ if (regmask & (1 << regnum))
+ frame->saved_regs[regnum] = next_addr += 4;
+ }
+
+ frame->saved_regs[SP_REGNUM] = next_addr + 4;
+ if (regmask & (1 << FP_REGNUM))
+ frame->saved_regs[SP_REGNUM] +=
+ 4 + (4 * read_memory_integer (next_addr + 4, 4));
+
+ frame->saved_regs[PC_REGNUM] = frame->frame + 16;
+ frame->saved_regs[FP_REGNUM] = frame->frame + 12;
+ frame->saved_regs[AP_REGNUM] = frame->frame + 8;
+ frame->saved_regs[PS_REGNUM] = frame->frame + 4;
+}
+
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */