Remove GDBSERVER uses from linux-btrace.c
[binutils-gdb.git] / gdb / nat / linux-btrace.c
index 84de8a70a9204089e862e5a7d7e6671c96c10dc9..37c85c06f0c979c30a11a4c7a6f09836eee90591 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
 #include "linux-btrace.h"
-#include "gdb_assert.h"
-#include "regcache.h"
-#include "gdbthread.h"
+#include "common-regcache.h"
 #include "gdb_wait.h"
-#include "i386-cpuid.h"
+#include "x86-cpuid.h"
 
 #ifdef HAVE_SYS_SYSCALL_H
 #include <sys/syscall.h>
@@ -38,8 +31,6 @@
 
 #if HAVE_LINUX_PERF_EVENT_H && defined(SYS_perf_event_open)
 
-#include <errno.h>
-#include <string.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <sys/mman.h>
@@ -183,11 +174,7 @@ perf_event_read_bts (struct btrace_target_info* tinfo, const uint8_t *begin,
   gdb_assert (start <= end);
 
   /* The first block ends at the current pc.  */
-#ifdef GDBSERVER
-  regcache = get_thread_regcache (find_thread_ptid (tinfo->ptid), 1);
-#else
-  regcache = get_thread_regcache (tinfo->ptid);
-#endif
+  regcache = get_thread_regcache_for_ptid (tinfo->ptid);
   block.end = regcache_read_pc (regcache);
 
   /* The buffer may contain a partial record as its last entry (i.e. when the
@@ -351,7 +338,7 @@ intel_supports_btrace (void)
 {
   unsigned int cpuid, model, family;
 
-  if (!i386_cpuid (1, &cpuid, NULL, NULL, NULL))
+  if (!x86_cpuid (1, &cpuid, NULL, NULL, NULL))
     return 0;
 
   family = (cpuid >> 8) & 0xf;
@@ -392,7 +379,7 @@ cpu_supports_btrace (void)
 {
   unsigned int ebx, ecx, edx;
 
-  if (!i386_cpuid (0, NULL, &ebx, &ecx, &edx))
+  if (!x86_cpuid (0, NULL, &ebx, &ecx, &edx))
     return 0;
 
   if (ebx == signature_INTEL_ebx && ecx == signature_INTEL_ecx