Make ``show mips abi'' actually show the abi in use.
authorKevin Buettner <kevinb@redhat.com>
Thu, 27 Feb 2003 01:14:53 +0000 (01:14 +0000)
committerKevin Buettner <kevinb@redhat.com>
Thu, 27 Feb 2003 01:14:53 +0000 (01:14 +0000)
gdb/ChangeLog
gdb/mips-tdep.c

index df2cb2fce4bdb5d056428b2f539764b17d7899e8..53b7c946e46a99610538380a14df6517b3d927a4 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-26  Kevin Buettner  <kevinb@redhat.com>
+
+       * mips-tdep.c (show_mips_abi): New function.
+       (_initialize_mips_tdep): Use show_mips_abi() to implement the
+       command ``show mips abi''.
+
 2003-02-26  Jeff Johnston  <jjohnstn@redhat.com>
  
        From Elena Zannoni  <ezannoni@redhat.com>
index 35426b01bc7fd1777b9f9ed36f3b31e661b8cbe1..8d5f97ba1df71fd2deeab4e89c589264f9482945 100644 (file)
@@ -6066,6 +6066,38 @@ mips_abi_update (char *ignore_args, int from_tty,
   gdbarch_update_p (info);
 }
 
+/* Print out which MIPS ABI is in use.  */
+
+static void
+show_mips_abi (char *ignore_args, int from_tty)
+{
+  if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_mips)
+    printf_filtered (
+      "The MIPS ABI is unknown because the current architecture is not MIPS.\n");
+  else
+    {
+      enum mips_abi global_abi = global_mips_abi ();
+      enum mips_abi actual_abi = mips_abi (current_gdbarch);
+      const char *actual_abi_str = mips_abi_strings[actual_abi];
+
+      if (global_abi == MIPS_ABI_UNKNOWN)
+       printf_filtered ("The MIPS ABI is set automatically (currently \"%s\").\n",
+                        actual_abi_str);
+      else if (global_abi == actual_abi)
+       printf_filtered (
+         "The MIPS ABI is assumed to be \"%s\" (due to user setting).\n",
+         actual_abi_str);
+      else
+       {
+         /* Probably shouldn't happen...  */
+         printf_filtered (
+           "The (auto detected) MIPS ABI \"%s\" is in use even though the user setting was \"%s\".\n",
+           actual_abi_str,
+           mips_abi_strings[global_abi]);
+       }
+    }
+}
+
 static void
 mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
 {
@@ -6513,8 +6545,9 @@ This option can be set to one of:\n\
      "  eabi32\n"
      "  eabi64",
      &setmipscmdlist);
-  add_show_from_set (c, &showmipscmdlist);
   set_cmd_sfunc (c, mips_abi_update);
+  add_cmd ("abi", class_obscure, show_mips_abi,
+           "Show ABI in use by MIPS target", &showmipscmdlist);
 
   /* Let the user turn off floating point and set the fence post for
      heuristic_proc_start.  */
This page took 0.029143 seconds and 4 git commands to generate.