RE: [PATCH v4 10/11] gdb, gdbarch: Introduce gdbarch method to get the shadow stack pointer.

Schimpe, Christina
2025-06-20T13:00:45Z

Hi Tom,

> -----Original Message-----
> From: Tom Tromey <tom@tromey.com>
> Sent: Tuesday, June 17, 2025 8:16 PM
> To: Schimpe, Christina <christina.schimpe@intel.com>
> Cc: gdb-patches@sourceware.org; thiago.bauermann@linaro.org;
> eliz@gnu.org
> Subject: Re: [PATCH v4 10/11] gdb, gdbarch: Introduce gdbarch method to get
> the shadow stack pointer.
>
> >>>>> "Christina" == Christina Schimpe <christina.schimpe@intel.com>
> writes:
>
> Christina> +Method(
> Christina> + comment="""
> Christina> +If possible, return the shadow stack pointer. On some
> Christina> +architectures, the shadow stack pointer is available even if
> Christina> +the feature is disabled. To return the shadow stack enablement
> state configure SHADOW_STACK_ENABLED.
> Christina> +""",
>
> This wasn't super clear to me, but reading patch 11 made me believe that the
> API is to set shadow_stack_enabled to true if shadow stacks are enabled. Is
> that correct? If so could you update the comment to say that?

Yes, this is correct. I'd update it as follows, to make it more clear hopefully:

"If possible, return the shadow stack pointer. On some architectures, the
shadow stack pointer is available even if the feature is disabled. To
return the feature's enablement state configure SHADOW_STACK_ENABLED.
Set it to true in case the shadow stack is enabled."

Thanks!
Christina
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928