diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-03-26 18:52:17 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-03-26 18:52:17 +0000 |
commit | 69324a74e344e640e0c2d4e76e4e4dfd3368cd76 (patch) | |
tree | dedb9438c712c5d366569c1601050d2a868cc8a6 /gdb/amd64-linux-tdep.c | |
parent | 57d8b51d901585a07524ece1188b1892b207e950 (diff) | |
download | binutils-69324a74e344e640e0c2d4e76e4e4dfd3368cd76.zip binutils-69324a74e344e640e0c2d4e76e4e4dfd3368cd76.tar.gz binutils-69324a74e344e640e0c2d4e76e4e4dfd3368cd76.tar.bz2 |
Revert "gdb/gdbserver: share x86/linux tdesc caching"
This reverts commit 198ff6ff819c240545f9fc68b39636fd376d4ba9.
Diffstat (limited to 'gdb/amd64-linux-tdep.c')
-rw-r--r-- | gdb/amd64-linux-tdep.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index e149034..7e0900d 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -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 * |