From: Ulrich Weigand Date: Fri, 15 Jun 2007 22:42:22 +0000 (+0000) Subject: * gdbarch.sh (push_dummy_code): Add REGCACHE argument. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4fd649ae26abcf2528f0d64593bce95d94321e5;p=binutils-gdb.git * gdbarch.sh (push_dummy_code): Add REGCACHE argument. * gdbarch.c, gdbarch.h: Regenerate. * infcall.c (generic_push_dummy_code): Add REGCACHE argument. (push_dummy_code): Likewise. Pass it to callee. (call_function_by_hand): Pass current regcache to push_dummy_code. * hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Add REGCACHE argument. Use it instead of current_regcache. * cris-tdep.c (cris_push_dummy_code): Add REGCACHE argument. * sparc-tdep.c (sparc32_push_dummy_code): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 13977586d39..d41c3aabc24 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2007-06-15 Ulrich Weigand + + * gdbarch.sh (push_dummy_code): Add REGCACHE argument. + * gdbarch.c, gdbarch.h: Regenerate. + * infcall.c (generic_push_dummy_code): Add REGCACHE argument. + (push_dummy_code): Likewise. Pass it to callee. + (call_function_by_hand): Pass current regcache to push_dummy_code. + + * hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Add REGCACHE + argument. Use it instead of current_regcache. + + * cris-tdep.c (cris_push_dummy_code): Add REGCACHE argument. + * sparc-tdep.c (sparc32_push_dummy_code): Likewise. + 2007-06-15 Ulrich Weigand * gdbarch.sh (get_longjmp_target): Add FRAME argument. diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 4af47260fd1..039e24f1fdd 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -868,7 +868,8 @@ cris_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) + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, + struct regcache *regcache) { /* Allocate space sufficient for a breakpoint. */ sp = (sp - 4) & ~3; diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 0f0df43b3e0..341bd05c9e9 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -1900,13 +1900,13 @@ gdbarch_push_dummy_code_p (struct gdbarch *gdbarch) } CORE_ADDR -gdbarch_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) +gdbarch_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, struct regcache *regcache) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->push_dummy_code != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n"); - return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr); + return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache); } void diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 8dbc490fbd8..0a9c388809b 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -344,8 +344,8 @@ extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_d extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch); -typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (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); -extern CORE_ADDR gdbarch_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); +typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (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, struct regcache *regcache); +extern CORE_ADDR gdbarch_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, struct regcache *regcache); extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code); typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index e666d92b68d..418f305d79f 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -472,7 +472,7 @@ M::CORE_ADDR:push_dummy_call:struct value *function, struct regcache *regcache, # DEPRECATED_REGISTER_SIZE can be deleted. v:=:int:deprecated_register_size v::int:call_dummy_location::::AT_ENTRY_POINT::0 -M::CORE_ADDR:push_dummy_code: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:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr +M::CORE_ADDR:push_dummy_code: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, struct regcache *regcache:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache m::void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all::default_print_registers_info::0 M::void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index 195d9078045..09c779c63da 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -1097,7 +1097,8 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funcaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, - CORE_ADDR *real_pc, CORE_ADDR *bp_addr) + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, + struct regcache *regcache) { CORE_ADDR pc, stubaddr; int argreg = 0; @@ -1115,7 +1116,7 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, /* Intraspace call. */ *bp_addr = hppa_hpux_find_dummy_bpaddr (pc); *real_pc = funcaddr; - regcache_cooked_write_unsigned (current_regcache, HPPA_RP_REGNUM, *bp_addr); + regcache_cooked_write_unsigned (regcache, HPPA_RP_REGNUM, *bp_addr); return sp; } @@ -1193,18 +1194,18 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, if (stubaddr == 0) error (_("Cannot call external function not referenced by application " "(no import stub).\n")); - regcache_cooked_write_unsigned (current_regcache, 22, stubaddr); + regcache_cooked_write_unsigned (regcache, 22, stubaddr); write_memory (sp, (char *)&hppa32_tramp, sizeof (hppa32_tramp)); *bp_addr = hppa_hpux_find_dummy_bpaddr (pc); - regcache_cooked_write_unsigned (current_regcache, 31, *bp_addr); + regcache_cooked_write_unsigned (regcache, 31, *bp_addr); *real_pc = hppa32_hpux_search_dummy_call_sequence (gdbarch, pc, &argreg); if (*real_pc == 0) error (_("Cannot make interspace call from here.")); - regcache_cooked_write_unsigned (current_regcache, argreg, sp); + regcache_cooked_write_unsigned (regcache, argreg, sp); sp += sizeof (hppa32_tramp); } @@ -1220,17 +1221,17 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, /* for hppa64, we don't need to call through a stub; all functions return via a bve. */ - regcache_cooked_write_unsigned (current_regcache, 22, funcaddr); + regcache_cooked_write_unsigned (regcache, 22, funcaddr); write_memory (sp, (char *)&hppa64_tramp, sizeof (hppa64_tramp)); *bp_addr = pc - 4; - regcache_cooked_write_unsigned (current_regcache, 31, *bp_addr); + regcache_cooked_write_unsigned (regcache, 31, *bp_addr); *real_pc = hppa64_hpux_search_dummy_call_sequence (gdbarch, pc, &argreg); if (*real_pc == 0) error (_("Cannot make interspace call from here.")); - regcache_cooked_write_unsigned (current_regcache, argreg, sp); + regcache_cooked_write_unsigned (regcache, argreg, sp); sp += sizeof (hppa64_tramp); } diff --git a/gdb/infcall.c b/gdb/infcall.c index 5bd2ce33863..2805e4b4f89 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -249,7 +249,8 @@ generic_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) + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, + struct regcache *regcache) { /* Something here to findout the size of a breakpoint and then allocate space for it on the stack. */ @@ -288,14 +289,17 @@ 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) + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, + struct regcache *regcache) { if (gdbarch_push_dummy_code_p (gdbarch)) return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc, - args, nargs, value_type, real_pc, bp_addr); + args, nargs, value_type, real_pc, bp_addr, + regcache); else return generic_push_dummy_code (gdbarch, sp, funaddr, using_gcc, - args, nargs, value_type, real_pc, bp_addr); + args, nargs, value_type, real_pc, bp_addr, + regcache); } /* All this stuff with a dummy frame may seem unnecessarily complicated @@ -465,7 +469,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) { sp = push_dummy_code (current_gdbarch, sp, funaddr, using_gcc, args, nargs, values_type, - &real_pc, &bp_addr); + &real_pc, &bp_addr, current_regcache); dummy_addr = sp; } else @@ -473,7 +477,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) dummy_addr = sp; sp = push_dummy_code (current_gdbarch, sp, funaddr, using_gcc, args, nargs, values_type, - &real_pc, &bp_addr); + &real_pc, &bp_addr, current_regcache); } break; case AT_ENTRY_POINT: diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index bc93b054a28..59d6f9f29a2 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -383,7 +383,8 @@ sparc32_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funcaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, - CORE_ADDR *real_pc, CORE_ADDR *bp_addr) + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, + struct regcache *regcache) { *bp_addr = sp - 4; *real_pc = funcaddr;