X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdbserver%2Flinux-x86-low.cc;h=7a65c1d079f86e96d1b0ee3f816e358a0bbdb6f4;hb=1e92785005ce880a5fac9d022f05cdcff91c3091;hp=2837994653de7de51e6007a0057ecd4a002d4b30;hpb=9eedd27d42ceeb6f3765c24972a5c97ce20727cd;p=deliverable%2Fbinutils-gdb.git diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index 2837994653..7a65c1d079 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -124,6 +124,8 @@ public: struct emit_ops *emit_ops () override; + int get_ipa_tdesc_idx () override; + protected: void low_arch_setup () override; @@ -231,11 +233,7 @@ static const int x86_64_regmap[] = -1, -1, -1, -1, -1, -1, -1, -1, -1, ORIG_RAX * 8, -#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE 21 * 8, 22 * 8, -#else - -1, -1, -#endif -1, -1, -1, -1, /* MPX registers BND0 ... BND3. */ -1, -1, /* MPX registers BNDCFGU, BNDSTATUS. */ -1, -1, -1, -1, -1, -1, -1, -1, /* xmm16 ... xmm31 (AVX512) */ @@ -411,19 +409,6 @@ x86_fill_gregset (struct regcache *regcache, void *buf) if (x86_64_regmap[i] != -1) collect_register (regcache, i, ((char *) buf) + x86_64_regmap[i]); -#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE - { - unsigned long base; - int lwpid = lwpid_of (current_thread); - - collect_register_by_name (regcache, "fs_base", &base); - ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_SET_FS); - - collect_register_by_name (regcache, "gs_base", &base); - ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_SET_GS); - } -#endif - return; } @@ -466,18 +451,6 @@ x86_store_gregset (struct regcache *regcache, const void *buf) if (x86_64_regmap[i] != -1) supply_register (regcache, i, ((char *) buf) + x86_64_regmap[i]); -#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE - { - unsigned long base; - int lwpid = lwpid_of (current_thread); - - if (ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_GET_FS) == 0) - supply_register_by_name (regcache, "fs_base", &base); - - if (ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_GET_GS) == 0) - supply_register_by_name (regcache, "gs_base", &base); - } -#endif return; } #endif @@ -2974,8 +2947,8 @@ x86_target::low_supports_range_stepping () return true; } -static int -x86_get_ipa_tdesc_idx (void) +int +x86_target::get_ipa_tdesc_idx () { struct regcache *regcache = get_thread_regcache (current_thread, 0); const struct target_desc *tdesc = regcache->tdesc; @@ -2990,14 +2963,6 @@ x86_get_ipa_tdesc_idx (void) return i386_get_ipa_tdesc_idx (tdesc); } -/* This is initialized assuming an amd64 target. - x86_arch_setup will correct it for i386 or amd64 targets. */ - -struct linux_target_ops the_low_target = -{ - x86_get_ipa_tdesc_idx, -}; - /* The linux target ops object. */ linux_process_target *the_linux_target = &the_x86_target;