aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-06-07 16:23:12 +0000
committerAndrew Cagney <cagney@redhat.com>2003-06-07 16:23:12 +0000
commitcde9ea48081fcfec378c5b6e22e3d4b41fa3e2ad (patch)
tree24e4d2d6b34cd315e91db8e9b382e74eb279a1aa /gdb/gdbarch.c
parent9a90a78063be817c7fa1b4548ca8fd4c7ca8e843 (diff)
downloadgdb-cde9ea48081fcfec378c5b6e22e3d4b41fa3e2ad.zip
gdb-cde9ea48081fcfec378c5b6e22e3d4b41fa3e2ad.tar.gz
gdb-cde9ea48081fcfec378c5b6e22e3d4b41fa3e2ad.tar.bz2
2003-06-07 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (TARGET_READ_PC): Add predicate, remove default. * gdbarch.h, gdbarch.c: Re-generate. * regcache.c: Update comments on read_pc et.al. (generic_target_read_pc): Delete function. (read_pc_pid): Try TARGET_READ_PC and PC_REGNUM for a PC register. * inferior.h (generic_target_read_pc): Delete declaration. * frv-tdep.c (frv_gdbarch_init): Do not set read_pc to generic_target_read_pc. * sparc-tdep.c (sparc_gdbarch_init): Ditto. * sh-tdep.c (sh_gdbarch_init): Ditto. * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 7c0a8fd..ab6e6ec 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -501,7 +501,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->ptr_bit = TARGET_INT_BIT;
current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
current_gdbarch->char_signed = -1;
- current_gdbarch->read_pc = generic_target_read_pc;
current_gdbarch->write_pc = generic_target_write_pc;
current_gdbarch->read_sp = generic_target_read_sp;
current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
@@ -620,7 +619,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
if (gdbarch->char_signed == -1)
gdbarch->char_signed = 1;
- /* Skip verify of read_pc, invalid_p == 0 */
+ /* Skip verify of read_pc, has predicate */
/* Skip verify of write_pc, invalid_p == 0 */
/* Skip verify of deprecated_target_read_fp, has predicate */
/* Skip verify of read_sp, invalid_p == 0 */
@@ -2546,6 +2545,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: TARGET_PTR_BIT = %d\n",
TARGET_PTR_BIT);
#endif
+#ifdef TARGET_READ_PC_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_READ_PC_P()",
+ XSTRING (TARGET_READ_PC_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_READ_PC_P() = %d\n",
+ TARGET_READ_PC_P ());
+#endif
#ifdef TARGET_READ_PC
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2876,6 +2884,13 @@ set_gdbarch_char_signed (struct gdbarch *gdbarch,
gdbarch->char_signed = char_signed;
}
+int
+gdbarch_read_pc_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->read_pc != 0;
+}
+
CORE_ADDR
gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
{