flush_cached_frames ();
}
-/* Fixup the call sequence of a dummy function, with the real function
- address. Its arguments will be passed by gdb. */
-
-static void
-rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
- int nargs, struct value **args, struct type *type,
- int gcc_p)
-{
- int ii;
- CORE_ADDR target_addr;
-
- if (rs6000_find_toc_address_hook != NULL)
- {
- CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (fun);
- write_register (gdbarch_tdep (current_gdbarch)->ppc_toc_regnum,
- tocvalue);
- }
-}
-
/* All the ABI's require 16 byte alignment. */
static CORE_ADDR
rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
space = (space + 15) & -16;
sp -= space;
- /* This is another instance we need to be concerned about
- securing our stack space. If we write anything underneath %sp
- (r1), we might conflict with the kernel who thinks he is free
- to use this area. So, update %sp first before doing anything
- else. */
-
- write_register (SP_REGNUM, sp);
-
/* If the last argument copied into the registers didn't fit there
completely, push the rest of it into stack. */
ii += ((len + 3) & -4) / 4;
}
}
- else
- /* Secure stack areas first, before doing anything else. */
- write_register (SP_REGNUM, sp);
/* set back chain properly */
store_unsigned_integer (tmp_buffer, 4, saved_sp);
write_memory (sp, tmp_buffer, 4);
- target_store_registers (-1);
- return sp;
-}
+ /* Set the stack pointer. According to the ABI, the SP is ment to
+ be set _before_ the corresponding stack space is used. No need
+ for that here though - the target has been completly stopped - it
+ isn't possible for an exception handler to stomp on the stack. */
+ regcache_raw_write_signed (regcache, SP_REGNUM, sp);
-/* Function: ppc_push_return_address (pc, sp)
- Set up the return address for the inferior function call. */
+ /* Point the inferior function call's return address at the dummy's
+ breakpoint. */
+ regcache_raw_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
-static CORE_ADDR
-ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
-{
- write_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum,
- entry_point_address ());
+ /* Set the TOC register, get the value from the objfile reader
+ which, in turn, gets it from the VMAP table. */
+ if (rs6000_find_toc_address_hook != NULL)
+ {
+ CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (func_addr);
+ regcache_raw_write_signed (regcache, tdep->ppc_toc_regnum, tocvalue);
+ }
+
+ target_store_registers (-1);
return sp;
}
CORE_ADDR
rs6000_skip_trampoline_code (CORE_ADDR pc)
{
- register unsigned int ii, op;
+ unsigned int ii, op;
int rel;
CORE_ADDR solib_target_pc;
struct minimal_symbol *msymbol;
frame. */
return read_memory_addr (get_frame_base (thisframe), wordsize);
- if (inside_entry_file (get_frame_pc (thisframe))
+ if (deprecated_inside_entry_file (get_frame_pc (thisframe))
|| get_frame_pc (thisframe) == entry_point_address ())
return 0;
set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
set_gdbarch_num_regs (gdbarch, v->nregs);
set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_char_signed (gdbarch, 0);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_frame_align (gdbarch, rs6000_frame_align);
if (sysv_abi && wordsize == 8)
/* PPC64 SYSV. */
/* PowerOpen / AIX 32 bit. */
set_gdbarch_frame_red_zone_size (gdbarch, 220);
set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
- set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_deprecated_register_convertible (gdbarch, rs6000_register_convertible);