Revert "[aarch64] Fix missed unaligned hardware watchpoints (RH BZ 1347993)."

This reverts commit 397c8a5922.
This commit is contained in:
Sergio Durigan Junior 2018-05-17 14:52:53 -04:00
parent 397c8a5922
commit 9736ebfbb0
3 changed files with 89 additions and 1284 deletions

File diff suppressed because it is too large Load Diff

View File

@ -117,11 +117,11 @@ Content-Disposition: attachment; filename=bitpos-wp.patch
gdb/target.h | 4 ++--
10 files changed, 38 insertions(+), 37 deletions(-)
Index: gdb-8.1/gdb/aarch64-linux-nat.c
===================================================================
--- gdb-8.1.orig/gdb/aarch64-linux-nat.c 2018-05-05 17:58:31.061496741 +0200
+++ gdb-8.1/gdb/aarch64-linux-nat.c 2018-05-05 17:58:32.449509313 +0200
@@ -789,7 +789,7 @@
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 08e6f4d4fd..f08bf039e4 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -767,7 +767,7 @@ aarch64_linux_stopped_by_watchpoint (struct target_ops *ops)
static int
aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -130,11 +130,11 @@ Index: gdb-8.1/gdb/aarch64-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
Index: gdb-8.1/gdb/arm-linux-nat.c
===================================================================
--- gdb-8.1.orig/gdb/arm-linux-nat.c 2018-05-05 17:58:31.062496750 +0200
+++ gdb-8.1/gdb/arm-linux-nat.c 2018-05-05 17:58:32.449509313 +0200
@@ -1177,7 +1177,7 @@
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 3b7aa40db8..48dfe22ce1 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -1177,7 +1177,7 @@ arm_linux_stopped_by_watchpoint (struct target_ops *ops)
static int
arm_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -143,11 +143,11 @@ Index: gdb-8.1/gdb/arm-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.c
===================================================================
--- gdb-8.1.orig/gdb/nat/aarch64-linux-hw-point.c 2018-05-05 17:58:31.062496750 +0200
+++ gdb-8.1/gdb/nat/aarch64-linux-hw-point.c 2018-05-05 17:59:16.616909382 +0200
@@ -137,7 +137,7 @@
diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
index ce26f28fad..e9ebc5fba8 100644
--- a/gdb/nat/aarch64-linux-hw-point.c
+++ b/gdb/nat/aarch64-linux-hw-point.c
@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int len)
Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */
static int
@ -156,19 +156,20 @@ Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.c
{
unsigned int alignment = 0;
@@ -212,9 +212,9 @@
an address within the latter. */
@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
limitations can be largely relaxed with some further work. */
static void
-aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len, CORE_ADDR *aligned_addr_p,
int *aligned_offset_p, int *aligned_len_p,
- CORE_ADDR *next_addr_p, int *next_len_p,
+ CORE_ADDR *next_addr_p, LONGEST *next_len_p,
CORE_ADDR *next_addr_orig_p)
+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len,
+ CORE_ADDR *aligned_addr_p,
int *aligned_len_p, CORE_ADDR *next_addr_p,
- int *next_len_p)
+ LONGEST *next_len_p)
{
int aligned_len;
@@ -611,7 +611,7 @@
unsigned int offset;
@@ -501,7 +502,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type,
static int
aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
@ -176,23 +177,20 @@ Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.c
+ CORE_ADDR addr, LONGEST len, int is_insert,
struct aarch64_debug_reg_state *state)
{
CORE_ADDR addr_orig = addr;
@@ -641,12 +641,12 @@
while (len > 0)
@@ -524,9 +525,9 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
" "
"aligned_addr: %s, aligned_len: %d\n"
" "
"addr_orig: %s\n"
" "
- "next_addr: %s, next_len: %d\n"
+ "next_addr: %s, next_len: %s\n"
" "
"addr_orig_next: %s\n",
- "next_addr: %s, next_len: %d\n",
+ "next_addr: %s, next_len: %s\n",
is_insert, core_addr_to_string_nz (aligned_addr),
aligned_len, core_addr_to_string_nz (addr_orig),
- core_addr_to_string_nz (addr), len,
+ core_addr_to_string_nz (addr), plongest (len),
core_addr_to_string_nz (addr_orig_next));
- aligned_len, core_addr_to_string_nz (addr), len);
+ aligned_len, core_addr_to_string_nz (addr), plongest (len));
addr_orig = addr_orig_next;
@@ -660,7 +660,7 @@
if (ret != 0)
return ret;
@@ -537,7 +538,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
int
aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
@ -201,7 +199,7 @@ Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.c
struct aarch64_debug_reg_state *state)
{
if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
@@ -722,14 +722,14 @@
@@ -588,14 +589,14 @@ aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
void
aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
const char *func, CORE_ADDR addr,
@ -219,11 +217,11 @@ Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.c
type == hw_write ? "hw-write-watchpoint"
: (type == hw_read ? "hw-read-watchpoint"
: (type == hw_access ? "hw-access-watchpoint"
Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.h
===================================================================
--- gdb-8.1.orig/gdb/nat/aarch64-linux-hw-point.h 2018-05-05 17:58:31.062496750 +0200
+++ gdb-8.1/gdb/nat/aarch64-linux-hw-point.h 2018-05-05 17:58:32.450509322 +0200
@@ -176,7 +176,7 @@
diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h
index 7c42b96d1b..e1d4fc8dbc 100644
--- a/gdb/nat/aarch64-linux-hw-point.h
+++ b/gdb/nat/aarch64-linux-hw-point.h
@@ -172,7 +172,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr,
int len, int is_insert,
struct aarch64_debug_reg_state *state);
int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
@ -231,8 +229,8 @@ Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.h
+ LONGEST len, int is_insert,
struct aarch64_debug_reg_state *state);
void aarch64_linux_set_debug_regs (struct aarch64_debug_reg_state *state,
@@ -184,7 +184,7 @@
void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
@@ -180,7 +180,7 @@ void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
const char *func, CORE_ADDR addr,
@ -241,11 +239,11 @@ Index: gdb-8.1/gdb/nat/aarch64-linux-hw-point.h
void aarch64_linux_get_debug_reg_capacity (int tid);
Index: gdb-8.1/gdb/ppc-linux-nat.c
===================================================================
--- gdb-8.1.orig/gdb/ppc-linux-nat.c 2018-05-05 17:58:31.063496759 +0200
+++ gdb-8.1/gdb/ppc-linux-nat.c 2018-05-05 17:58:32.450509322 +0200
@@ -1798,11 +1798,11 @@
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 4a82434c0d..49a27d8daa 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -1798,11 +1798,11 @@ can_use_watchpoint_cond_accel (void)
CONDITION_VALUE will hold the value which should be put in the
DVC register. */
static void
@ -260,7 +258,7 @@ Index: gdb-8.1/gdb/ppc-linux-nat.c
CORE_ADDR addr_end_data, addr_end_dvc;
/* The DVC register compares bytes within fixed-length windows which
@@ -1889,7 +1889,7 @@
@@ -1889,7 +1889,7 @@ num_memory_accesses (struct value *v)
of the constant. */
static int
check_condition (CORE_ADDR watch_addr, struct expression *cond,
@ -269,7 +267,7 @@ Index: gdb-8.1/gdb/ppc-linux-nat.c
{
int pc = 1, num_accesses_left, num_accesses_right;
struct value *left_val, *right_val, *left_chain, *right_chain;
@@ -1957,7 +1957,7 @@
@@ -1957,7 +1957,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond,
true. */
static int
ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
@ -278,7 +276,7 @@ Index: gdb-8.1/gdb/ppc-linux-nat.c
struct expression *cond)
{
CORE_ADDR data_value;
@@ -1974,7 +1974,7 @@
@@ -1974,7 +1974,7 @@ ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
static void
create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
@ -287,7 +285,7 @@ Index: gdb-8.1/gdb/ppc-linux-nat.c
struct expression *cond, int insert)
{
if (len == 1
@@ -2240,7 +2240,7 @@
@@ -2240,7 +2240,7 @@ ppc_linux_stopped_by_watchpoint (struct target_ops *ops)
static int
ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -296,11 +294,11 @@ Index: gdb-8.1/gdb/ppc-linux-nat.c
{
int mask;
Index: gdb-8.1/gdb/procfs.c
===================================================================
--- gdb-8.1.orig/gdb/procfs.c 2018-05-05 17:58:31.064496768 +0200
+++ gdb-8.1/gdb/procfs.c 2018-05-05 17:58:32.451509331 +0200
@@ -1563,7 +1563,7 @@
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 887f1201fe..edd1be632a 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -1563,7 +1563,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
}
static int
@ -309,7 +307,7 @@ Index: gdb-8.1/gdb/procfs.c
{
struct {
procfs_ctl_t cmd;
@@ -3250,7 +3250,7 @@
@@ -3250,7 +3250,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid)
/* Insert a watchpoint. */
static int
@ -318,11 +316,11 @@ Index: gdb-8.1/gdb/procfs.c
int after)
{
int pflags = 0;
Index: gdb-8.1/gdb/remote.c
===================================================================
--- gdb-8.1.orig/gdb/remote.c 2018-05-05 17:58:31.066496786 +0200
+++ gdb-8.1/gdb/remote.c 2018-05-05 17:58:32.452509340 +0200
@@ -9897,7 +9897,7 @@
diff --git a/gdb/remote.c b/gdb/remote.c
index 94d5594175..86777f1e5e 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9897,7 +9897,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@ -331,7 +329,7 @@ Index: gdb-8.1/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
@@ -9917,7 +9917,7 @@
@@ -9917,7 +9917,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
static int
remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
@ -340,7 +338,7 @@ Index: gdb-8.1/gdb/remote.c
{
CORE_ADDR diff = remote_address_masked (addr - start);
@@ -9946,7 +9946,7 @@
@@ -9946,7 +9946,7 @@ remote_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@ -349,11 +347,11 @@ Index: gdb-8.1/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
Index: gdb-8.1/gdb/target-delegates.c
===================================================================
--- gdb-8.1.orig/gdb/target-delegates.c 2018-05-05 17:58:25.321444747 +0200
+++ gdb-8.1/gdb/target-delegates.c 2018-05-05 17:58:32.453509349 +0200
@@ -733,14 +733,14 @@
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 2b449cbf01..f725215fff 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -733,14 +733,14 @@ debug_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
}
static int
@ -370,7 +368,7 @@ Index: gdb-8.1/gdb/target-delegates.c
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_watchpoint_addr_within_range (...)\n", debug_target.to_shortname);
@@ -752,7 +752,7 @@
@@ -752,7 +752,7 @@ debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, COR
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg2);
fputs_unfiltered (", ", gdb_stdlog);
@ -379,7 +377,7 @@ Index: gdb-8.1/gdb/target-delegates.c
fputs_unfiltered (") = ", gdb_stdlog);
target_debug_print_int (result);
fputs_unfiltered ("\n", gdb_stdlog);
@@ -785,20 +785,20 @@
@@ -785,20 +785,20 @@ debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONG
}
static int
@ -403,7 +401,7 @@ Index: gdb-8.1/gdb/target-delegates.c
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_accel_watchpoint_condition (...)\n", debug_target.to_shortname);
@@ -808,7 +808,7 @@
@@ -808,7 +808,7 @@ debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, i
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg1);
fputs_unfiltered (", ", gdb_stdlog);
@ -412,11 +410,11 @@ Index: gdb-8.1/gdb/target-delegates.c
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg3);
fputs_unfiltered (", ", gdb_stdlog);
Index: gdb-8.1/gdb/target.c
===================================================================
--- gdb-8.1.orig/gdb/target.c 2018-05-05 17:58:31.068496804 +0200
+++ gdb-8.1/gdb/target.c 2018-05-05 17:58:32.453509349 +0200
@@ -53,7 +53,7 @@
diff --git a/gdb/target.c b/gdb/target.c
index a1ac6d0697..eb0538cb82 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -53,7 +53,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN;
static void default_terminal_info (struct target_ops *, const char *, int);
static int default_watchpoint_addr_within_range (struct target_ops *,
@ -425,7 +423,7 @@ Index: gdb-8.1/gdb/target.c
static int default_region_ok_for_hw_watchpoint (struct target_ops *,
CORE_ADDR, LONGEST);
@@ -3120,7 +3120,7 @@
@@ -3120,7 +3120,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self,
static int
default_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -434,11 +432,11 @@ Index: gdb-8.1/gdb/target.c
{
return addr >= start && addr < start + length;
}
Index: gdb-8.1/gdb/target.h
===================================================================
--- gdb-8.1.orig/gdb/target.h 2018-05-05 17:58:31.068496804 +0200
+++ gdb-8.1/gdb/target.h 2018-05-05 17:58:32.454509358 +0200
@@ -535,7 +535,7 @@
diff --git a/gdb/target.h b/gdb/target.h
index 7a70c3f6da..35eee91a83 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -535,7 +535,7 @@ struct target_ops
int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *)
TARGET_DEFAULT_RETURN (0);
int (*to_watchpoint_addr_within_range) (struct target_ops *,
@ -447,7 +445,7 @@ Index: gdb-8.1/gdb/target.h
TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
/* Documentation of this routine is provided with the corresponding
@@ -545,7 +545,7 @@
@@ -545,7 +545,7 @@ struct target_ops
TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
int (*to_can_accel_watchpoint_condition) (struct target_ops *,
@ -456,3 +454,6 @@ Index: gdb-8.1/gdb/target.h
struct expression *)
TARGET_DEFAULT_RETURN (0);
int (*to_masked_watch_num_registers) (struct target_ops *,
--
2.14.3

View File

@ -26,7 +26,7 @@ Version: 8.1
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 15%{?dist}
Release: 14%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
Group: Development/Debuggers
@ -188,9 +188,6 @@ Patch1044: gdb-pahole-python2.patch
##=fedoratest
Patch1119: gdb-testsuite-readline63-sigint-revert.patch
# [aarch64] Fix missed unaligned hardware watchpoints (RH BZ 1347993).
Patch1278: gdb-rhbz1347993-aarch64-hw-watchpoint.patch
# Include the auto-generated file containing the "Patch:" directives.
# See README.local-patches for more details.
Source8: _gdb.spec.Patch.include
@ -416,8 +413,6 @@ tar xzf %{SOURCE7}
)
%endif
%patch1278 -p1
# Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh .
(cd gdb;rm -fv $(perl -pe 's/\\\n/ /' <Makefile.in|sed -n 's/^YYFILES = //p'))
@ -1031,9 +1026,6 @@ then
fi
%changelog
* Sat May 5 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 8.1-15.fc28
- [aarch64] Fix missed unaligned hardware watchpoints (RH BZ 1347993).
* Mon Apr 2 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 8.1-14.fc28
- Revert 'Fix PDF build on Rawhide/F-29', rm -rf texinfo/ (from RH BZ 1562580).