From 4eb0ad19f379a411b76d7adf2664c46f79402878 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 10 Sep 2007 21:14:11 +0000 Subject: * 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. --- gdb/gdbarch.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gdb/gdbarch.c') diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index e4bcaca2c8..685a87ee12 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) @@ -713,6 +716,12 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (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)); @@ -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. */ -- cgit v1.2.1