diff options
author | Kevin Buettner <kevinb@redhat.com> | 2021-02-24 11:48:04 -0700 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2021-02-24 12:54:39 -0700 |
commit | 665af52ec2a52184d39a76d6e724fa4733dbab3c (patch) | |
tree | 745f408721c19b68c6d02611237843934decc1f8 /gdb | |
parent | dd80d75040a291400c0fddb0f8b05c3f40da49ff (diff) | |
download | gdb-665af52ec2a52184d39a76d6e724fa4733dbab3c.zip gdb-665af52ec2a52184d39a76d6e724fa4733dbab3c.tar.gz gdb-665af52ec2a52184d39a76d6e724fa4733dbab3c.tar.bz2 |
Fix aarch64-linux-hw-point.c build problem
Due to a recent glibc header file change, the file
nat/aarch64-linux-hw-point.c no longer builds on Fedora rawhide.
An enum for PTRACE_SYSEMU is now provided by <sys/ptrace.h>. In the
past, PTRACE_SYSEMU was defined only in <asm/ptrace.h>. This is
what it looks like...
In <asm/ptrace.h>:
#define PTRACE_SYSEMU 31
In <sys/ptrace.h>:
enum __ptrace_request
{
...
PTRACE_SYSEMU = 31,
#define PT_SYSEMU PTRACE_SYSEMU
...
}
When <asm/ptrace.h> and <sys/ptrace.h> are both included in a source
file, we run into the following build problem when the former is
included before the latter:
In file included from nat/aarch64-linux-hw-point.c:26:
/usr/include/sys/ptrace.h:86:3: error: expected identifier before numeric constant
86 | PTRACE_SYSEMU = 31,
| ^~~~~~~~~~~~~
(There are more errors after this one too.)
The file builds without error when <asm/ptrace.h> is included after
<sys/ptrace.h>. I found that this is already done in
nat/aarch64-sve-linux-ptrace.h (which is included by
nat/aarch64-linux-ptrace.c).
I've tested this change on Fedora rawhide and Fedora 33, both
running on an aarch64 machine.
gdb/ChangeLog:
* nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after
<sys/ptrace.h>.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/nat/aarch64-linux-hw-point.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 00a71fe..f705242 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2021-02-24 Kevin Buettner <kevinb@redhat.com> + + * nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after + <sys/ptrace.h>. + 2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com> * exec.c (set_section_command): Move variable declarations into diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c index 73e4edd..0278ac2 100644 --- a/gdb/nat/aarch64-linux-hw-point.c +++ b/gdb/nat/aarch64-linux-hw-point.c @@ -23,8 +23,8 @@ #include "aarch64-linux-hw-point.h" #include <sys/uio.h> -#include <asm/ptrace.h> #include <sys/ptrace.h> +#include <asm/ptrace.h> #include <elf.h> /* Number of hardware breakpoints/watchpoints the target supports. |