static int restore_pc_queue PARAMS ((struct frame_saved_regs *fsr));
static int hppa_alignof PARAMS ((struct type *arg));
+CORE_ADDR frame_saved_pc PARAMS ((FRAME frame));
\f
/* Routines to extract various sized constants out of hppa
return low_sign_extend (word & MASK_5, 5);
}
+/* extract the immediate field from a break instruction */
+
+unsigned
+extract_5r_store (word)
+ unsigned word;
+{
+ return (word & MASK_5);
+}
+
+/* extract the immediate field from a {sr}sm instruction */
+
+unsigned
+extract_5R_store (word)
+ unsigned word;
+{
+ return (word >> 16 & MASK_5);
+}
+
/* extract an 11 bit immediate field */
int
return 0;
}
\f
+int
+frameless_function_invocation (frame)
+ FRAME frame;
+{
+
+ if (use_unwind)
+ {
+ struct unwind_table_entry *u;
+
+ u = find_unwind_entry (frame->pc);
+
+ if (u == 0)
+ return 0;
+
+ return (u->Total_frame_size == 0);
+ }
+ else
+ return frameless_look_for_prologue (frame);
+}
+
CORE_ADDR
saved_pc_after_call (frame)
FRAME frame;
{
CORE_ADDR pc = get_frame_pc (frame);
- if (frameless_look_for_prologue (frame))
+ if (frameless_function_invocation (frame))
{
int ret_regnum;
else
frame->frame = read_register (SP_REGNUM) - framesize;
- if (!frameless_look_for_prologue (frame)) /* Frameless? */
+ if (!frameless_function_invocation (frame)) /* Frameless? */
return; /* No, quit now */
/* For frameless functions, we need to look at the caller's frame */
if (!chain)
return 0;
- msym = lookup_minimal_symbol_by_pc (FRAME_SAVED_PC (thisframe));
+ if (use_unwind)
+ {
- if (msym
- && (strcmp (SYMBOL_NAME (msym), "_start") == 0))
- return 0;
+ struct unwind_table_entry *u;
+
+ u = find_unwind_entry (thisframe->pc);
+
+ if (u && (u->Save_SP || u->Total_frame_size))
+ return 1;
+ else
+ return 0;
+ }
else
- return 1;
+ {
+ msym = lookup_minimal_symbol_by_pc (FRAME_SAVED_PC (thisframe));
+
+ if (msym
+ && (strcmp (SYMBOL_NAME (msym), "_start") == 0))
+ return 0;
+ else
+ return 1;
+ }
}
/*
frame_saved_regs->regs[RP_REGNUM] = fp - 20 & ~0x3;
frame_saved_regs->regs[FP_REGNUM] = fp;
frame_saved_regs->regs[1] = fp + 8;
- frame_saved_regs->regs[3] = fp + 12;
- for (fp += 16, i = 5; i < 32; fp += 4, i++)
- frame_saved_regs->regs[i] = fp;
+ for (fp += 12, i = 3; i < 32; i++)
+ {
+ if (i != FP_REGNUM)
+ {
+ frame_saved_regs->regs[i] = fp;
+ fp += 4;
+ }
+ }
fp += 4;
for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8)
frame_saved_regs->regs[i] = fp;
frame_saved_regs->regs[IPSW_REGNUM] = fp;
- fp += 4;
- frame_saved_regs->regs[SAR_REGNUM] = fp;
- fp += 4;
- frame_saved_regs->regs[PCOQ_HEAD_REGNUM] = fp;
- fp +=4;
- frame_saved_regs->regs[PCSQ_HEAD_REGNUM] = fp;
- fp +=4;
- frame_saved_regs->regs[PCOQ_TAIL_REGNUM] = fp;
- fp +=4;
- frame_saved_regs->regs[PCSQ_TAIL_REGNUM] = fp;
+ frame_saved_regs->regs[SAR_REGNUM] = fp + 4;
+ frame_saved_regs->regs[PCOQ_HEAD_REGNUM] = fp + 8;
+ frame_saved_regs->regs[PCSQ_HEAD_REGNUM] = fp + 12;
+ frame_saved_regs->regs[PCOQ_TAIL_REGNUM] = fp + 16;
+ frame_saved_regs->regs[PCSQ_TAIL_REGNUM] = fp + 20;
}
int
CORE_ADDR struct_addr;
{
/* array of arguments' offsets */
- int *offset = (int *)alloca(nargs);
+ int *offset = (int *)alloca(nargs * sizeof (int));
int cum = 0;
int i, alignment;