From a5cf0a66f18f274b2c662b713206a27e3b6ff7b7 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 28 May 2013 18:11:47 +0200 Subject: [PATCH] [ppc] Backport hardware watchpoints fix (Edjunior Machado, BZ 967915). --- gdb-upstream.patch | 48 ++++++++++++++++++++++++++++++++++++++++++++++ gdb.spec | 5 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/gdb-upstream.patch b/gdb-upstream.patch index 3240ab2..5d7665c 100644 --- a/gdb-upstream.patch +++ b/gdb-upstream.patch @@ -1293,3 +1293,51 @@ http://sourceware.org/ml/gdb-cvs/2013-05/msg00063.html gdb_test_no_output "set breakpoint pending off" \ "disable pending breakpoints for linespec tests" + + + +https://bugzilla.redhat.com/show_bug.cgi?id=967915 +http://sourceware.org/ml/gdb-cvs/2013-05/msg00146.html + +### src/gdb/ChangeLog 2013/05/17 18:09:05 1.15569 +### src/gdb/ChangeLog 2013/05/17 23:05:00 1.15570 +## -1,3 +1,9 @@ ++2013-05-17 Edjunior Machado ++ ++ * ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Check if the ++ region is ok for a hardware watchpoint using the new ptrace interface ++ on Power servers. ++ + 2013-05-17 Doug Evans + + * NEWS: Mention new maintenance commands check-symtabs, and +--- src/gdb/ppc-linux-nat.c 2013/05/07 07:43:33 1.119 ++++ src/gdb/ppc-linux-nat.c 2013/05/17 23:05:00 1.120 +@@ -1503,16 +1503,19 @@ + to determine the hardcoded watchable region for watchpoints. */ + if (have_ptrace_booke_interface ()) + { +- /* DAC-based processors (i.e., embedded processors), like the PowerPC 440 +- have ranged watchpoints and can watch any access within an arbitrary +- memory region. This is useful to watch arrays and structs, for +- instance. It takes two hardware watchpoints though. */ ++ /* Embedded DAC-based processors, like the PowerPC 440 have ranged ++ watchpoints and can watch any access within an arbitrary memory ++ region. This is useful to watch arrays and structs, for instance. It ++ takes two hardware watchpoints though. */ + if (len > 1 +- && booke_debug_info.features & PPC_DEBUG_FEATURE_DATA_BP_RANGE) ++ && booke_debug_info.features & PPC_DEBUG_FEATURE_DATA_BP_RANGE ++ && ppc_linux_get_hwcap () & PPC_FEATURE_BOOKE) + return 2; +- else if (booke_debug_info.data_bp_alignment +- && (addr + len > (addr & ~(booke_debug_info.data_bp_alignment - 1)) +- + booke_debug_info.data_bp_alignment)) ++ /* Server processors provide one hardware watchpoint and addr+len should ++ fall in the watchable region provided by the ptrace interface. */ ++ if (booke_debug_info.data_bp_alignment ++ && (addr + len > (addr & ~(booke_debug_info.data_bp_alignment - 1)) ++ + booke_debug_info.data_bp_alignment)) + return 0; + } + /* addr+len must fall in the 8 byte watchable region for DABR-based diff --git a/gdb.spec b/gdb.spec index 8aada04..8a1d388 100644 --- a/gdb.spec +++ b/gdb.spec @@ -36,7 +36,7 @@ Version: 7.6 # 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: 30%{?dist} +Release: 31%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -1402,6 +1402,9 @@ fi %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %changelog +* Tue May 28 2013 Jan Kratochvil - 7.6-31.fc19 +- [ppc] Backport hardware watchpoints fix (Edjunior Machado, BZ 967915). + * Tue May 21 2013 Jan Kratochvil - 7.6-30.fc19 - Backported Python frame filters (Phil Muldoon). - Backported breakpoint conditions crash fix (Sergio Durigan Junior).