GDB: aarch64-linux: Reorganize GCS-related definitions
Only native code should use struct user_gcs, so its definition should be
in a native-specific file and not in a file under gdb/arch/.
To fix this problem, create gdb/nat/aarch64-gcs-linux.h and move the
struct user_gcs definition to it, as suggested by Luis.
To fix the use of struct user_gcs in gdb/aarch64-linuxt-dep.c, define a
macro with the size of the GCS regset in gdb/arch/aarch64-gcs-linux.h
and use it in aarch64-linux-tdep.c, as is done for other regsets and
following a suggestion from Simon Marchi.
Also, move the HWCAP_GCS definition to gdb/nat/aarch64-gcs-linux.h and
create an AARCH64_HWCAP_GCS definition in gdb/arch/aarch64-gcs-linux.h
for use by target-dependent code.
Similarly, move the SEGV_CPERR and PR_SHADOW_STACK_{ENABLE,WRITE,PUSH}
definitions, which were added by the GCS patches and are only used by
aarch64-linux target-dependent code, to gdb/arch/aarch64-gcs-linux.h
with an AARCH64_ prefix and adjust users.
Finally, I noticed that gdb/aarch64-linux-nat.c and
gdbserver/linux-aarch64-low.cc don't need anything from the
arch/aarch64-gcs-linux.h header, so make them not include it.
Suggested-by: Luis <luis.machado.foss@gmail.com>
Suggested-by: Simon Marchi <simark@simark.ca>
Approved-By: Luis Machado <luis.machado.foss@gmail.com>
7 files changed