From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32555 invoked by alias); 14 Feb 2002 15:14:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32447 invoked from network); 14 Feb 2002 15:14:25 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 14 Feb 2002 15:14:25 -0000 Received: from localhost.redhat.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id HAA29237; Thu, 14 Feb 2002 07:14:14 -0800 (PST) Received: by localhost.redhat.com (Postfix, from userid 469) id 2BADA10D95; Thu, 14 Feb 2002 10:14:07 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15467.54335.30953.137640@localhost.redhat.com> Date: Thu, 14 Feb 2002 07:14:00 -0000 To: Kevin Buettner Cc: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA] rs6000-tdep.c: arch switching buglet In-Reply-To: <1020214011340.ZM9352@localhost.localdomain> References: <15465.14609.272441.491094@localhost.redhat.com> <1020214011340.ZM9352@localhost.localdomain> X-Mailer: VM 7.00 under Emacs 20.7.1 X-SW-Source: 2002-02/txt/msg00405.txt.bz2 Committed, thanks Elena Kevin Buettner writes: > On Feb 12, 10:47am, Elena Zannoni wrote: > > > I found an odd bug on the ppc. > > > > For this target, the list of arches in bfd includes > > several that are not rupported in gdb, for instance powerpc:630. > > > > If the user says: > > > > set architecture powerpc:630 > > > > What should happen? > > > > set_architecture() calls gdbarch_update_p, which should fail (right?), > > and set_architecture should print an error message. > > > > Instead, consider the rs6000 code in rs6000_gdbarch_init(): > > > > /* Choose variant. */ > > v = find_variant_by_arch (arch, mach); > > if (!v) > > v = find_variant_by_name (power ? "power" : "powerpc"); > > > > This code will pick a different architecture, in this case > > powerpc:common, but gdb/multiarch doesn't know, and prints that the > > architecture has been successfully set to powerpc:630. > > > > This code was put in place before the multiarch framework, and it has > > become obsolete. So, how about the following: > > > > > > 2002-02-12 Elena Zannoni > > > > * rs6000-tdep.c (rs6000_gdbarch_init): Don't call > > find_variant_by_name, because it confuses the multiarch > > framework. Return NULL if there isn't an architecture with the > > user supplied name, instead of forcing a different one without > > recording the change with the multiarch machinery. > > (find_variant_by_name): Delete. > > It took me a while to convince myself that find_variant_by_name() > wouldn't be useful in the future. But, you're right, this code should > go. Please commit it. > > Thanks, > > Kevin