diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-15 22:44:56 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-15 22:44:56 +0000 |
commit | 61a1198acf6397fc68016561e165a8ca89dcbc16 (patch) | |
tree | 8169ab1f776d5f5063cae391bd81cfa0141af3fa /gdb/gdbarch.c | |
parent | e4fd649ae26abcf2528f0d64593bce95d94321e5 (diff) | |
download | gdb-61a1198acf6397fc68016561e165a8ca89dcbc16.zip gdb-61a1198acf6397fc68016561e165a8ca89dcbc16.tar.gz gdb-61a1198acf6397fc68016561e165a8ca89dcbc16.tar.bz2 |
* gdbarch.sh (read_pc): Add REGCACHE argument. Remove PTID argument.
(write_pc): Likewise. Remove default implementation, add predicate.
* gdbarch.c, gdbarch.h: Regenerate.
* regcache.c (read_pc_pid): Use current regcache instead of calling
read_register_pid.
(write_pc_pid): Check gdbarch_write_pc predicate, implement default
case inline.
(generic_target_write_pc): Remove.
* inferior.h (generic_target_write_pc): Remove.
* frv-tdep.c (frv_gdbarch_init): Do not install it.
* m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise.
* rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
* sh64-tdep.c (sh64_gdbarch_init): Likewise.
* sh-tdep.c (sh_gdbarch_init): Likewise.
* xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise.
* avr-tdep.c (avr_read_pc): Add REGCACHE argument. Remove PTID
argument. Use REGCACHE instead of calling read_register_pid.
* hppa-hpux-tdep.c (hppa_hpux_read_pc): Likewise.
* hppa-tdep.c (hppa_read_pc): Likewise.
* hppa-tdep.h (hppa_read_pc): Likewise.
* ia64-tdep.c (ia64_read_pc): Likewise.
* m32r-tdep.c (m32r_read_pc): Likewise.
* mep-tdep.c (mep_read_pc): Likewise.
* mn10300-tdep.c (mn10300_read_pc): Likewise.
* spu-tdep.c (spu_read_pc): Likewise.
* arm-tdep.c (arm_write_pc): Add REGCACHE argument. Remove PTID
argument. Use REGCACHE instead of calling write_register_pid.
* avr-tdep.c (avr_write_pc): Likewise.
* hppa-hpux-tdep.c (hppa_hpux_write_pc): Likewise.
* hppa-tdep.c (hppa_write_pc): Likewise.
* hppa-tdep.h (hppa_write_pc): Likewise.
* i386-linux-tdep.c (i386_linux_write_pc): Likewise.
* amd64-linux-tdep.c (amd64_linux_write_pc): Likewise.
* ia64-linux-tdep.c (ia64_linux_write_pc): Likewise.
* ia64-tdep.c (ia64_write_pc): Likewise.
* ia64-tdep.h (ia64_write_pc): Likewise.
* m32r-tdep.c (m32r_write_pc): Likewise.
* m88k-tdep.c (m88k_write_pc): Likewise.
* mep-tdep.c (mep_write_pc): Likewise.
* mips-tdep.c (mips_write_pc): Likewise.
* mips-linux-tdep.c (mips_linux_write_pc): Likewise.
* mn10300-tdep.c (mn10300_write_pc): Likewise.
* sparc-tdep.c (sparc_write_pc): Likewise.
* spu-tdep.c (spu_write_pc): Likewise.
* mips-tdep.c (read_signed_register): Remove.
(read_signed_register_pid): Likewise.
(mips_read_pc): Add REGCACHE argument. Remove PTID argument.
Use REGCACHE instead of calling read_signed_register_pid.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 341bd05..d63afe5 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -406,7 +406,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->ptr_bit = current_gdbarch->int_bit; current_gdbarch->bfd_vma_bit = gdbarch_bfd_arch_info (current_gdbarch)->bits_per_address; current_gdbarch->char_signed = -1; - current_gdbarch->write_pc = generic_target_write_pc; current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; current_gdbarch->num_regs = -1; current_gdbarch->sp_regnum = -1; @@ -524,7 +523,7 @@ verify_gdbarch (struct gdbarch *current_gdbarch) if (current_gdbarch->char_signed == -1) current_gdbarch->char_signed = 1; /* Skip verify of read_pc, has predicate */ - /* Skip verify of write_pc, invalid_p == 0 */ + /* Skip verify of write_pc, has predicate */ /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ /* Skip verify of pseudo_register_read, has predicate */ /* Skip verify of pseudo_register_write, has predicate */ @@ -1006,21 +1005,9 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: push_dummy_code = <0x%lx>\n", (long) current_gdbarch->push_dummy_code); -#ifdef TARGET_READ_PC_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "TARGET_READ_PC_P()", - XSTRING (TARGET_READ_PC_P ())); -#endif fprintf_unfiltered (file, "gdbarch_dump: gdbarch_read_pc_p() = %d\n", gdbarch_read_pc_p (current_gdbarch)); -#ifdef TARGET_READ_PC - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "TARGET_READ_PC(ptid)", - XSTRING (TARGET_READ_PC (ptid))); -#endif fprintf_unfiltered (file, "gdbarch_dump: read_pc = <0x%lx>\n", (long) current_gdbarch->read_pc); @@ -1164,12 +1151,9 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: vtable_function_descriptors = %s\n", paddr_d (current_gdbarch->vtable_function_descriptors)); -#ifdef TARGET_WRITE_PC fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "TARGET_WRITE_PC(val, ptid)", - XSTRING (TARGET_WRITE_PC (val, ptid))); -#endif + "gdbarch_dump: gdbarch_write_pc_p() = %d\n", + gdbarch_write_pc_p (current_gdbarch)); fprintf_unfiltered (file, "gdbarch_dump: write_pc = <0x%lx>\n", (long) current_gdbarch->write_pc); @@ -1467,13 +1451,13 @@ gdbarch_read_pc_p (struct gdbarch *gdbarch) } CORE_ADDR -gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid) +gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->read_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); - return gdbarch->read_pc (ptid); + return gdbarch->read_pc (regcache); } void @@ -1483,14 +1467,21 @@ set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch->read_pc = read_pc; } +int +gdbarch_write_pc_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->write_pc != NULL; +} + void -gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid) +gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->write_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); - gdbarch->write_pc (val, ptid); + gdbarch->write_pc (regcache, val); } void |