From patchwork Thu Mar 15 14:38:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vlad.ivanov@lab-systems.ru X-Patchwork-Id: 26320 Received: (qmail 49404 invoked by alias); 15 Mar 2018 14:39:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 49390 invoked by uid 89); 15 Mar 2018 14:39:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=sk:signifi X-HELO: forward103p.mail.yandex.net Received: from forward103p.mail.yandex.net (HELO forward103p.mail.yandex.net) (77.88.28.106) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Mar 2018 14:39:31 +0000 Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 9BFC72185AA2 for ; Thu, 15 Mar 2018 17:39:28 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 8AxeLMJCts-dS0CAjZi; Thu, 15 Mar 2018 17:39:28 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IT2RjJCWY9-dQaWJ1w2; Thu, 15 Mar 2018 17:39:26 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Vlad Ivanov To: gdb-patches@sourceware.org Cc: Vlad Ivanov Subject: [PATCH] mips: set significant_addr_bit to number of bits in CORE_ADDR Date: Thu, 15 Mar 2018 10:38:55 -0400 Message-Id: <20180315143855.17941-1-vlad.ivanov@lab-systems.ru> MIPS targets use signed PC values. Since commit a0de8c21 single-stepping on these targets didn't work due to the addition of address_significant in adjust_breakpoint_address - sign bits were cut off because of default value of significant_addr_bit. With this commit, significant_addr_bit in gdbarch is set to the number of bits in CORE_ADDR so breakpoint address comparison works again for MIPS targets. * mips-tdep.c (mips_gdbarch_init): Set significant_addr_bit --- gdb/mips-tdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index f9f84c4d48..5d38168af0 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -8685,6 +8685,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Add/remove bits from an address. The MIPS needs be careful to ensure that all 32 bit addresses are sign extended to 64 bits. */ set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove); + set_gdbarch_significant_addr_bit (gdbarch, sizeof (CORE_ADDR) * HOST_CHAR_BIT); /* Unwind the frame. */ set_gdbarch_unwind_pc (gdbarch, mips_unwind_pc);