From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19318 invoked by alias); 30 Oct 2007 21:31:58 -0000 Received: (qmail 19259 invoked by uid 22791); 30 Oct 2007 21:31:53 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 30 Oct 2007 21:31:51 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9ULVmL1492758 for ; Tue, 30 Oct 2007 21:31:48 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9ULVm0S2232568 for ; Tue, 30 Oct 2007 22:31:48 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9ULVm1p010752 for ; Tue, 30 Oct 2007 22:31:48 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l9ULVms9010721; Tue, 30 Oct 2007 22:31:48 +0100 Message-Id: <200710302131.l9ULVms9010721@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 30 Oct 2007 22:31:48 +0100 Subject: Re: [rfc] [0/9] Multi-target support: Fix show_mipsfpu_command crash To: uweigand@de.ibm.com (Ulrich Weigand) Date: Tue, 30 Oct 2007 21:54:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <200710260114.l9Q1EtUT003048@d12av02.megacenter.de.ibm.com> from "Ulrich Weigand" at Oct 26, 2007 03:14:55 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00834.txt.bz2 > I'm aware of one bug that still needs to be fixed: "info set" > crashes as show_mipsfpu_command unconditionally refers to > gdbarch_tdep (current_gdbarch), and assumes it to be formatted > as defined in mips-tdep.c. This is of course no longer guaranteed > to be the case ... It is certainly possible that other problems > of that sort still lurk. This adds a simple fix for the mips problem. The show_mips_abi routine already contains a check to recognize if called while the current architecture is not mips. This patch adds the same check to show_mipsfpu_command. With this patch in addition to the other patches in the series, I'm able to run the testsuite on s390x-ibm-linux using an --enable-targets=all build with no regressions. Bye, Ulrich ChangeLog: * mips-tdep.c (show_mipsfpu_command): Do not crash if called when current architecture is not MIPS. diff -urNp gdb-orig/gdb/mips-tdep.c gdb-head/gdb/mips-tdep.c --- gdb-orig/gdb/mips-tdep.c 2007-10-23 23:32:16.000000000 +0200 +++ gdb-head/gdb/mips-tdep.c 2007-10-30 20:16:56.403345116 +0100 @@ -4643,6 +4643,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: -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com