Revert "gdb/gdbserver: share x86/linux tdesc caching"

This reverts commit 198ff6ff81.
This commit is contained in:
Andrew Burgess
2024-03-26 18:52:17 +00:00
parent 57d8b51d90
commit 69324a74e3
11 changed files with 396 additions and 358 deletions

View File

@@ -1579,6 +1579,37 @@ amd64_linux_record_signal (struct gdbarch *gdbarch,
return 0;
}
const target_desc *
amd64_linux_read_description (uint64_t xcr0_features_bit, bool is_x32)
{
static target_desc *amd64_linux_tdescs \
[2/*AVX*/][2/*MPX*/][2/*AVX512*/][2/*PKRU*/] = {};
static target_desc *x32_linux_tdescs \
[2/*AVX*/][2/*AVX512*/][2/*PKRU*/] = {};
target_desc **tdesc;
if (is_x32)
{
tdesc = &x32_linux_tdescs[(xcr0_features_bit & X86_XSTATE_AVX) ? 1 : 0 ]
[(xcr0_features_bit & X86_XSTATE_AVX512) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_PKRU) ? 1 : 0];
}
else
{
tdesc = &amd64_linux_tdescs[(xcr0_features_bit & X86_XSTATE_AVX) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_MPX) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_AVX512) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_PKRU) ? 1 : 0];
}
if (*tdesc == NULL)
*tdesc = amd64_create_target_description (xcr0_features_bit, is_x32,
true, true);
return *tdesc;
}
/* Get Linux/x86 target description from core dump. */
static const struct target_desc *