From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73621 invoked by alias); 19 Mar 2018 14:14:06 -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 73450 invoked by uid 89); 19 Mar 2018 14:14:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: 9pmail.ess.barracuda.com Received: from 9pmail.ess.barracuda.com (HELO 9pmail.ess.barracuda.com) (64.235.154.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Mar 2018 14:14:02 +0000 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx1401.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Mon, 19 Mar 2018 14:11:15 +0000 Received: from [10.20.78.81] (10.20.78.81) by mips01.mipstec.com (10.20.43.31) with Microsoft SMTP Server id 14.3.361.1; Mon, 19 Mar 2018 07:09:04 -0700 Date: Mon, 19 Mar 2018 14:14:00 -0000 From: "Maciej W. Rozycki" To: Ulrich Weigand CC: Yao Qi , Vlad Ivanov , Andreas Schwab , "gdb-patches@sourceware.org" Subject: Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses In-Reply-To: <20180315125901.CE510D804A7@oc3748833570.ibm.com> Message-ID: References: <20180315125901.CE510D804A7@oc3748833570.ibm.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-BESS-ID: 1521468392-321457-4552-66339-13 X-BESS-VER: 2018.3-r1803090017 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.191204 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status:1 X-SW-Source: 2018-03/txt/msg00353.txt.bz2 On Thu, 15 Mar 2018, Ulrich Weigand wrote: > > MIPS backend already returns a sign-extended value, and address_significant > > cuts out bits 63 to 32. This makes breakpoint address comparison in step > > routines to misbehave. > > If the address is already correct, why don't you simply set > gdbarch_significant_addr_bit > to 64 in the mips back-end instead of adding a new gdbarch routine? I think it's the default from commit a738ea1d41da ("Clear non-significant bits of address on memory access") that is wrong. The default is set to `gdbarch_addr_bit (gdbarch)'. Instead I think it should be set to the BFD VMA width, i.e. `8 * sizeof (bfd_vma)' or suchlike, so that the internal representation does not get truncated inadvertently. More targets will be affected; e.g. as I recall SH also has signed addresses. Maciej