From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22472 invoked by alias); 29 Oct 2010 19:20:51 -0000 Received: (qmail 22413 invoked by uid 22791); 29 Oct 2010 19:20:49 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 Oct 2010 19:20:43 +0000 Received: (qmail 28543 invoked from network); 29 Oct 2010 19:20:41 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Oct 2010 19:20:41 -0000 From: Nathan Froyd To: gdb-patches@sourceware.org Subject: [PATCH] fix disassembly of E500 instructions Date: Fri, 29 Oct 2010 19:20:00 -0000 Message-Id: <1288380041-22124-1-git-send-email-froydnj@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2010-10/txt/msg00390.txt.bz2 This patch addresses a usability nit: when debugging E500 binaries and disassembling code containing E500-specific (SPE) instructions, one sometimes sees AltiVec instructions instead. The opcode spaces for SPE instructions and AltiVec instructions overlap, and specifiying the "any" cpu in gdb_print_insn_powerpc looks for AltiVec instructions first. If we know we're debugging an E500 binary, however, we can specify the "e500x2" cpu and get much more sane disassembly output. Tested manually with cross to powerpc-linux-gnu. OK to commit? -Nathan * rs6000-tdep.c (gdb_print_insn_powerpc): Disassemble e500 instructions if debugging an e500 binary. --- gdb/rs6000-tdep.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 09c7f8f..ef049d9 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -3029,7 +3029,12 @@ static int gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info) { if (!info->disassembler_options) - info->disassembler_options = "any"; + { + if (info->mach == bfd_mach_ppc_e500) + info->disassembler_options = "e500x2"; + else + info->disassembler_options = "any"; + } if (info->endian == BFD_ENDIAN_BIG) return print_insn_big_powerpc (memaddr, info); -- 1.6.3.2