Re: [PATCH v5 06/12] gdb, gdbserver: Add support of Intel shadow stack pointer register.

Andrew Burgess
2025-07-29T13:52:16Z

Christina Schimpe <christina.schimpe@intel.com> writes:

> diff --git a/gdb/x86-tdep.c b/gdb/x86-tdep.c
> index 6646b1157c8..06dec4e1f90 100644
> --- a/gdb/x86-tdep.c
> +++ b/gdb/x86-tdep.c
> @@ -17,10 +17,31 @@
> You should have received a copy of the GNU General Public License
> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> +#include "i386-tdep.h"
> #include "x86-tdep.h"
> #include "symtab.h"
>
>
> +/* See x86-tdep.h. */
> +
> +void
> +x86_supply_ssp (regcache *regcache, const uint64_t ssp)
> +{
> + i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (regcache->arch ());
> + gdb_assert (tdep != nullptr && tdep->ssp_regnum > 0);
> + regcache->raw_supply (tdep->ssp_regnum, &ssp);
> +}
> +
> +/* See x86-tdep.h. */
> +
> +void
> +x86_collect_ssp (const regcache *regcache, uint64_t& ssp)

While reviewing the next patch, I spotted a white space issue here, it
should be 'uint64_t &ssp'. And the same in the declaration too.

Thanks,
Andrew