From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3991 invoked by alias); 13 Jun 2002 16:18:00 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3859 invoked from network); 13 Jun 2002 16:17:56 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 13 Jun 2002 16:17:56 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 38EB73CA6; Thu, 13 Jun 2002 12:17:59 -0400 (EDT) Message-ID: <3D08C5B7.2010809@cygnus.com> Date: Thu, 13 Jun 2002 09:18:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0rc3) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: gdbarch: ABFD no longer available at gdbarch_update_p time References: <20020613151528.GA4688@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-06/txt/msg00100.txt.bz2 > I'm trying to add a ``set mips abi'' as we discussed earlier. I can't find > a way to do it. The way CRIS does this sort of thing is patently wrong (for > MIPS at least, if not for CRIS also): Interesting, especially given the CRIS target implements it correctly :-) > /* Update the current architecture, if needed. */ > gdbarch_info_init (&info); > if (!gdbarch_update_p (info)) > internal_error (__FILE__, __LINE__, "cris_gdbarch_update: failed to update architecture."); The sequence is: - global option is set - architecture update is forced -- architecture variant identified (using info, globals, and the last architecture) -- existing architectures searched, if match return -- if none match, a new architecture is created using the specified information > That builds a new architecture based entirely on the defaults. info.abfd is > gone at that point, and that's how MIPS makes lots of its decisions. OSABI > support makes this even more pronounced. I'd like to do: > gdbarch_info_init_current (&info); > but since architectures have an independent lifetime from BFD objects it's > not clear how I can implement that. Thoughts? Yes, look at cris_gdbarch_init(): else if (arches != NULL) { /* No bfd available. Stick with the ABI from the most recently selected architecture of this same family (the head of arches always points to this). (This is to avoid changing the ABI when the user updates the architecture with the 'set cris-version' command.) */ cris_abi = gdbarch_tdep (arches->gdbarch)->cris_abi; } else Andrew