Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 38fad3e5ab3b45c56810abd35fa11a72fa10b8f1 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 0011132 | 2018-04-01 22:23:53 -0400 | [diff] [blame] | 2 | From: Pratyush Anand <panand@redhat.com> |
| 3 | Date: Wed, 22 Mar 2017 17:02:38 +0530 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 4 | Subject: [PATCH] bits/siginfo-consts.h: enum definition for TRAP_HWBKPT is |
| 5 | missing |
Brad Bishop | 0011132 | 2018-04-01 22:23:53 -0400 | [diff] [blame] | 6 | MIME-Version: 1.0 |
| 7 | Content-Type: text/plain; charset=UTF-8 |
| 8 | Content-Transfer-Encoding: 8bit |
| 9 | |
| 10 | Compile following linux kernel test code with latest glibc: |
| 11 | |
| 12 | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c |
| 13 | |
| 14 | and we get following error: |
| 15 | breakpoint_test_arm64.c: In function ‘run_test’: |
| 16 | breakpoint_test_arm64.c:171:25: error: ‘TRAP_HWBKPT’ undeclared (first use in this function) |
| 17 | if (siginfo.si_code != TRAP_HWBKPT) { |
| 18 | ^ |
| 19 | I can compile test code by modifying my local |
| 20 | /usr/include/bits/siginfo.h and test works great. Therefore, this patch |
| 21 | will be needed in upstream glibc so that issue is fixed there as well. |
| 22 | |
| 23 | Signed-off-by: Pratyush Anand <panand@redhat.com> |
| 24 | |
| 25 | Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=21286] |
| 26 | --- |
| 27 | bits/siginfo-consts.h | 6 +++++- |
| 28 | sysdeps/unix/sysv/linux/bits/siginfo-consts.h | 6 +++++- |
| 29 | 2 files changed, 10 insertions(+), 2 deletions(-) |
| 30 | |
| 31 | diff --git a/bits/siginfo-consts.h b/bits/siginfo-consts.h |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 32 | index 7464c1882b..298314527a 100644 |
Brad Bishop | 0011132 | 2018-04-01 22:23:53 -0400 | [diff] [blame] | 33 | --- a/bits/siginfo-consts.h |
| 34 | +++ b/bits/siginfo-consts.h |
| 35 | @@ -106,8 +106,12 @@ enum |
| 36 | { |
| 37 | TRAP_BRKPT = 1, /* Process breakpoint. */ |
| 38 | # define TRAP_BRKPT TRAP_BRKPT |
| 39 | - TRAP_TRACE /* Process trace trap. */ |
| 40 | + TRAP_TRACE, /* Process trace trap. */ |
| 41 | # define TRAP_TRACE TRAP_TRACE |
| 42 | + TRAP_BRANCH, /* Process branch trap. */ |
| 43 | +# define TRAP_BRANCH TRAP_BRANCH |
| 44 | + TRAP_HWBKPT /* hardware breakpoint/watchpoint */ |
| 45 | +# define TRAP_HWBKPT TRAP_HWBKPT |
| 46 | }; |
| 47 | # endif |
| 48 | |
| 49 | diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 50 | index 193bd9c471..3fe852bc5f 100644 |
Brad Bishop | 0011132 | 2018-04-01 22:23:53 -0400 | [diff] [blame] | 51 | --- a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h |
| 52 | +++ b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 53 | @@ -141,8 +141,12 @@ enum |
Brad Bishop | 0011132 | 2018-04-01 22:23:53 -0400 | [diff] [blame] | 54 | { |
| 55 | TRAP_BRKPT = 1, /* Process breakpoint. */ |
| 56 | # define TRAP_BRKPT TRAP_BRKPT |
| 57 | - TRAP_TRACE /* Process trace trap. */ |
| 58 | + TRAP_TRACE, /* Process trace trap. */ |
| 59 | # define TRAP_TRACE TRAP_TRACE |
| 60 | + TRAP_BRANCH, /* Process branch trap. */ |
| 61 | +# define TRAP_BRANCH TRAP_BRANCH |
| 62 | + TRAP_HWBKPT /* hardware breakpoint/watchpoint */ |
| 63 | +# define TRAP_HWBKPT TRAP_HWBKPT |
| 64 | }; |
| 65 | # endif |
| 66 | |