From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79157 invoked by alias); 15 Mar 2018 12:59:17 -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 79142 invoked by uid 89); 15 Mar 2018 12:59:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS,URIBL_SBL autolearn=ham version=3.3.2 spammy=H*x:version, H*UA:version, D*ru X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Mar 2018 12:59:10 +0000 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2FCx3YV008733 for ; Thu, 15 Mar 2018 08:59:08 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gqrmmjpep-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 15 Mar 2018 08:59:07 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2018 12:59:05 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2018 12:59:02 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2FCx2bG1638898; Thu, 15 Mar 2018 12:59:02 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAE00A4051; Thu, 15 Mar 2018 12:51:50 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A81FBA4040; Thu, 15 Mar 2018 12:51:50 +0000 (GMT) Received: from oc3748833570.ibm.com (unknown [9.152.213.54]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 15 Mar 2018 12:51:50 +0000 (GMT) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id CE510D804A7; Thu, 15 Mar 2018 13:59:01 +0100 (CET) Subject: Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses To: vlad.ivanov@lab-systems.ru (Vlad Ivanov) Date: Thu, 15 Mar 2018 12:59:00 -0000 From: "Ulrich Weigand" Cc: schwab@suse.de (Andreas Schwab), gdb-patches@sourceware.org (gdb-patches@sourceware.org) In-Reply-To: <830441521113797@web37j.yandex.ru> from "Vlad Ivanov" at Mar 15, 2018 02:36:37 PM MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18031512-0040-0000-0000-000004412A21 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031512-0041-0000-0000-000020E4341E Message-Id: <20180315125901.CE510D804A7@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-15_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=18 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803150146 X-SW-Source: 2018-03/txt/msg00296.txt.bz2 Vlad Ivanov wrote: > 15.03.2018, 14:33, "Andreas Schwab" : > > On Mär 15 2018, vlad.ivanov@lab-systems.ru wrote: > > > >>  diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > >>  index 454fda7684..247ec34857 100644 > >>  --- a/gdb/breakpoint.c > >>  +++ b/gdb/breakpoint.c > >>  @@ -6999,7 +6999,10 @@ adjust_breakpoint_address (struct gdbarch *gdbarch, > >>             adjusted_bpaddr = gdbarch_adjust_breakpoint_address (gdbarch, bpaddr); > >>           } > >> > >>  - adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr); > >>  + /* Don't cut out "insignificant" address bits on targets with > >>  + signed PC. */ > >>  + if (!gdbarch_pc_signed (gdbarch)) > >>  + adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr); > > > > Shouldn't it be sign-extended instead? > > > > Andreas. > > > > 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? Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com