From: Ulrich Weigand Date: Sat, 17 Nov 2007 00:57:41 +0000 (+0000) Subject: * mips-tdep.c (show_mipsfpu_command): Do not crash if called when X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ca0852e7a0010edcf20292ab79c8c42c74b5567;p=binutils-gdb.git * mips-tdep.c (show_mipsfpu_command): Do not crash if called when current architecture is not MIPS. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e7bd42dae98..7489ddeab15 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-11-16 Ulrich Weigand + + * mips-tdep.c (show_mipsfpu_command): Do not crash if called when + current architecture is not MIPS. + 2007-11-16 Ulrich Weigand * cli/cli-setshow.c (do_setshow_command): Use dynamically sized buffer diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index b9d65d6300f..54202cab946 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: