]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
GDB: aarch64-linux: Implement GCS support in displaced stepping
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 2 May 2025 00:36:18 +0000 (21:36 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 29 Aug 2025 21:35:58 +0000 (18:35 -0300)
commit7353e5f9d72468e484b083ccd2b4840ed2b7f125
tree7dc9306f31a8e467be25a1780020d68dcbcc6d50
parenta5ae00c47eb678462c5d2ed9c3b31fc59bb4ba45
GDB: aarch64-linux: Implement GCS support in displaced stepping

When doing displaced step on a branch and link instruction with the Guarded
Control Stack enabled, it's necessary to manually push and pop the GCS
entry for the function call since GDB writes a simple branch instruction
rather than a branch and link instruction in the displaced step buffer.

The testcase exercises GCS with displaced stepping by putting the
breakpoint on the bl instruction to force GDB to copy it to the
displaced stepping buffer.  In this situation GDB needs to manually
manage the Guarded Control Stack.

Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
Approved-By: Luis Machado <luis.machado@arm.com>
gdb/aarch64-linux-tdep.c
gdb/aarch64-tdep.c
gdb/linux-tdep.h
gdb/testsuite/gdb.arch/aarch64-gcs-disp-step.c [new file with mode: 0644]
gdb/testsuite/gdb.arch/aarch64-gcs-disp-step.exp [new file with mode: 0644]