From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: gdb-patches@sources.redhat.com Subject: Re: [rfc] Swap out current when creating a new architecture Date: Sun, 30 Sep 2001 12:25:00 -0000 Message-id: <3BB771A1.4070201@cygnus.com> References: <3BB16441.30805@cygnus.com> X-SW-Source: 2001-09/msg00457.html > The attached changes the run-time environment within which a new architectures are created. Briefly the simplified sequence: > > - call XXX_gdbarch_init() > - swap out old architecture > - install new architecture > > is changed to: > > - swap out old architecture > - call XX_gdbarch_init() > - install new architecture > > This has the effect of making current_gdbarch invalid for the lifetime of the XXX_gdbarch_init() call. > This patch is evi^D^D^D nasty. The CRIS target also dumps core with it applied. Like rs6000 was, it is refering to the previous (current_gdbarch) architecture. I'll sit on this for a bit longer. Could I encourage target maintainers to check their XXX_gdbarch_init() function for references to current_gdbarch. Andrew