From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25331 invoked by alias); 30 May 2013 14:03:24 -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 25288 invoked by uid 89); 30 May 2013 14:03:23 -0000 X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from ch1ehsobe005.messaging.microsoft.com (HELO ch1outboundpool.messaging.microsoft.com) (216.32.181.185) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 30 May 2013 14:03:22 +0000 Received: from mail227-ch1-R.bigfish.com (10.43.68.244) by CH1EHSOBE020.bigfish.com (10.43.70.77) with Microsoft SMTP Server id 14.1.225.23; Thu, 30 May 2013 14:03:20 +0000 Received: from mail227-ch1 (localhost [127.0.0.1]) by mail227-ch1-R.bigfish.com (Postfix) with ESMTP id B2F13168016D for ; Thu, 30 May 2013 14:03:20 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190;KIP:(null);UIP:(null);IPV:NLI;H:mail.freescale.net;RD:none;EFVD:NLI X-SpamScore: 1 X-BigFish: VS1(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839h8e2h8e3h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dc1h1dfeh1dffhbe9i1155h) Received: from mail227-ch1 (localhost.localdomain [127.0.0.1]) by mail227-ch1 (MessageSwitch) id 136992259996827_14901; Thu, 30 May 2013 14:03:19 +0000 (UTC) Received: from CH1EHSMHS017.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.248]) by mail227-ch1.bigfish.com (Postfix) with ESMTP id 154821600057 for ; Thu, 30 May 2013 14:03:19 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS017.bigfish.com (10.43.70.17) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 30 May 2013 14:03:18 +0000 Received: from 039-SN1MPN1-005.039d.mgd.msft.net ([169.254.7.247]) by 039-SN1MMR1-003.039d.mgd.msft.net ([10.84.1.16]) with mapi id 14.02.0328.011; Thu, 30 May 2013 14:04:18 +0000 From: Udma Catalin-Dan-B32721 To: "gdb-patches@sourceware.org" Subject: gdb 7.5.1: broken powerpc disassemble initialization Date: Thu, 30 May 2013 14:03:00 -0000 Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-SW-Source: 2013-05/txt/msg01083.txt.bz2 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 (powe= rpc_init_dialect). With this change, the dialect initialization is done before the function gd= b_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=20 initialization is done before gdb-print-instruction, therefore the=20 disassembly options set here are always ignored. This patch fixes=20 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 =3D vle_opcd_indices[i]; } =20 - if (info->arch =3D=3D bfd_arch_powerpc) - powerpc_init_dialect (info); } =20 /* 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 =3D=3D NULL) + powerpc_init_dialect (info); return print_insn_powerpc (memaddr, info, 1, get_powerpc_dialect (info)); } =20 @@ -356,6 +356,8 @@ print_insn_big_powerpc (bfd_vma memaddr, struct disasse= mble_info *info) int print_insn_little_powerpc (bfd_vma memaddr, struct disassemble_info *info) { + if (info->private_data =3D=3D NULL) + powerpc_init_dialect (info); return print_insn_powerpc (memaddr, info, 0, get_powerpc_dialect (info)); }