diff options
author | Thiago Jung Bauermann <thiago.bauermann@linaro.org> | 2025-05-01 18:12:19 -0300 |
---|---|---|
committer | Thiago Jung Bauermann <thiago.bauermann@linaro.org> | 2025-08-29 18:35:58 -0300 |
commit | ff62d39aa4999f44ac79360dee6357fc69d4e322 (patch) | |
tree | 70213c3c357a5e93fa6ce54837100045306aa70e /gdb/make-init-c | |
parent | 02ecff0c714254cd5a67b55a6d11d62cfd904dbc (diff) | |
download | binutils-ff62d39aa4999f44ac79360dee6357fc69d4e322.zip binutils-ff62d39aa4999f44ac79360dee6357fc69d4e322.tar.gz binutils-ff62d39aa4999f44ac79360dee6357fc69d4e322.tar.bz2 |
GDB, gdbserver: aarch64-linux: Initial Guarded Control Stack support
Add the org.gnu.gdb.aarch64.gcs feature with the GCSPR register, and the
org.gnu.gdb.aarch64.gcs.linux feature with "registers" to represent the
Linux kernel ptrace and prctl knobs that enable and lock specific GCS
functionality.
This code supports GCS only in Linux userspace applications, so the
GCSPR that is exposed is the one at EL0.
Also, support for calling inferior functions is enabled by adding an
implementation for the shadow_stack_push gdbarch method.
If for some reason a target description contains the
org.gnu.gdb.aarch64.gcs feature but not the
org.gnu.gdb.aarch64.gcs.linux feature then GCS support is disabled and
GDB continues the debugging session. Features that need GCS
support (for example, calling inferior functions) will not work and the
inferior will get a segmentation fault signal instead. There's a
testcase for this scenario but it only checks the native debugging case,
even though in practice this problem would only occur in remote
debugging with a broken stub or gdbserver. I tested manually with a
gdbserver hacked to send a broken target description and it worked as
described.
Testcases gdb.arch/aarch64-gcs.exp, gdb.arch/aarch64-gcs-core.exp and
gdb.arch/aarch64-gcs-wrong-tdesc.exp are included to cover the added
functionality.
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
Approved-By: Luis Machado <luis.machado@arm.com>
Diffstat (limited to 'gdb/make-init-c')
0 files changed, 0 insertions, 0 deletions