]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* arm-tdep.c (arm_gdbarch_init): Allow unknown ABI and FPU settings
authorDaniel Jacobowitz <drow@false.org>
Tue, 14 Aug 2007 15:47:00 +0000 (15:47 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 14 Aug 2007 15:47:00 +0000 (15:47 +0000)
to match any gdbarch with matching OSABI.  Set default ABI and FPU
after running the OSABI handler.

gdb/ChangeLog
gdb/arm-tdep.c

index 677216a6d67a7180c6c87fb276fb33f0f18e4c3b..77c5a0f75582670c7a6cc1daf2b34d18eae6e697 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-14  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * 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  <dan@codesourcery.com>
 
        * config/i386/linux.mh (NATDEPFILES): Move corelow.o from here...
index 575c59a2a411bfc8d46a8df48e62f0fe20f7e821..743a564d6f21e51d786e99e589ebd420de0fad61 100644 (file)
@@ -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);