From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25575 invoked by alias); 26 Jun 2013 19:08:35 -0000 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 Received: (qmail 25560 invoked by uid 89); 26 Jun 2013 19:08:35 -0000 X-Spam-SWARE-Status: No, score=-4.6 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; Wed, 26 Jun 2013 19:08:34 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Urv4y-0003ji-SX from Maciej_Rozycki@mentor.com ; Wed, 26 Jun 2013 12:08:32 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 26 Jun 2013 12:08:32 -0700 Received: from [172.30.64.155] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 26 Jun 2013 20:08:30 +0100 Date: Wed, 26 Jun 2013 19:08:00 -0000 From: "Maciej W. Rozycki" To: Richard Sandiford CC: Subject: Re: Is this "gdb disassembler" code still needed? In-Reply-To: <87d2r83elf.fsf@talisman.default> Message-ID: References: <87d2r83elf.fsf@talisman.default> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-06/txt/msg00059.txt.bz2 On Wed, 26 Jun 2013, Richard Sandiford wrote: > opcodes/mips-dis.c has some code marked "For gdb disassembler, ...". > > (1) For jumps in the standard encoding: > > /* For gdb disassembler, force odd address on jalx. */ > if (info->flavour == bfd_target_unknown_flavour > && strcmp (opp->name, "jalx") == 0) > info->target |= 1; > > (2) For MIPS16 branches: > > if (pcrel && branch > && info->flavour == bfd_target_unknown_flavour) > /* For gdb disassembler, maintain odd address. */ > info->target |= 1; > > (3) For MIPS16 jumps: > > if (!jalx && info->flavour == bfd_target_unknown_flavour) > /* For gdb disassembler, maintain odd address. */ > l |= 1; > > (4) For microMIPS jumps: > > /* For gdb disassembler, force odd address on jalx. */ > if (info->flavour == bfd_target_unknown_flavour > && strcmp (op->name, "jalx") == 0) > info->target |= 1; > > (4) seems like it's doing the opposite of (3), whereas I'd have expected > it to do the same. It doesn't like microMIPS has the equivalent of (2). > (Hope I'm reading this right.) > > Do you know if this special handling is still needed? If so, is the > current behaviour intentional? Thanks for the heads-up. Hmm, it looks like some cleanup might be in order here, especially the microMIPS stuff seems backwards (probably blindly copied from the standard MIPS version whereas MIPS16 conditions stand here) and should be fixed. Other than that I am fairly sure the behaviour is intentional, so except from any microMIPS change to match the MIPS16 variant please refrain from fiddling with these bits until I am done with the change proposed here: http://sourceware.org/ml/binutils/2012-05/msg00183.html http://sourceware.org/ml/binutils/2012-06/msg00114.html Maciej