From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13858 invoked by alias); 30 May 2013 14:28:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 13847 invoked by uid 89); 30 May 2013 14:28:19 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 30 May 2013 14:28:12 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Ui3pp-0007Tb-Sk from Luis_Gustavo@mentor.com ; Thu, 30 May 2013 07:28:09 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by svr-orw-fem-01.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 30 May 2013 07:28:09 -0700 Received: from [172.30.64.176] ([172.30.64.176]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 30 May 2013 07:28:08 -0700 Message-ID: <51A761EF.6020505@codesourcery.com> Date: Thu, 30 May 2013 14:28:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Udma Catalin-Dan-B32721 CC: "gdb-patches@sourceware.org" Subject: Re: gdb 7.5.1: broken powerpc disassemble initialization References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg01084.txt.bz2 Hi, I think you want to submit this to the binutils mailing list. Alan Modra seems to have done a change in that code. Luis On 05/30/2013 04:02 PM, Udma Catalin-Dan-B32721 wrote: > Hi, > > I found the powerpc disassemble initialization issue introduced in gdb 7.5.1. Everything seems correctly for previous gdb versions. > What was changed in gdb 7.5.1: > > In opcodes/ppc-dis.c has been added the function disassemble_init_powerpc. At the end of the function is done the powerpc dialect initialization (powerpc_init_dialect). > With this change, the dialect initialization is done before the function gdb_print_insn_powerpc is called and therefore disassembler_options set here are ignored being set before the dialect initialization. > > The patch that fixes this issue is below. Please let me know your comments. > > Regards, > Catalin > > > Subject: [PATCH] fix gdb disassembly initialization > > The dialect initialization is broken in gdb 7.5.1 only: the dialect > initialization is done before gdb-print-instruction, therefore the > disassembly options set here are always ignored. This patch fixes > this problem by moving powerpc dialect initialization after the > disassembly option is set in gdb-print-instruction. > > Signed-off-by: Catalin Udma > --- > opcodes/ppc-dis.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c > index 0905744..67ec5ca 100644 > --- a/opcodes/ppc-dis.c > +++ b/opcodes/ppc-dis.c > @@ -339,8 +339,6 @@ disassemble_init_powerpc (struct disassemble_info *info) > last = vle_opcd_indices[i]; > } > > - if (info->arch == bfd_arch_powerpc) > - powerpc_init_dialect (info); > } > > /* Print a big endian PowerPC instruction. */ > @@ -348,6 +346,8 @@ disassemble_init_powerpc (struct disassemble_info *info) > int > print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info) > { > + if (info->private_data == NULL) > + powerpc_init_dialect (info); > return print_insn_powerpc (memaddr, info, 1, get_powerpc_dialect (info)); > } > > @@ -356,6 +356,8 @@ print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info) > int > print_insn_little_powerpc (bfd_vma memaddr, struct disassemble_info *info) > { > + if (info->private_data == NULL) > + powerpc_init_dialect (info); > return print_insn_powerpc (memaddr, info, 0, get_powerpc_dialect (info)); > } > > > >