.../x86-generic/PlatformThread.cpp:332:79: error: 'n' is not a constant expression
332 | return ptrace(PTRACE_POKEUSER, tid_, offsetof(struct user, u_debugreg[n]), value);
| ^
It's a regression of gcc-11 compared to gcc-10, but it's not
clear if non-constant expressions are guaranteed to work in
general: https://gcc.gnu.org/PR95942. gcc used to accept
simple expressions, but nothing complex.
The change workarounds build failure by avoiding non-constant expression.
On gcc-11 edb-debugger build fails as:
It's a regression of gcc-11 compared to gcc-10, but it's not clear if non-constant expressions are guaranteed to work in general: https://gcc.gnu.org/PR95942. gcc used to accept simple expressions, but nothing complex.
The change workarounds build failure by avoiding non-constant expression.