* mips-tdep.c (show_mipsfpu_command): Do not crash if called when
authorUlrich Weigand <uweigand@de.ibm.com>
Sat, 17 Nov 2007 00:57:41 +0000 (00:57 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Sat, 17 Nov 2007 00:57:41 +0000 (00:57 +0000)
current architecture is not MIPS.

gdb/ChangeLog
gdb/mips-tdep.c

index e7bd42dae981e1077bea4860c3eb4ef65aa4ef51..7489ddeab15339b18ffc05969b378e139732647d 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-16  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * mips-tdep.c (show_mipsfpu_command): Do not crash if called when
+       current architecture is not MIPS.
+
 2007-11-16  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * cli/cli-setshow.c (do_setshow_command): Use dynamically sized buffer
index b9d65d6300f5769823cc5b68479ea11c5a73dff5..54202cab946d3fb662f6c4d10b4dc82c4f372fbf 100644 (file)
@@ -4611,6 +4611,15 @@ static void
 show_mipsfpu_command (char *args, int from_tty)
 {
   char *fpu;
+
+  if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_mips)
+    {
+      printf_unfiltered
+       ("The MIPS floating-point coprocessor is unknown "
+        "because the current architecture is not MIPS.\n");
+      return;
+    }
+
   switch (MIPS_FPU_TYPE)
     {
     case MIPS_FPU_SINGLE: