Re: [PATCH v1] gdb/linux: add helpers to read AT_HWCAP3 and AT_HWCAP4

Simon Marchi <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
On 7/27/26 1:28 PM, Matthieu Longo wrote:
> Add linux_get_hwcap3 and linux_get_hwcap4 helpers to GDB and gdbserver,
> mirroring the existing linux_get_hwcap and linux_get_hwcap2 interfaces.
> 
> The new helpers retrieve the AT_HWCAP3 and AT_HWCAP4 auxiliary vector
> entry either from explicitly supplied auxv data or from the current
> inferior.
> 
> This prepares for future features that depend on HWCAP3 and HWCAP4
> capability bits.
> 
> Reviewed-by: Thiago Jung Bauermann <[email protected]>

LGTM

Approved-By: Simon Marchi <[email protected]>

But one question that picked my curiosity:

> diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
> index f1be62225e2..c4daba0bf40 100644
> --- a/gdbserver/linux-low.cc
> +++ b/gdbserver/linux-low.cc
> @@ -70,6 +70,14 @@
>  #define AT_HWCAP2 26
>  #endif
>  
> +#ifndef AT_HWCAP3
> +#define AT_HWCAP3 29
> +#endif
> +
> +#ifndef AT_HWCAP4
> +#define AT_HWCAP4 30
> +#endif

How come we need to provide these values in gdbserver, but not in the
equivalent native part of gdb?

Simon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.