aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-09-10 21:14:11 +0000
committerDaniel Jacobowitz <drow@false.org>2007-09-10 21:14:11 +0000
commit4eb0ad19f379a411b76d7adf2664c46f79402878 (patch)
tree10d6012bd8cc9d1f46589acbdccdd215cd792bcb /gdb/mips-tdep.c
parent6a6b96b9c2552b97902d8ef1fbbce207328eef16 (diff)
downloadgdb-4eb0ad19f379a411b76d7adf2664c46f79402878.zip
gdb-4eb0ad19f379a411b76d7adf2664c46f79402878.tar.gz
gdb-4eb0ad19f379a411b76d7adf2664c46f79402878.tar.bz2
* 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/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index db4d9ef..acd4991 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -165,6 +165,9 @@ static int mips_debug = 0;
#define PROPERTY_GP32 "internal: transfers-32bit-registers"
#define PROPERTY_GP64 "internal: transfers-64bit-registers"
+struct target_desc *mips_tdesc_gp32;
+struct target_desc *mips_tdesc_gp64;
+
/* MIPS specific per-architecture information */
struct gdbarch_tdep
{
@@ -4866,30 +4869,16 @@ global_mips_abi (void)
static void
mips_register_g_packet_guesses (struct gdbarch *gdbarch)
{
- static struct target_desc *tdesc_gp32, *tdesc_gp64;
-
- if (tdesc_gp32 == NULL)
- {
- /* Create feature sets with the appropriate properties. The values
- are not important. */
-
- tdesc_gp32 = allocate_target_description ();
- set_tdesc_property (tdesc_gp32, PROPERTY_GP32, "");
-
- tdesc_gp64 = allocate_target_description ();
- set_tdesc_property (tdesc_gp64, PROPERTY_GP64, "");
- }
-
/* If the size matches the set of 32-bit or 64-bit integer registers,
assume that's what we've got. */
- register_remote_g_packet_guess (gdbarch, 38 * 4, tdesc_gp32);
- register_remote_g_packet_guess (gdbarch, 38 * 8, tdesc_gp64);
+ register_remote_g_packet_guess (gdbarch, 38 * 4, mips_tdesc_gp32);
+ register_remote_g_packet_guess (gdbarch, 38 * 8, mips_tdesc_gp64);
/* If the size matches the full set of registers GDB traditionally
knows about, including floating point, for either 32-bit or
64-bit, assume that's what we've got. */
- register_remote_g_packet_guess (gdbarch, 90 * 4, tdesc_gp32);
- register_remote_g_packet_guess (gdbarch, 90 * 8, tdesc_gp64);
+ register_remote_g_packet_guess (gdbarch, 90 * 4, mips_tdesc_gp32);
+ register_remote_g_packet_guess (gdbarch, 90 * 8, mips_tdesc_gp64);
/* Otherwise we don't have a useful guess. */
}
@@ -5696,6 +5685,14 @@ _initialize_mips_tdep (void)
mips_pdr_data = register_objfile_data ();
+ /* Create feature sets with the appropriate properties. The values
+ are not important. */
+ mips_tdesc_gp32 = allocate_target_description ();
+ set_tdesc_property (mips_tdesc_gp32, PROPERTY_GP32, "");
+
+ mips_tdesc_gp64 = allocate_target_description ();
+ set_tdesc_property (mips_tdesc_gp64, PROPERTY_GP64, "");
+
/* Add root prefix command for all "set mips"/"show mips" commands */
add_prefix_cmd ("mips", no_class, set_mips_command,
_("Various MIPS specific commands."),