Introduce procedure use_gdb_stub
[deliverable/binutils-gdb.git] / gdb / i386-linux-nat.c
index a08b9b85cf49ed980a4cdd9bd78f98bfeffd7242..a41ee2108152f63ea9560f5a3f847766f06158f3 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for GNU/Linux i386.
 
-   Copyright (C) 1999-2014 Free Software Foundation, Inc.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,7 +22,7 @@
 #include "gdbcore.h"
 #include "regcache.h"
 #include "elf/common.h"
-#include <sys/ptrace.h>
+#include "nat/gdb_ptrace.h"
 #include <sys/uio.h>
 #include "gregset.h"
 #include "gdb_proc_service.h"
@@ -33,7 +33,9 @@
 #include "i386-linux-tdep.h"
 #include "x86-xstate.h"
 
+#include "linux-nat.h"
 #include "x86-linux-nat.h"
+#include "nat/linux-ptrace.h"
 
 /* The register sets used in GNU/Linux ELF core-dumps are identical to
    the register sets in `struct user' that is used for a.out
@@ -325,7 +327,7 @@ fetch_xstateregs (struct regcache *regcache, int tid)
   char xstateregs[X86_XSTATE_MAX_SIZE];
   struct iovec iov;
 
-  if (!have_ptrace_getregset)
+  if (have_ptrace_getregset != TRIBOOL_TRUE)
     return 0;
 
   iov.iov_base = xstateregs;
@@ -348,7 +350,7 @@ store_xstateregs (const struct regcache *regcache, int tid, int regno)
   char xstateregs[X86_XSTATE_MAX_SIZE];
   struct iovec iov;
 
-  if (!have_ptrace_getregset)
+  if (have_ptrace_getregset != TRIBOOL_TRUE)
     return 0;
   
   iov.iov_base = xstateregs;
@@ -648,8 +650,7 @@ static void
 i386_linux_resume (struct target_ops *ops,
                   ptid_t ptid, int step, enum gdb_signal signal)
 {
-  int pid = ptid_get_pid (ptid);
-
+  int pid = ptid_get_lwp (ptid);
   int request;
 
   if (catch_syscall_enabled () > 0)
@@ -659,7 +660,7 @@ i386_linux_resume (struct target_ops *ops,
 
   if (step)
     {
-      struct regcache *regcache = get_thread_regcache (pid_to_ptid (pid));
+      struct regcache *regcache = get_thread_regcache (ptid);
       struct gdbarch *gdbarch = get_regcache_arch (regcache);
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
       ULONGEST pc;
This page took 0.024705 seconds and 4 git commands to generate.