From: Maciej W. Rozycki Date: Fri, 18 May 2012 12:43:05 +0000 (+0000) Subject: * mips-tdep.h (mips_write_pc): New prototype. X-Git-Tag: sid-snapshot-20120601~145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a4398495b075cef77112aed5e98a6dddf3ee5b8;p=external%2Fbinutils.git * mips-tdep.h (mips_write_pc): New prototype. * mips-tdep.c (mips_write_pc): Make external, add description. * mips-linux-tdep.c (mips_linux_write_pc): Use mips_write_pc, add description. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c06c771..4ad8c96 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2012-05-18 Maciej W. Rozycki + * mips-tdep.h (mips_write_pc): New prototype. + * mips-tdep.c (mips_write_pc): Make external, add description. + * mips-linux-tdep.c (mips_linux_write_pc): Use mips_write_pc, + add description. + +2012-05-18 Maciej W. Rozycki + * mips-tdep.c (mips_read_pc): Use gdbarch_pc_regnum instead of mips_regnum->pc. (mips_unwind_pc, mips_write_pc): Likewise. diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 47af572..69cffc3 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -1151,11 +1151,14 @@ mips_linux_n32n64_sigframe_init (const struct tramp_frame *self, trad_frame_set_id (this_cache, frame_id_build (frame_sp, func)); } +/* Implement the "write_pc" gdbarch method. */ + static void mips_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - regcache_cooked_write_unsigned (regcache, gdbarch_pc_regnum (gdbarch), pc); + + mips_write_pc (regcache, pc); /* Clear the syscall restart flag. */ if (mips_linux_restart_reg_p (gdbarch)) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 37f4041..6d31b39 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -1141,7 +1141,9 @@ mips_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) get_frame_pc (this_frame)); } -static void +/* Implement the "write_pc" gdbarch method. */ + +void mips_write_pc (struct regcache *regcache, CORE_ADDR pc) { int regnum = gdbarch_pc_regnum (get_regcache_arch (regcache)); diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h index 72cc49a..9dd4541 100644 --- a/gdb/mips-tdep.h +++ b/gdb/mips-tdep.h @@ -159,6 +159,9 @@ extern int mips_pc_is_mips16 (bfd_vma memaddr); /* Return the currently configured (or set) saved register size. */ extern unsigned int mips_abi_regsize (struct gdbarch *gdbarch); +/* Make PC the address of the next instruction to execute. */ +extern void mips_write_pc (struct regcache *regcache, CORE_ADDR pc); + /* Target descriptions which only indicate the size of general registers. */ extern struct target_desc *mips_tdesc_gp32;