Re: [PATCH v7 05/18] [gdb/aarch64] sme: Enable SME registers and pseudo-registers

Tom Tromey
2023-10-13T13:06:27Z

>>>>> "Luis" == Luis Machado via Gdb-patches <gdb-patches@sourceware.org> writes:

Hi Luis.

This patch caused a gdbserver build failure on aarch64-linux.

In file included from ../../src/gdbserver/../gdb/nat/aarch64-scalable-linux-ptrace.h:36,
from ../../src/gdbserver/linux-aarch64-low.cc:48:
../../src/gdbserver/linux-aarch64-low.cc: In function 'void aarch64_adjust_register_sets(const aarch64_features&)':
../../src/gdbserver/../gdb/nat/aarch64-scalable-linux-sigcontext.h:304:45: error: '__SVE_VQ_BYTES' was not declared in this scope; did you mean 'SVE_VQ_BYTES'?
304 | ((sizeof (struct user_za_header) + (__SVE_VQ_BYTES - 1)) \
| ^~~~~~~~~~~~~~
../../src/gdbserver/../gdb/nat/aarch64-scalable-linux-sigcontext.h:325:10: note: in expansion of macro 'ZA_PT_ZA_OFFSET'
325 | (ZA_PT_ZA_OFFSET + ZA_PT_ZA_SIZE(vq))
| ^~~~~~~~~~~~~~~
../../src/gdbserver/linux-aarch64-low.cc:941:28: note: in expansion of macro 'ZA_PT_SIZE'
941 | regset->size = ZA_PT_SIZE (features.svq);
| ^~~~~~~~~~
CXX nat/aarch64-linux.o

Luis> +/* Make sure we only define these if the kernel header doesn't. */
Luis> +#ifndef ZA_PT_SIZE
...
Luis> +/* Offset from the start of struct user_za_header to the register data */
Luis> +#define ZA_PT_ZA_OFFSET \
Luis> + ((sizeof (struct user_za_header) + (__SVE_VQ_BYTES - 1)) \
Luis> + / __SVE_VQ_BYTES * __SVE_VQ_BYTES)

Is it safe to just remove the "__" as the compiler suggests?

thanks,
Tom