From 4b09c8bbbaf09a1f7b72146be34398d2f8eafbb45c9609885da80536d9c51019 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Wed, 3 Aug 2016 14:40:18 +0000 Subject: [PATCH 1/5] - Add gdb-aarch64-v81-hwbreakpoints.diff for detecting debug capabilities on ARMv8.1/8.2. [bnc#990697] OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=144 --- gdb-aarch64-v81-hwbreakpoints.diff | 65 ++++++++++++++++++++++++++++++ gdb.changes | 6 +++ gdb.spec | 2 + 3 files changed, 73 insertions(+) create mode 100644 gdb-aarch64-v81-hwbreakpoints.diff diff --git a/gdb-aarch64-v81-hwbreakpoints.diff b/gdb-aarch64-v81-hwbreakpoints.diff new file mode 100644 index 0000000..f4d8c85 --- /dev/null +++ b/gdb-aarch64-v81-hwbreakpoints.diff @@ -0,0 +1,65 @@ +From: Andrew Pinski +Date: Sat, 23 Jul 2016 16:56:44 +0000 (-0700) +Subject: Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint +X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=49ecef2a7da2ee9df4ae675f99b70518fbf1bb23 + +Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint + +The problem here is ARMv8.1 (and ARMv8.2) define a +different debug version than ARMv8 (7 and 8 respectively). +This fixes hw watchpoints and breakpoints by checking +for those debug versions too. + +Committed as obvious after a test on aarch64-linux-gnu +(on a ThunderX machine which has ARMv8.1 support enabled). + +ChangeLog: + * nat/aarch64-linux-hw-point.c + (aarch64_linux_get_debug_reg_capacity): Handle + ARMv8.1 and ARMv8.2 debug versions. + * nat/aarch64-linux-hw-point.h + (AARCH64_DEBUG_ARCH_V8_1): New define. + (AARCH64_DEBUG_ARCH_V8_2): New define. + +Signed-off-by: Andrew Pinski +--- + +diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c +index a06a6e6..f9e04d9 100644 +--- a/gdb/nat/aarch64-linux-hw-point.c ++++ b/gdb/nat/aarch64-linux-hw-point.c +@@ -630,7 +630,9 @@ aarch64_linux_get_debug_reg_capacity (int tid) + + /* Get hardware watchpoint register info. */ + if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_WATCH, &iov) == 0 +- && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8) ++ && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8 ++ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1 ++ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2)) + { + aarch64_num_wp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info); + if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM) +@@ -650,7 +652,9 @@ aarch64_linux_get_debug_reg_capacity (int tid) + + /* Get hardware breakpoint register info. */ + if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_BREAK, &iov) == 0 +- && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8) ++ && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8 ++ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1 ++ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2)) + { + aarch64_num_bp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info); + if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM) +diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h +index acf0a49..16efb7c 100644 +--- a/gdb/nat/aarch64-linux-hw-point.h ++++ b/gdb/nat/aarch64-linux-hw-point.h +@@ -68,6 +68,8 @@ + + /* Macro for the expected version of the ARMv8-A debug architecture. */ + #define AARCH64_DEBUG_ARCH_V8 0x6 ++#define AARCH64_DEBUG_ARCH_V8_1 0x7 ++#define AARCH64_DEBUG_ARCH_V8_2 0x8 + + /* ptrace expects control registers to be formatted as follows: + diff --git a/gdb.changes b/gdb.changes index 5be4cd7..bb5f8c6 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 3 14:38:49 UTC 2016 - matz@suse.com + +- Add gdb-aarch64-v81-hwbreakpoints.diff for detecting + debug capabilities on ARMv8.1/8.2. [bnc#990697] + ------------------------------------------------------------------- Mon Jun 20 16:36:04 UTC 2016 - matz@suse.com diff --git a/gdb.spec b/gdb.spec index bd93087..120ac03 100644 --- a/gdb.spec +++ b/gdb.spec @@ -221,6 +221,7 @@ Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch Patch1003: gdb-pahole-python2.patch Patch1004: gdb-fix-buf-overflow.diff Patch1005: gdb-7.10-swo18929.patch +Patch1006: gdb-aarch64-v81-hwbreakpoints.diff BuildRequires: bison BuildRequires: flex @@ -492,6 +493,7 @@ find -name "*.info*"|xargs rm -f %patch1003 -p1 %patch1004 -p1 %patch1005 -p1 +%patch1006 -p1 find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen. From 3493ea298955cafaae3263828ace9f191675d526ca5b4d4735a931ebd9175599 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 8 Aug 2016 15:36:33 +0000 Subject: [PATCH 2/5] - Amend gdb-glibc-vdso-workaround.patch to ignore further vdso filenames on ppc64 and s390x. [bnc#944105] OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=145 --- gdb-glibc-vdso-workaround.patch | 10 ++++++---- gdb.changes | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gdb-glibc-vdso-workaround.patch b/gdb-glibc-vdso-workaround.patch index c503d63..3d1407f 100644 --- a/gdb-glibc-vdso-workaround.patch +++ b/gdb-glibc-vdso-workaround.patch @@ -11,11 +11,11 @@ gdb/ Work around PR libc/13097. * solib.c (update_solib_list): Ignore "linux-vdso.so.1". -Index: gdb-7.9.50.20150520/gdb/solib.c +Index: gdb-7.11.1/gdb/solib.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/solib.c 2015-05-31 17:04:16.870802493 +0200 -+++ gdb-7.9.50.20150520/gdb/solib.c 2015-05-31 17:04:38.824941054 +0200 -@@ -893,8 +893,11 @@ update_solib_list (int from_tty, struct +--- gdb-7.11.1.orig/gdb/solib.c 2016-02-10 04:19:39.000000000 +0100 ++++ gdb-7.11.1/gdb/solib.c 2016-08-08 17:34:35.000000000 +0200 +@@ -891,8 +891,13 @@ update_solib_list (int from_tty, struct TRY { @@ -25,6 +25,8 @@ Index: gdb-7.9.50.20150520/gdb/solib.c + Work around PR libc/13097. */ + if (!solib_map_sections (i) + && strcmp (i->so_original_name, "linux-vdso.so.1") != 0 ++ && strcmp (i->so_original_name, "linux-vdso32.so.1") != 0 ++ && strcmp (i->so_original_name, "linux-vdso64.so.1") != 0 + && strcmp (i->so_original_name, "linux-gate.so.1") != 0) { not_found++; diff --git a/gdb.changes b/gdb.changes index bb5f8c6..f70bda1 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 8 15:34:57 UTC 2016 - matz@suse.com + +- Amend gdb-glibc-vdso-workaround.patch to ignore further + vdso filenames on ppc64 and s390x. [bnc#944105] + ------------------------------------------------------------------- Wed Aug 3 14:38:49 UTC 2016 - matz@suse.com From 35e09cb6e471b719537b5c8c02957cff14898504da622e8250eb4557170a01e9 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 22 Nov 2016 08:16:32 +0000 Subject: [PATCH 3/5] Accepting request 441241 from home:Andreas_Schwab:Factory - BuildRequire glibc-devel-static for 12.1 or later, and glibc-devel-static-32bit if biarch OBS-URL: https://build.opensuse.org/request/show/441241 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=146 --- gdb.changes | 6 ++++++ gdb.spec | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gdb.changes b/gdb.changes index f70bda1..969929c 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 21 11:17:58 UTC 2016 - schwab@suse.de + +- BuildRequire glibc-devel-static for 12.1 or later, and + glibc-devel-static-32bit if biarch + ------------------------------------------------------------------- Mon Aug 8 15:34:57 UTC 2016 - matz@suse.com diff --git a/gdb.spec b/gdb.spec index 120ac03..d095d61 100644 --- a/gdb.spec +++ b/gdb.spec @@ -292,8 +292,14 @@ BuildRequires: gcc-ada BuildRequires: gcc-ada-32bit %endif BuildRequires: gcc-c++-32bit +%if 0%{suse_version} >= 1210 +BuildRequires: glibc-devel-static-32bit %endif %endif +%endif +%if 0%{suse_version} >= 1210 +BuildRequires: glibc-devel-static +%endif %endif # 0%{?_with_testsuite:1} From 5ab305852f60fabf6f31b58b04212994a1f483113c0d940f9e4304e965d64716 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 5 Dec 2016 13:17:45 +0000 Subject: [PATCH 4/5] Accepting request 443685 from home:Andreas_Schwab:Factory - Enable ada testing on aarch64 for tumbleweed OBS-URL: https://build.opensuse.org/request/show/443685 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=147 --- gdb.changes | 5 +++++ gdb.spec | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gdb.changes b/gdb.changes index 969929c..e5fad14 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Dec 3 10:27:31 UTC 2016 - schwab@suse.de + +- Enable ada testing on aarch64 for tumbleweed + ------------------------------------------------------------------- Mon Nov 21 11:17:58 UTC 2016 - schwab@suse.de diff --git a/gdb.spec b/gdb.spec index d095d61..5dc872b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -284,6 +284,11 @@ BuildRequires: gcc-objc %ifarch %{ix86} x86_64 ia64 ppc ppc64 s390 alpha BuildRequires: gcc-ada %endif +%ifarch aarch64 +%if 0%{suse_version} >= 1330 +BuildRequires: gcc-ada +%endif +%endif %if 0%{suse_version} > 1110 %ifarch x86_64 ppc64 s390x %if 0%{suse_version} >= 1330 From 7f4874791e866138a95913e16cfd728d06d06fa131589b8849b5bf96d390dcd4 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 16 Dec 2016 12:54:07 +0000 Subject: [PATCH 5/5] Accepting request 446680 from home:marxin:branches:devel:gcc OBS-URL: https://build.opensuse.org/request/show/446680 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=148 --- gdb.changes | 5 +++++ gdb.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gdb.changes b/gdb.changes index e5fad14..a42651f 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Dec 16 09:55:50 UTC 2016 - mliska@suse.cz + +- Make dependency of gcc-java conditional. + ------------------------------------------------------------------- Sat Dec 3 10:27:31 UTC 2016 - schwab@suse.de diff --git a/gdb.spec b/gdb.spec index 5dc872b..0bafbeb 100644 --- a/gdb.spec +++ b/gdb.spec @@ -278,7 +278,9 @@ BuildRequires: sharutils BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gcc-fortran +%if 0%{?gcc_version} < 7 BuildRequires: gcc-java +%endif BuildRequires: gcc-objc # Copied from gcc-4.1.2-32. %ifarch %{ix86} x86_64 ia64 ppc ppc64 s390 alpha