public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@redhat.com
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] aarch64 multi-arch part 6: HW breakpoint on unaligned address
Date: Thu, 15 Oct 2015 14:19:00 -0000	[thread overview]
Message-ID: <8d689ee570e7c4c61231b919d5b6a34c20414c43@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 8d689ee570e7c4c61231b919d5b6a34c20414c43 ***

Author: Yao Qi <yao.qi@linaro.org>
Branch: master
Commit: 8d689ee570e7c4c61231b919d5b6a34c20414c43

aarch64 multi-arch part 6: HW breakpoint on unaligned address

Nowadays, both aarch64 GDB and linux kernel assumes that address for
setting breakpoint should be 4-byte aligned.  However that is not true
after we support multi-arch, because thumb instruction can be at 2-byte
aligned address.  Patch http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/375141.html
to linux kernel is to teach kernel to handle 2-byte aligned address for
HW breakpoint, while this patch is to teach aarch64 GDB handle 2-byte
aligned address.

First of all, we call gdbarch_breakpoint_from_pc to get the instruction
length rather than using hard-coded 4.  Secondly, in GDBserver, we set
length back to 2 if it is 3, because GDB encode 3 in it to indicate it
is a 32-bit thumb breakpoint.  Then we relax the address alignment
check from 4-byte aligned to 2-byte aligned.

This patch enables some tests (such as gdb.base/break-idempotent.exp,
gdb.base/cond-eval-mode.exp, gdb.base/watchpoint-reuse-slot.exp,) and
fixes many fails (such as gdb.base/hbreak2.exp) when the program is
compiled in thumb mode on aarch64.

Regression tested on aarch64-linux, both native and gdbserver.  This
is the last patch of multi-arch work.

gdb:

2015-10-15  Yao Qi  <yao.qi@linaro.org>

	* aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint):
	Call gdbarch_breakpoint_from_pc to instruction length.
	(aarch64_linux_remove_hw_breakpoint): Likewise.
	* common/common-regcache.h (regcache_register_size): Declare.
	* nat/aarch64-linux-hw-point.c: Include "common-regcache.h".
	(aarch64_point_is_aligned): Set alignment to 2 for breakpoint if
	the process is 32bit, otherwise set alignment to 4.
	(aarch64_handle_breakpoint): Update comments.
	* regcache.c (regcache_register_size): New function.

gdb/gdbserver:

2015-10-15  Yao Qi  <yao.qi@linaro.org>

	* linux-aarch64-low.c (aarch64_insert_point): Set len to 2
	if it is 3.
	(aarch64_remove_point): Likewise.
	* regcache.c (regcache_register_size): New function.


             reply	other threads:[~2015-10-15 14:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 14:19 sergiodj+buildbot [this message]
2015-10-15 14:20 ` Failures on Debian-s390x-native-gdbserver-m64, branch master sergiodj+buildbot
2015-10-15 14:23 ` Failures on Fedora-i686, " sergiodj+buildbot
2015-10-15 14:24 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2015-10-15 14:25 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2015-10-15 14:25 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2015-10-15 14:33 ` Failures on AIX-POWER7-plain, " sergiodj+buildbot
2015-10-15 14:36 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-10-15 14:36 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2015-10-15 14:36 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-10-15 14:40 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2015-10-15 15:18 ` Failures on Debian-i686, " sergiodj+buildbot
2015-10-15 15:36 ` Failures on Debian-i686-native-gdbserver, " sergiodj+buildbot
2015-10-15 15:42 ` Failures on Debian-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-10-15 16:00 ` Failures on Debian-i686-native-extended-gdbserver, " sergiodj+buildbot
2015-10-15 16:26 ` Failures on Fedora-ppc64be-m64, " sergiodj+buildbot
2015-10-15 16:43 ` Failures on Fedora-ppc64be-native-gdbserver-m64, " sergiodj+buildbot
2015-10-15 17:03 ` Failures on Fedora-ppc64be-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-10-15 17:54 ` Failures on Fedora-ppc64le-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-10-15 18:25 ` Failures on Fedora-ppc64le-native-gdbserver-m64, " sergiodj+buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d689ee570e7c4c61231b919d5b6a34c20414c43@gdb-build \
    --to=sergiodj+buildbot@redhat.com \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).