From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10172 invoked by alias); 14 Feb 2002 01:15:18 -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 10066 invoked from network); 14 Feb 2002 01:15:10 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 14 Feb 2002 01:15:10 -0000 Received: from cse.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id RAA14407; Wed, 13 Feb 2002 17:15:01 -0800 (PST) Received: (from kev@localhost) by cse.cygnus.com (8.11.6/8.11.6) id g1E1De009353; Wed, 13 Feb 2002 18:13:40 -0700 Date: Wed, 13 Feb 2002 17:15:00 -0000 From: Kevin Buettner Message-Id: <1020214011340.ZM9352@localhost.localdomain> In-Reply-To: Elena Zannoni "[RFA] rs6000-tdep.c: arch switching buglet" (Feb 12, 10:47am) References: <15465.14609.272441.491094@localhost.redhat.com> X-Mailer: Z-Mail (4.0.1 13Jan97 Caldera) To: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA] rs6000-tdep.c: arch switching buglet MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg00381.txt.bz2 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