else
error ("Invalid data type for function to be called.");
- *retval_type = value_type;
+ if (retval_type != NULL)
+ *retval_type = value_type;
return funaddr + FUNCTION_START_OFFSET;
}
inf_status = save_inferior_status (1);
inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status);
- if (DEPRECATED_PUSH_DUMMY_FRAME_P ())
- {
- /* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the
- inferior registers (and frame_pop() for restoring them). (At
- least on most machines) they are saved on the stack in the
- inferior. */
- DEPRECATED_PUSH_DUMMY_FRAME;
- }
- else
- {
- /* FIXME: cagney/2003-02-26: Step zero of this little tinker is
- to extract the generic dummy frame code from the architecture
- vector. Hence this direct call.
-
- A follow-on change is to modify this interface so that it takes
- thread OR frame OR ptid as a parameter, and returns a dummy
- frame handle. The handle can then be used further down as a
- parameter to generic_save_dummy_frame_tos(). Hmm, thinking
- about it, since everything is ment to be using generic dummy
- frames, why not even use some of the dummy frame code to here -
- do a regcache dup and then pass the duped regcache, along with
- all the other stuff, at one single point.
-
- In fact, you can even save the structure's return address in the
- dummy frame and fix one of those nasty lost struct return edge
- conditions. */
- generic_push_dummy_frame ();
- }
+ /* FIXME: cagney/2003-02-26: Step zero of this little tinker is to
+ extract the generic dummy frame code from the architecture
+ vector. Hence this direct call.
+
+ A follow-on change is to modify this interface so that it takes
+ thread OR frame OR ptid as a parameter, and returns a dummy frame
+ handle. The handle can then be used further down as a parameter
+ to generic_save_dummy_frame_tos(). Hmm, thinking about it, since
+ everything is ment to be using generic dummy frames, why not even
+ use some of the dummy frame code to here - do a regcache dup and
+ then pass the duped regcache, along with all the other stuff, at
+ one single point.
+
+ In fact, you can even save the structure's return address in the
+ dummy frame and fix one of those nasty lost struct return edge
+ conditions. */
+ generic_push_dummy_frame ();
/* Ensure that the initial SP is correctly aligned. */
{
}
break;
case AT_ENTRY_POINT:
- if (DEPRECATED_FIX_CALL_DUMMY_P ()
- && !gdbarch_push_dummy_call_p (current_gdbarch))
- {
- /* Sigh. Some targets use DEPRECATED_FIX_CALL_DUMMY to
- shove extra stuff onto the stack or into registers. That
- code should be in PUSH_DUMMY_CALL, however, in the mean
- time ... */
- /* If the target is manipulating DUMMY1, it looses big time. */
- void *dummy1 = NULL;
- DEPRECATED_FIX_CALL_DUMMY (dummy1, sp, funaddr, nargs, args,
- value_type, using_gcc);
- }
real_pc = funaddr;
dummy_addr = entry_point_address ();
/* Make certain that the address points at real code, and not a
/* When there is no push_dummy_call method, should this code
simply error out. That would the implementation of this method
for all ABIs (which is probably a good thing). */
- sp = gdbarch_push_dummy_call (current_gdbarch, funaddr, current_regcache,
+ sp = gdbarch_push_dummy_call (current_gdbarch, function, current_regcache,
bp_addr, nargs, args, sp, struct_return,
struct_addr);
else if (DEPRECATED_PUSH_ARGUMENTS_P ())
if (DEPRECATED_DUMMY_WRITE_SP_P ())
DEPRECATED_DUMMY_WRITE_SP (sp);
- if (gdbarch_unwind_dummy_id_p (current_gdbarch))
- {
- /* Sanity. The exact same SP value is returned by
- PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
- unwind_dummy_id to form the frame ID's stack address. */
- generic_save_dummy_frame_tos (sp);
- }
- else if (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ())
+ if (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ())
DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp);
+ else
+ /* Sanity. The exact same SP value is returned by
+ PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
+ unwind_dummy_id to form the frame ID's stack address. */
+ generic_save_dummy_frame_tos (sp);
/* Now proceed, having reached the desired place. */
clear_proceed_status ();