Add comment regarding include order of <sys/ptrace.h> and <asm/ptrace.h>

gdb/ChangeLog:

	* nat/aarch64-linux-hw-point.c: Add comment regarding include
	order for <sys/ptrace.h> and <asm/ptrace.h>.
This commit is contained in:
Kevin Buettner 2021-02-24 14:35:07 -07:00
parent 665af52ec2
commit 268c77c1b0
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2021-02-24 Kevin Buettner <kevinb@redhat.com>
* nat/aarch64-linux-hw-point.c: Add comment regarding include
order for <sys/ptrace.h> and <asm/ptrace.h>.
2021-02-24 Kevin Buettner <kevinb@redhat.com> 2021-02-24 Kevin Buettner <kevinb@redhat.com>
* nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after * nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after

View File

@ -23,8 +23,15 @@
#include "aarch64-linux-hw-point.h" #include "aarch64-linux-hw-point.h"
#include <sys/uio.h> #include <sys/uio.h>
/* The order in which <sys/ptrace.h> and <asm/ptrace.h> are included
can be important. <sys/ptrace.h> often declares various PTRACE_*
enums. <asm/ptrace.h> often defines preprocessor constants for
these very same symbols. When that's the case, build errors will
result when <asm/ptrace.h> is included before <sys/ptrace.h>. */
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <elf.h> #include <elf.h>
/* Number of hardware breakpoints/watchpoints the target supports. /* Number of hardware breakpoints/watchpoints the target supports.