aboutsummaryrefslogtreecommitdiff
path: root/gdb/vax-tdep.c
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-04-22 21:32:05 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-04-22 21:32:05 +0000
commit52efde73b986abae90c478c68afb14dbf04629b8 (patch)
treeabf19e5a54c2f02befd8e3466e49a1cf0ed5c09a /gdb/vax-tdep.c
parent80cc45a581bf087fc2c9b25461f423885243b874 (diff)
downloadgdb-52efde73b986abae90c478c68afb14dbf04629b8.zip
gdb-52efde73b986abae90c478c68afb14dbf04629b8.tar.gz
gdb-52efde73b986abae90c478c68afb14dbf04629b8.tar.bz2
* vax-tdep.c (vax_frame_chain): New function.
(vax_push_dummy_frame): Ditto. (vax_pop_frame): Ditto. * config/vax/tm-vax.h (FRAME_CHAIN): vax_frame_chain. (FRAMELESS_FUNCTION_INVOCATION): Use generic_frameless_function_invocation_not. (PUSH_DUMMY_FRAME): Use vax_push_dummy_frame. (POP_FRAME): Use vax_pop_frame.
Diffstat (limited to 'gdb/vax-tdep.c')
-rw-r--r--gdb/vax-tdep.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 2ff2187..d8cc678 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -177,6 +177,63 @@ vax_frame_num_args (struct frame_info *fi)
{
return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1));
}
+
+CORE_ADDR
+vax_frame_chain (struct frame_info *frame)
+{
+ /* In the case of the VAX, the frame's nominal address is the FP value,
+ and 12 bytes later comes the saved previous FP value as a 4-byte word. */
+ if (inside_entry_file (frame->pc))
+ return (0);
+
+ return (read_memory_integer (frame->frame + 12, 4));
+}
+
+void
+vax_push_dummy_frame (void)
+{
+ CORE_ADDR sp = read_register (SP_REGNUM);
+ int regnum;
+
+ sp = push_word (sp, 0); /* arglist */
+ for (regnum = 11; regnum >= 0; regnum--)
+ sp = push_word (sp, read_register (regnum));
+ sp = push_word (sp, read_register (PC_REGNUM));
+ sp = push_word (sp, read_register (FP_REGNUM));
+ sp = push_word (sp, read_register (AP_REGNUM));
+ sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
+ sp = push_word (sp, 0);
+ write_register (SP_REGNUM, sp);
+ write_register (FP_REGNUM, sp);
+ write_register (AP_REGNUM, sp + (17 * 4));
+}
+
+void
+vax_pop_frame (void)
+{
+ CORE_ADDR fp = read_register (FP_REGNUM);
+ int regnum;
+ int regmask = read_memory_integer (fp + 4, 4);
+
+ write_register (PS_REGNUM,
+ (regmask & 0xffff)
+ | (read_register (PS_REGNUM) & 0xffff0000));
+ write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
+ write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));
+ write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));
+ fp += 16;
+ for (regnum = 0; regnum < 12; regnum++)
+ if (regmask & (0x10000 << regnum))
+ write_register (regnum, read_memory_integer (fp += 4, 4));
+ fp = fp + 4 + ((regmask >> 30) & 3);
+ if (regmask & 0x20000000)
+ {
+ regnum = read_memory_integer (fp, 4);
+ fp += (regnum + 1) * 4;
+ }
+ write_register (SP_REGNUM, fp);
+ flush_cached_frames ();
+}
void
vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)