From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5225 invoked by alias); 9 Apr 2003 14:52:22 -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 5216 invoked from network); 9 Apr 2003 14:52:20 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 9 Apr 2003 14:52:20 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 9B7712B23; Wed, 9 Apr 2003 10:52:10 -0400 (EDT) Message-ID: <3E94339A.8030405@redhat.com> Date: Wed, 09 Apr 2003 14:52:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexandre Oliva Cc: gdb-patches@sources.redhat.com Subject: Re: use MIPS NewABI register names when disassembling NewABI code References: <3E927BCA.1080702@redhat.com> <3E93391F.2050005@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00157.txt.bz2 >>> Uh. I see. So much for trying to get rid of one more call to >>> bfd_alloc. This is easy to fix, though. > > >> What about the problem of lifetimes? > > > What do you mean? I plan to use bfd_alloc for it, like > bfd_make_empty_symbol does, which means it's allocated on the bfd's > obstack, which gets it deallocated at the right time. In my original post I made two points: > Ugly? This bit: >> + static asymbol *symbols = NULL; > is wrong. There is more than one instance of an architecture. The symbols lifetime is different to that of the architecture (assuming that the symbol's lifetime is tied to the corresponding bfd). An architecture can't point at anything tied to the lifetime of an instance of a BFD. >>>> How does objdump manage to correctly disassemble something like an >>>> srecord? > > >>> Presumably, it doesn't. If it's not an ELF bfd, it has no way to >>> tell which ABI to disassemble for. > > >> Fixing that will cause the gdb side of this problem to fall out. > > > I don't see what's there to be fixed, really, and I can't see how to > change it either. n32 and n64, the only ABIs that use different > register naming conventions, don't support anything other than ELF, so > it's only fair for it to use information from the ELF headers to > decide which naming convention to use. The only missing bit in gdb is > to pass the needed information (namely the pointer to the bfd) to the > disassembler. It is wrong to assume that there is a BFD. GDB needs to be able to work correctly vis: $ gdb (gdb) set architecture (gdb) set mips disassembler (gdb) target remote (gdb) disassemble and this is identical to the situtation that objdump encounters when presented with an srecord. Please first fix objdump, and then we can see about fixing GDB. Andrew