* s390-tdep.c (s390_pop_frame): Call generic_pop_current_frame, to
interact correctly with generic dummy frames. (s390_pop_frame_regular): Move the guts of the frame-popping code to here, to be called by generic_pop_current_frame. Use the frame's saved_regs array; this works for `return' as well as inferior function calls.
This commit is contained in:
parent
0adb2abaa6
commit
4c8287ac0c
|
@ -1,5 +1,12 @@
|
||||||
2001-11-13 Jim Blandy <jimb@redhat.com>
|
2001-11-13 Jim Blandy <jimb@redhat.com>
|
||||||
|
|
||||||
|
* s390-tdep.c (s390_pop_frame): Call generic_pop_current_frame, to
|
||||||
|
interact correctly with generic dummy frames.
|
||||||
|
(s390_pop_frame_regular): Move the guts of the frame-popping code
|
||||||
|
to here, to be called by generic_pop_current_frame. Use the
|
||||||
|
frame's saved_regs array; this works for `return' as well as
|
||||||
|
inferior function calls.
|
||||||
|
|
||||||
* s390-tdep.c (s390_gdbarch_init): Register the function
|
* s390-tdep.c (s390_gdbarch_init): Register the function
|
||||||
`standard_coerce_float_to_double', since GCC for the S/390 follows
|
`standard_coerce_float_to_double', since GCC for the S/390 follows
|
||||||
the standard rules for passing floats.
|
the standard rules for passing floats.
|
||||||
|
|
|
@ -1159,20 +1159,46 @@ s390_push_dummy_frame ()
|
||||||
write_register (S390_SP_REGNUM, new_sp);
|
write_register (S390_SP_REGNUM, new_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pop the innermost frame, go back to the caller.
|
|
||||||
Used in `call_function_by_hand' to remove an artificial stack
|
static void
|
||||||
frame. */
|
s390_pop_frame_regular (struct frame_info *frame)
|
||||||
|
{
|
||||||
|
int regnum;
|
||||||
|
|
||||||
|
write_register (S390_PC_REGNUM, FRAME_SAVED_PC (frame));
|
||||||
|
|
||||||
|
/* Restore any saved registers. */
|
||||||
|
for (regnum = 0; regnum < NUM_REGS; regnum++)
|
||||||
|
if (frame->saved_regs[regnum] != 0)
|
||||||
|
{
|
||||||
|
ULONGEST value;
|
||||||
|
|
||||||
|
value = read_memory_unsigned_integer (frame->saved_regs[regnum],
|
||||||
|
REGISTER_RAW_SIZE (regnum));
|
||||||
|
write_register (regnum, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Actually cut back the stack. */
|
||||||
|
write_register (S390_SP_REGNUM, FRAME_FP (frame));
|
||||||
|
|
||||||
|
/* Throw away any cached frame information. */
|
||||||
|
flush_cached_frames ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Destroy the innermost (Top-Of-Stack) stack frame, restoring the
|
||||||
|
machine state that was in effect before the frame was created.
|
||||||
|
Used in the contexts of the "return" command, and of
|
||||||
|
target function calls from the debugger. */
|
||||||
void
|
void
|
||||||
s390_pop_frame ()
|
s390_pop_frame ()
|
||||||
{
|
{
|
||||||
CORE_ADDR new_sp = read_register (S390_SP_REGNUM), orig_sp;
|
/* This function checks for and handles generic dummy frames, and
|
||||||
void *saved_regs = alloca (REGISTER_BYTES);
|
calls back to our function for ordinary frames. */
|
||||||
|
generic_pop_current_frame (s390_pop_frame_regular);
|
||||||
|
|
||||||
read_memory (new_sp + S390_GPR_SIZE, (char *) saved_regs, REGISTER_BYTES);
|
|
||||||
write_register_bytes (0, (char *) &saved_regs, REGISTER_BYTES);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* used by call function by hand
|
/* used by call function by hand
|
||||||
struct_return indicates that this function returns a structure &
|
struct_return indicates that this function returns a structure &
|
||||||
therefore gpr2 stores a pointer to the structure to be returned as
|
therefore gpr2 stores a pointer to the structure to be returned as
|
||||||
|
|
Loading…
Reference in New Issue