summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2007-09-10 21:14:11 +0000
committerDaniel Jacobowitz <dan@debian.org>2007-09-10 21:14:11 +0000
commitf17c84c2b78d6fde4bba0660c5962fbd3bba573a (patch)
treec911c1b9f6ab0cfde413db3c703a1bbc290cfcfc /gdb/gdbarch.c
parent2eddd513bffe2d99bc8ccf1c4c1aabf80ec4d441 (diff)
downloadgdb-f17c84c2b78d6fde4bba0660c5962fbd3bba573a.tar.gz
* arch-utils.c (gdbarch_info_fill): Also try core_bfd.
* corelow.c (core_read_description): New. (init_core_ops): Set to_read_description. * gdbarch.sh: Add gdbarch_core_read_description. * mips-linux-tdep.c (mips_linux_core_read_description): New. (mips_linux_init_abi): Call set_gdbarch_core_read_description. * mips-tdep.c (mips_tdesc_gp32, mips_tdesc_gp64): New. (mips_register_g_packet_guesses): Use them. (_initialize_mips_tdep): Initialize them. * mips-tdep.h (mips_tdesc_gp32, mips_tdesc_gp64): Declare. * gdbarch.h, gdbarch.c: Regenerated.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index e4bcaca2c8b..685a87ee128 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -230,6 +230,7 @@ struct gdbarch
int vbit_in_delta;
gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
gdbarch_overlay_update_ftype *overlay_update;
+ gdbarch_core_read_description_ftype *core_read_description;
};
@@ -352,6 +353,7 @@ struct gdbarch startup_gdbarch =
0, /* vbit_in_delta */
0, /* skip_permanent_breakpoint */
0, /* overlay_update */
+ 0, /* core_read_description */
/* startup_gdbarch() */
};
@@ -599,6 +601,7 @@ verify_gdbarch (struct gdbarch *current_gdbarch)
/* Skip verify of vbit_in_delta, invalid_p == 0 */
/* Skip verify of skip_permanent_breakpoint, has predicate */
/* Skip verify of overlay_update, has predicate */
+ /* Skip verify of core_read_description, has predicate */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -714,6 +717,12 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
"gdbarch_dump: convert_register_p = <0x%lx>\n",
(long) current_gdbarch->convert_register_p);
fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
+ gdbarch_core_read_description_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: core_read_description = <0x%lx>\n",
+ (long) current_gdbarch->core_read_description);
+ fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
gdbarch_core_xfer_shared_libraries_p (current_gdbarch));
fprintf_unfiltered (file,
@@ -3001,6 +3010,30 @@ set_gdbarch_overlay_update (struct gdbarch *gdbarch,
gdbarch->overlay_update = overlay_update;
}
+int
+gdbarch_core_read_description_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->core_read_description != NULL;
+}
+
+const struct target_desc *
+gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->core_read_description != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
+ return gdbarch->core_read_description (gdbarch, target, abfd);
+}
+
+void
+set_gdbarch_core_read_description (struct gdbarch *gdbarch,
+ gdbarch_core_read_description_ftype core_read_description)
+{
+ gdbarch->core_read_description = core_read_description;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */