This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] rs6000-tdep.c: arch switching buglet
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Elena Zannoni <ezannoni at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Wed, 13 Feb 2002 18:13:40 -0700
- Subject: Re: [RFA] rs6000-tdep.c: arch switching buglet
- References: <email@example.com>
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 <firstname.lastname@example.org>
> * 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.