Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Doug Evans <dje@google.com>,
	dgutson@codesourcery.com, gdb@sourceware.org,
	        binutils@sourceware.org
Subject: Re: gdb segv in arm disassembler
Date: Thu, 28 Jan 2010 12:48:00 -0000	[thread overview]
Message-ID: <4B618767.30408@redhat.com> (raw)
In-Reply-To: <20100126023652.GA14474@caradoc.them.org>

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);


  reply	other threads:[~2010-01-28 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26  2:23 Doug Evans
2010-01-26  2:37 ` Daniel Jacobowitz
2010-01-28 12:48   ` Nick Clifton [this message]
2010-01-28 18:27     ` Daniel Jacobowitz
2010-01-28 19:30       ` Daniel Jacobowitz
2010-01-29 10:21         ` Nick Clifton
2010-02-23 12:14       ` Paul Brook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B618767.30408@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=dgutson@codesourcery.com \
    --cc=dje@google.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox