From b8926edcac8a2f8731e12f7a138f74ab842d7e42 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Tue, 14 Aug 2007 15:47:00 +0000 Subject: [PATCH] * arm-tdep.c (arm_gdbarch_init): Allow unknown ABI and FPU settings to match any gdbarch with matching OSABI. Set default ABI and FPU after running the OSABI handler. --- gdb/ChangeLog | 6 ++++++ gdb/arm-tdep.c | 43 ++++++++++++++++--------------------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 677216a6d67..77c5a0f7558 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2007-08-14 Daniel Jacobowitz + + * arm-tdep.c (arm_gdbarch_init): Allow unknown ABI and FPU settings + to match any gdbarch with matching OSABI. Set default ABI and FPU + after running the OSABI handler. + 2007-08-14 Daniel Jacobowitz * config/i386/linux.mh (NATDEPFILES): Move corelow.o from here... diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 575c59a2a41..743a564d6f2 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -2835,39 +2835,17 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } } - /* Now that we have inferred any architecture settings that we - can, try to inherit from the last ARM ABI. */ - if (arches != NULL) - { - if (arm_abi == ARM_ABI_AUTO) - arm_abi = gdbarch_tdep (arches->gdbarch)->arm_abi; - - if (fp_model == ARM_FLOAT_AUTO) - fp_model = gdbarch_tdep (arches->gdbarch)->fp_model; - } - else - { - /* There was no prior ARM architecture; fill in default values. */ - - if (arm_abi == ARM_ABI_AUTO) - arm_abi = ARM_ABI_APCS; - - /* We used to default to FPA for generic ARM, but almost nobody - uses that now, and we now provide a way for the user to force - the model. So default to the most useful variant. */ - if (fp_model == ARM_FLOAT_AUTO) - fp_model = ARM_FLOAT_SOFT_FPA; - } - /* If there is already a candidate, use it. */ for (best_arch = gdbarch_list_lookup_by_info (arches, &info); best_arch != NULL; best_arch = gdbarch_list_lookup_by_info (best_arch->next, &info)) { - if (arm_abi != gdbarch_tdep (best_arch->gdbarch)->arm_abi) + if (arm_abi != ARM_ABI_AUTO + && arm_abi != gdbarch_tdep (best_arch->gdbarch)->arm_abi) continue; - if (fp_model != gdbarch_tdep (best_arch->gdbarch)->fp_model) + if (fp_model != ARM_FLOAT_AUTO + && fp_model != gdbarch_tdep (best_arch->gdbarch)->fp_model) continue; /* Found a match. */ @@ -2997,12 +2975,23 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Now we have tuned the configuration, set a few final things, based on what the OS ABI has told us. */ + /* If the ABI is not otherwise marked, assume the old GNU APCS. EABI + binaries are always marked. */ + if (tdep->arm_abi == ARM_ABI_AUTO) + tdep->arm_abi = ARM_ABI_APCS; + + /* We used to default to FPA for generic ARM, but almost nobody + uses that now, and we now provide a way for the user to force + the model. So default to the most useful variant. */ + if (tdep->fp_model == ARM_FLOAT_AUTO) + tdep->fp_model = ARM_FLOAT_SOFT_FPA; + if (tdep->jb_pc >= 0) set_gdbarch_get_longjmp_target (gdbarch, arm_get_longjmp_target); /* Floating point sizes and format. */ set_gdbarch_float_format (gdbarch, floatformats_ieee_single); - if (fp_model == ARM_FLOAT_SOFT_FPA || fp_model == ARM_FLOAT_FPA) + if (tdep->fp_model == ARM_FLOAT_SOFT_FPA || tdep->fp_model == ARM_FLOAT_FPA) { set_gdbarch_double_format (gdbarch, floatformats_ieee_double_littlebyte_bigword); -- 2.30.2