From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31824 invoked by alias); 28 Jan 2010 12:48:28 -0000 Received: (qmail 31801 invoked by uid 22791); 28 Jan 2010 12:48:27 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jan 2010 12:48:22 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0SClbHs002878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Jan 2010 07:47:37 -0500 Received: from [10.36.4.232] (vpn1-4-232.ams2.redhat.com [10.36.4.232]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0SClZ0l007635; Thu, 28 Jan 2010 07:47:36 -0500 Message-ID: <4B618767.30408@redhat.com> Date: Thu, 28 Jan 2010 12:48:00 -0000 From: Nick Clifton User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0 MIME-Version: 1.0 To: Doug Evans , dgutson@codesourcery.com, gdb@sourceware.org, binutils@sourceware.org Subject: Re: gdb segv in arm disassembler References: <20100126022255.344B284414@ruffy.mtv.corp.google.com> <20100126023652.GA14474@caradoc.them.org> In-Reply-To: <20100126023652.GA14474@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00207.txt.bz2 Hi Daniel, >> On Mon, Jan 25, 2010 at 06:22:55PM -0800, Doug Evans wrote: >> I'm getting a segv in the arm disassembler when invoked from gdb, > Yes. Sorry - I have a patch for this but I have got stuck travelling > instead of finishing the patch series it's part of. > > I think this is the appropriate fix: > - int is_data = (bfd_asymbol_flavour (*info->symtab) > - == bfd_target_elf_flavour) ? TRUE : FALSE; > + int is_data = FALSE; Unfortunately this introduces a new failure into the GAS testsuite. How about this version instead ? Cheers Nick Index: opcodes/arm-dis.c =================================================================== RCS file: /cvs/src/src/opcodes/arm-dis.c,v retrieving revision 1.122 diff -c -3 -p -r1.122 arm-dis.c *** opcodes/arm-dis.c 20 Jan 2010 10:54:03 -0000 1.122 --- opcodes/arm-dis.c 28 Jan 2010 12:46:17 -0000 *************** print_insn (bfd_vma pc, struct disassemb *** 4355,4367 **** long given; int status; int is_thumb = FALSE; ! int is_data = (bfd_asymbol_flavour (*info->symtab) ! == bfd_target_elf_flavour) ? TRUE : FALSE; int little_code; unsigned int size = 4; void (*printer) (bfd_vma, struct disassemble_info *, long); bfd_boolean found = FALSE; if (info->disassembler_options) { parse_disassembler_options (info->disassembler_options); --- 4355,4373 ---- long given; int status; int is_thumb = FALSE; ! int is_data = FALSE; int little_code; unsigned int size = 4; void (*printer) (bfd_vma, struct disassemble_info *, long); bfd_boolean found = FALSE; + /* On ELF based systems we use special mapping symbols to tell us + where regions of code occur, so in the absence of such symbols + we default to treating the words as data. */ + if (info->symtab != NULL + && bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour) + is_data = TRUE; + if (info->disassembler_options) { parse_disassembler_options (info->disassembler_options);