aboutsummaryrefslogtreecommitdiff
path: root/gdb/d10v-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-05-03 19:39:23 +0000
committerAndrew Cagney <cagney@redhat.com>2003-05-03 19:39:23 +0000
commit7043d8dc5edd566142805331c3caad571f9aef2f (patch)
tree569a445a897e50f81ae5cd31e4ea08124dc614de /gdb/d10v-tdep.c
parent92bf2b80f20268d032bb7f55103514324ff939b9 (diff)
downloadgdb-7043d8dc5edd566142805331c3caad571f9aef2f.zip
gdb-7043d8dc5edd566142805331c3caad571f9aef2f.tar.gz
gdb-7043d8dc5edd566142805331c3caad571f9aef2f.tar.bz2
2003-05-03 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (PUSH_DUMMY_CODE): New architecture method, add comments noteing that it replaces the old FIX_CALL_DUMMY code. * gdbarch.h, gdbarch.c: Re-generate. * d10v-tdep.c (d10v_push_dummy_code): New function. (d10v_gdbarch_init): Set push_dummy_code. * infcall.c (legacy_push_dummy_code): New function. (generic_push_dummy_code): New function. (push_dummy_code): New function. (call_function_by_hand): Call push_dummy_code. Pass bp_addr, instead of dummy_addr, to push_dummy_call. Move call to generic_save_call_dummy_addr to outside of CALL_DUMMY_LOCATION switch. * sparc-tdep.c (sparc_gdbarch_init): Mention push_dummy_code. 2003-05-03 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Document push_dummy_code. Add cross references.
Diffstat (limited to 'gdb/d10v-tdep.c')
-rw-r--r--gdb/d10v-tdep.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index 227e032..348e9f4 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -956,6 +956,25 @@ pop_stack_item (struct stack_item *si)
static CORE_ADDR
+d10v_push_dummy_code (struct gdbarch *gdbarch,
+ CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+ struct value **args, int nargs,
+ struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
+{
+ /* Allocate space sufficient for a breakpoint. */
+ sp = (sp - 4) & ~3;
+ /* Store the address of that breakpoint taking care to first convert
+ it into a code (IADDR) address from a stack (DADDR) address.
+ This of course assumes that the two virtual addresses map onto
+ the same real address. */
+ (*bp_addr) = d10v_make_iaddr (d10v_convert_iaddr_to_raw (sp));
+ /* d10v always starts the call at the callee's entry point. */
+ (*real_pc) = funaddr;
+ return sp;
+}
+
+static CORE_ADDR
d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR dummy_addr, int nargs, struct value **args,
CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
@@ -1617,6 +1636,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
}
set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value);
+ set_gdbarch_push_dummy_code (gdbarch, d10v_push_dummy_code);
set_gdbarch_push_dummy_call (gdbarch, d10v_push_dummy_call);
set_gdbarch_store_return_value (gdbarch, d10v_store_return_value);
set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address);