aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/mips-tdep.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e7bd42d..7489dde 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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
to construct error message if no argument was supplied.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index b9d65d6..54202ca 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -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: