This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] rs6000-tdep.c: Fix `return' from stop in call dummy
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFA] rs6000-tdep.c: Fix `return' from stop in call dummy
- From: "Peter.Schauer" <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
- Date: Sat, 23 Sep 2000 12:31:37 MET DST
[RFA] rs6000-tdep.c: Fix `return' from stop in call dummy
If a `return' is issued after a stop in a call dummy, rs6000_pop_frame
currently does not recognize the dummy frame, as it is testing for
stop_stack_dummy (which is a hack anyway), instead of using PC_IN_CALL_DUMMY.
Here is a fix, it will be needed for the upcoming additional callfuncs
testcases:
* rs6000-tdep.c (rs6000_pop_frame): Use PC_IN_CALL_DUMMY to test
for call dummy instead of accessing stop_stack_dummy, which does
not work if we `return' from a stop in a call dummy.
(rs6000_gdbarch_init): Use generic_save_dummy_frame_tos for
dummy_frame_tos function to make PC_IN_CALL_DUMMY work.
*** ./rs6000-tdep.c.orig Sat Aug 5 11:37:42 2000
--- ./rs6000-tdep.c Fri Sep 15 21:36:51 2000
***************
*** 671,679 ****
frames, etc.
*************************************************************************/
- extern int stop_stack_dummy;
-
/* Pop the innermost frame, go back to the caller. */
static void
--- 671,677 ----
***************
*** 687,693 ****
pc = read_pc ();
sp = FRAME_FP (frame);
! if (stop_stack_dummy)
{
generic_pop_dummy_frame ();
flush_cached_frames ();
--- 685,691 ----
pc = read_pc ();
sp = FRAME_FP (frame);
! if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
{
generic_pop_dummy_frame ();
flush_cached_frames ();
***************
*** 2140,2145 ****
--- 2138,2144 ----
set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+ set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_push_return_address (gdbarch, ppc_push_return_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_coerce_float_to_double (gdbarch, rs6000_coerce_float_to_double);
--
Peter Schauer pes@regent.e-technik.tu-muenchen.de