From: Marcus Shawcroft <marcus.shawcroft@arm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH] gdbserver aarch64 fix the clamping of HW break point and watchpoint counts.
Date: Thu, 07 Feb 2013 15:51:00 -0000 [thread overview]
Message-ID: <5113CD7D.6080502@arm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 311 bytes --]
This issue came to light in the recent review of aarch64-linux-nat, and
also needs resolving in GDBserver.
OK?
/Marcus
2013-02-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
* linux-aarch64-low.c (aarch64_arch_setup): Fix clamping of
aarch64_num_wp_regs and aarch64_num_bp_regs.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gdbserver-hwbp-clamping.diff --]
[-- Type: text/x-patch; name=0001-gdbserver-hwbp-clamping.diff, Size: 1539 bytes --]
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index e56ea80..3bd9af8 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -1202,10 +1202,13 @@ aarch64_arch_setup (void)
&& AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
{
aarch64_num_wp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
- if (aarch64_num_wp_regs > AARCH64_HBP_MAX_NUM)
- warning ("Unexpected number of hardware watchpoint registers reported"
- " by ptrace, got %d, expected %d.",
- aarch64_num_wp_regs, AARCH64_HBP_MAX_NUM);
+ if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM)
+ {
+ warning ("Unexpected number of hardware watchpoint registers reported"
+ " by ptrace, got %d, expected %d.",
+ aarch64_num_wp_regs, AARCH64_HWP_MAX_NUM);
+ aarch64_num_wp_regs = AARCH64_HWP_MAX_NUM;
+ }
}
else
{
@@ -1220,9 +1223,12 @@ aarch64_arch_setup (void)
{
aarch64_num_bp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM)
- warning ("Unexpected number of hardware breakpoint registers reported"
- " by ptrace, got %d, expected %d.",
- aarch64_num_bp_regs, AARCH64_HBP_MAX_NUM);
+ {
+ warning ("Unexpected number of hardware breakpoint registers reported"
+ " by ptrace, got %d, expected %d.",
+ aarch64_num_bp_regs, AARCH64_HBP_MAX_NUM);
+ aarch64_num_bp_regs = AARCH64_HBP_MAX_NUM;
+ }
}
else
{
next reply other threads:[~2013-02-07 15:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 15:51 Marcus Shawcroft [this message]
2013-02-07 16:14 ` Pedro Alves
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=5113CD7D.6080502@arm.com \
--to=marcus.shawcroft@arm.com \
--cc=gdb-patches@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