extern CORE_ADDR vax_extract_struct_value_address (char *);
\f
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
+#define FRAME_CHAIN(FI) vax_frame_chain ((FI))
+extern CORE_ADDR vax_frame_chain (struct frame_info *);
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer. */
-
-/* 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. */
-
-#define FRAME_CHAIN(thisframe) \
- (!inside_entry_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame + 12, 4) :\
- 0)
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-/* On the vax, all functions have frames. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
-
-/* Saved Pc. Get it from sigcontext if within sigtramp. */
+#define FRAMELESS_FUNCTION_INVOCATION(FI) \
+ generic_frameless_function_invocation_not ((FI))
/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
/* XXXJRT should go away */
#define FRAME_LOCALS_ADDRESS(fi) vax_frame_locals_address ((fi))
extern CORE_ADDR vax_frame_locals_address (struct frame_info *);
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
extern int vax_frame_num_args (struct frame_info *fi);
#define FRAME_NUM_ARGS(fi) (vax_frame_num_args ((fi)))
#define FRAME_INIT_SAVED_REGS(fi) vax_frame_init_saved_regs ((fi))
extern void vax_frame_init_saved_regs (struct frame_info *);
\f
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM);\
- register 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 * sizeof (int)); }
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
-{ register CORE_ADDR fp = read_register (FP_REGNUM); \
- register int regnum; \
- register 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 (); \
-}
+#define PUSH_DUMMY_FRAME vax_push_dummy_frame()
+extern void vax_push_dummy_frame (void);
+
+#define POP_FRAME vax_pop_frame()
+extern void vax_pop_frame (void);
/* This sequence of words is the instructions
calls #69, @#32323232
{
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));
+}
+\f
+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 ();
+}
\f
void
vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)