From patchwork Tue Apr 17 13:02:18 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: 26762 Received: (qmail 38686 invoked by alias); 17 Apr 2018 13:03:09 -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 38670 invoked by uid 89); 17 Apr 2018 13:03:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.0 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, URIBL_SBL autolearn=ham version=3.3.2 spammy=D*ru X-HELO: forward105p.mail.yandex.net Received: from forward105p.mail.yandex.net (HELO forward105p.mail.yandex.net) (77.88.28.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Apr 2018 13:03:06 +0000 Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward105p.mail.yandex.net (Yandex) with ESMTP id BCF1740827AB for ; Tue, 17 Apr 2018 16:03:03 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id YlinbzGh3N-33FG8AVJ; Tue, 17 Apr 2018 16:03:03 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id MSTOKw7Ka2-2uO8wQsS; Tue, 17 Apr 2018 16:02:56 +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] gdbarch: fix default value of significant_addr_bit Date: Tue, 17 Apr 2018 09:02:18 -0400 Message-Id: <20180417130218.23766-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. This commit sets significant_addr_bit in gdbarch to number of bits in bfd_vma, as suggested by Maciej W. Rozycki. Signed-off-by: Vlad Ivanov --- gdb/gdbarch.c | 2 +- gdb/gdbarch.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 1359c2fb53..bd8e8c8966 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -622,7 +622,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ /* Skip verify of addr_bits_remove, invalid_p == 0 */ if (gdbarch->significant_addr_bit == 0) - gdbarch->significant_addr_bit = gdbarch_addr_bit (gdbarch); + gdbarch->significant_addr_bit = TARGET_CHAR_BIT * sizeof (bfd_vma); /* Skip verify of software_single_step, has predicate. */ /* Skip verify of single_step_through_delay, has predicate. */ /* Skip verify of print_insn, invalid_p == 0 */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 4fc54cba9c..2a37055797 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -625,7 +625,7 @@ m;CORE_ADDR;addr_bits_remove;CORE_ADDR addr;addr;;core_addr_identity;;0 # For example, on AArch64, the top bits of an address known as the "tag" # are ignored by the kernel, the hardware, etc. and can be regarded as # additional data associated with the address. -v;int;significant_addr_bit;;;;;gdbarch_addr_bit (gdbarch); +v;int;significant_addr_bit;;;;;TARGET_CHAR_BIT * sizeof (bfd_vma) # FIXME/cagney/2001-01-18: This should be split in two. A target method that # indicates if the target needs software single step. An ISA method to