aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2021-02-25 15:25:49 -0700
committerKevin Buettner <kevinb@redhat.com>2021-02-25 15:30:32 -0700
commit0f977b7715ee9aa8959e08c00b6d2c47a40e6504 (patch)
tree5953ad38020c8ea15dab897b52f2b7f9e310dc07 /gdb
parentdffdd8b51f3fb086faf750592709baa8faa66fd1 (diff)
downloadbinutils-0f977b7715ee9aa8959e08c00b6d2c47a40e6504.zip
binutils-0f977b7715ee9aa8959e08c00b6d2c47a40e6504.tar.gz
binutils-0f977b7715ee9aa8959e08c00b6d2c47a40e6504.tar.bz2
Add comment regarding include order of <sys/ptrace.h> and <asm/ptrace.h>
I added the same comment for nat/aarch64-linux-hw-point.c yesterday. Christian suggested adding the comment for the other file that I had identified as including both <sys/ptrace.h> and <asm/ptrace.h>. I searched the sources in gdb/, but found no other files which include both of these headers. If possible, I would prefer to see us use <sys/ptrace.h> when possible, however, from past experience, I've found that this file does not always contain all of the constants, etc. required by the particular source file. gdb/ChangeLog: * nat/aarch64-sve-linux-ptrace.h: Add comment regarding include order for <sys/ptrace.h> and <asm/ptrace.h>.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/nat/aarch64-sve-linux-ptrace.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 842dc0a..7e0b00c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-02-24 Kevin Buettner <kevinb@redhat.com>
+
+ * nat/aarch64-sve-linux-ptrace.h: Add comment regarding
+ include order for <sys/ptrace.h> and <asm/ptrace.h>.
+
2021-02-25 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/26861
diff --git a/gdb/nat/aarch64-sve-linux-ptrace.h b/gdb/nat/aarch64-sve-linux-ptrace.h
index 0668402..be00f30 100644
--- a/gdb/nat/aarch64-sve-linux-ptrace.h
+++ b/gdb/nat/aarch64-sve-linux-ptrace.h
@@ -22,6 +22,12 @@
#include <signal.h>
#include <sys/utsname.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 <asm/ptrace.h>