From 8da52f9fa56d562bd23c058982fac35c1255d3f9d100af523ff4a599d784f61e Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Wed, 9 Dec 2020 13:29:01 +0000 Subject: [PATCH] Accepting request 854204 from home:tomdevries:branches:devel:gcc-gdb-sle-15-changes - Backport from master [jsc#13656]: * gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch - Require 8GB diskspace for x86_64. OBS-URL: https://build.opensuse.org/request/show/854204 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=267 --- _constraints | 10 +++ ...egion-limit-if-2nd-dawr-is-avaliable.patch | 72 +++++++++++++++++++ gdb.changes | 7 ++ gdb.spec | 2 + 4 files changed, 91 insertions(+) create mode 100644 gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch diff --git a/_constraints b/_constraints index 5e7b8fb..9afb8f7 100644 --- a/_constraints +++ b/_constraints @@ -10,5 +10,15 @@ + + + x86_64 + + + + 8 + + + diff --git a/gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch b/gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch new file mode 100644 index 0000000..c17fb3b --- /dev/null +++ b/gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch @@ -0,0 +1,72 @@ +PowerPC remove 512 bytes region limit if 2nd DAWR is avaliable. + +Power 10 introduces the 2nd DAWR (second watchpoint) and also removed +a restriction that limit the watch region to 512 bytes. + +2020-11-08 Rogerio A. Cardoso + +/gdb + + * ppc-linux-nat.c: (PPC_DEBUG_FEATURE_DATA_BP_ARCH_31): New define. + (region_ok_for_hw_watchpoint): Check if 2nd DAWR is avaliable before + set region. + +--- + gdb/ppc-linux-nat.c | 26 ++++++++++++++++++-------- + 2 files changed, 23 insertions(+), 8 deletions(-) + +Index: gdb-10.1/gdb/ppc-linux-nat.c +=================================================================== +--- gdb-10.1.orig/gdb/ppc-linux-nat.c ++++ gdb-10.1/gdb/ppc-linux-nat.c +@@ -138,6 +138,11 @@ struct ppc_hw_breakpoint + #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 + #endif /* PPC_DEBUG_FEATURE_DATA_BP_DAWR */ + ++/* Feature defined on Linux kernel v5.1: Second watchpoint support. */ ++#ifndef PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 ++#define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x20 ++#endif /* PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 */ ++ + /* The version of the PowerPC HWDEBUG kernel interface that we will use, if + available. */ + #define PPC_DEBUG_CURRENT_VERSION 1 +@@ -2108,9 +2113,10 @@ ppc_linux_nat_target::region_ok_for_hw_w + watchpoints. */ + if (m_dreg_interface.hwdebug_p ()) + { +- int region_size; + const struct ppc_debug_info &hwdebug_info = (m_dreg_interface + .hwdebug_info ()); ++ int region_size = hwdebug_info.data_bp_alignment; ++ int region_align = region_size; + + /* Embedded DAC-based processors, like the PowerPC 440 have ranged + watchpoints and can watch any access within an arbitrary memory +@@ -2122,15 +2128,19 @@ ppc_linux_nat_target::region_ok_for_hw_w + return 2; + /* Check if the processor provides DAWR interface. */ + if (hwdebug_info.features & PPC_DEBUG_FEATURE_DATA_BP_DAWR) +- /* DAWR interface allows to watch up to 512 byte wide ranges which +- can't cross a 512 byte boundary. */ +- region_size = 512; +- else +- region_size = hwdebug_info.data_bp_alignment; ++ { ++ /* DAWR interface allows to watch up to 512 byte wide ranges. */ ++ region_size = 512; ++ /* DAWR interface allows to watch up to 512 byte wide ranges which ++ can't cross a 512 byte bondary on machines that doesn't have a ++ second DAWR (P9 or less). */ ++ if (!(hwdebug_info.features & PPC_DEBUG_FEATURE_DATA_BP_ARCH_31)) ++ region_align = 512; ++ } + /* Server processors provide one hardware watchpoint and addr+len should + fall in the watchable region provided by the ptrace interface. */ +- if (region_size +- && (addr + len > (addr & ~(region_size - 1)) + region_size)) ++ if (region_align ++ && (addr + len > (addr & ~(region_align - 1)) + region_size)) + return 0; + } + /* addr+len must fall in the 8 byte watchable region for DABR-based diff --git a/gdb.changes b/gdb.changes index a61c624..0fd0a0c 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Dec 9 07:56:36 UTC 2020 - Tom de Vries + +- Backport from master [jsc#13656]: + * gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch +- Require 8GB diskspace for x86_64. + ------------------------------------------------------------------- Mon Nov 30 15:43:58 UTC 2020 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 6c6f8f7..9f59764 100644 --- a/gdb.spec +++ b/gdb.spec @@ -307,6 +307,7 @@ Patch2006: gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch Patch2007: gdb-fix-section-matching-in-find_pc_sect_compunit.patch Patch2008: gdb-symtab-fix-language-of-frame-without-debug-info.patch Patch2009: gdb-testsuite-fix-failure-in-gdb-base-step-over-no-symbols-exp.patch +Patch2010: gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch # Testsuite patches @@ -714,6 +715,7 @@ find -name "*.info*"|xargs rm -f %patch2007 -p1 %patch2008 -p1 %patch2009 -p1 +%patch2010 -p1 %patch2500 -p1 %if 0%{?suse_version} > 1500