diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-03-26 18:52:27 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-03-26 18:52:27 +0000 |
commit | cba2791ca6a984bd533ab643f4d92e3f5b278b43 (patch) | |
tree | c3595a02b311b1db116b613d6fb5ebfade316a3f /gdbserver/linux-i386-ipa.cc | |
parent | 69324a74e344e640e0c2d4e76e4e4dfd3368cd76 (diff) | |
download | gdb-cba2791ca6a984bd533ab643f4d92e3f5b278b43.zip gdb-cba2791ca6a984bd533ab643f4d92e3f5b278b43.tar.gz gdb-cba2791ca6a984bd533ab643f4d92e3f5b278b43.tar.bz2 |
Revert "gdbserver: update target description creation for x86/linux"
This reverts commit 61bb321605fc74703adc994fd7a78e9d2495ca7a.
Diffstat (limited to 'gdbserver/linux-i386-ipa.cc')
-rw-r--r-- | gdbserver/linux-i386-ipa.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/gdbserver/linux-i386-ipa.cc b/gdbserver/linux-i386-ipa.cc index 246bcb9..459b805 100644 --- a/gdbserver/linux-i386-ipa.cc +++ b/gdbserver/linux-i386-ipa.cc @@ -246,15 +246,28 @@ initialize_fast_tracepoint_trampoline_buffer (void) } } +/* Map the tdesc index to xcr0 mask. */ +static uint64_t idx2mask[X86_TDESC_LAST] = { + X86_XSTATE_X87_MASK, + X86_XSTATE_SSE_MASK, + X86_XSTATE_AVX_MASK, + X86_XSTATE_MPX_MASK, + X86_XSTATE_AVX_MPX_MASK, + X86_XSTATE_AVX_AVX512_MASK, + X86_XSTATE_AVX_MPX_AVX512_PKU_MASK, +}; + /* Return target_desc to use for IPA, given the tdesc index passed by gdbserver. */ const struct target_desc * get_ipa_tdesc (int idx) { - uint64_t xcr0 = x86_linux_tdesc_idx_to_xcr0 (idx); - - return i386_linux_read_description (xcr0); + if (idx >= X86_TDESC_LAST) + { + internal_error ("unknown ipa tdesc index: %d", idx); + } + return i386_linux_read_description (idx2mask[idx]); } /* Allocate buffer for the jump pads. On i386, we can reach an arbitrary @@ -276,6 +289,6 @@ void initialize_low_tracepoint (void) { initialize_fast_tracepoint_trampoline_buffer (); - for (auto i = 0; i < x86_linux_i386_ipa_tdesc_count (); i++) - i386_linux_read_description (x86_linux_tdesc_idx_to_xcr0 (i)); + for (auto i = 0; i < X86_TDESC_LAST; i++) + i386_linux_read_description (idx2mask[i]); } |