diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-09-05 09:54:53 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2017-09-05 09:54:53 +0100 |
commit | 9d3d478be5e21151d3755d7b2e6f1cd8ff92d726 (patch) | |
tree | 44f3a0e29a71150f3cb98813b26d67ec8cbcfd94 /gdb/x86-linux-nat.c | |
parent | b9f1d50ffcac4c4b65cb05c2971106cb06e8774c (diff) | |
download | gdb-9d3d478be5e21151d3755d7b2e6f1cd8ff92d726.zip gdb-9d3d478be5e21151d3755d7b2e6f1cd8ff92d726.tar.gz gdb-9d3d478be5e21151d3755d7b2e6f1cd8ff92d726.tar.bz2 |
Centralize amd64-linux target descriptions
This patch adds a new function amd64_linux_read_description, which
creates amd64-linux target descriptions according to its two
arguments, xcr0 and is_x32.
gdb:
2017-09-05 Yao Qi <yao.qi@linaro.org>
* amd64-linux-tdep.c (amd64_linux_read_description): New
function.
(amd64_linux_core_read_description): Call
amd64_linux_read_description.
(amd64_linux_init_abi): Likewise.
(amd64_x32_linux_init_abi): Likewise.
* amd64-linux-tdep.h (amd64_linux_read_description): Declare.
* x86-linux-nat.c (x86_linux_read_description): Call
amd64_linux_read_description.
Diffstat (limited to 'gdb/x86-linux-nat.c')
-rw-r--r-- | gdb/x86-linux-nat.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c index 2c4afb1..4611527 100644 --- a/gdb/x86-linux-nat.c +++ b/gdb/x86-linux-nat.c @@ -192,40 +192,7 @@ x86_linux_read_description (struct target_ops *ops) if (is_64bit) { #ifdef __x86_64__ - switch (xcr0_features_bits) - { - case X86_XSTATE_AVX_MPX_AVX512_PKU_MASK: - if (is_x32) - /* No MPX, PKU on x32, fall back to AVX-AVX512. */ - return tdesc_x32_avx_avx512_linux; - else - return tdesc_amd64_avx_mpx_avx512_pku_linux; - case X86_XSTATE_AVX_AVX512_MASK: - if (is_x32) - return tdesc_x32_avx_avx512_linux; - else - return tdesc_amd64_avx_avx512_linux; - case X86_XSTATE_MPX_MASK: - if (is_x32) - return tdesc_x32_avx_linux; /* No MPX on x32 using AVX. */ - else - return tdesc_amd64_mpx_linux; - case X86_XSTATE_AVX_MPX_MASK: - if (is_x32) - return tdesc_x32_avx_linux; /* No MPX on x32 using AVX. */ - else - return tdesc_amd64_avx_mpx_linux; - case X86_XSTATE_AVX_MASK: - if (is_x32) - return tdesc_x32_avx_linux; - else - return tdesc_amd64_avx_linux; - default: - if (is_x32) - return tdesc_x32_linux; - else - return tdesc_amd64_linux; - } + return amd64_linux_read_description (xcr0_features_bits, is_x32); #endif } else |