Remove code to cope with LWPs wrapped as PIDs
authorGary Benson <gbenson@redhat.com>
Thu, 4 Sep 2014 14:07:46 +0000 (15:07 +0100)
committerGary Benson <gbenson@redhat.com>
Thu, 4 Sep 2014 14:23:21 +0000 (15:23 +0100)
Historically the Linux x86 watchpoint code did not cope with multi-
threaded processes and LWP IDs were passed to it wrapped as PIDs.
Not all entry points were converted when the Linux x86 watchpoint
code was made multi-thread-aware, so a handler was left in place to
cope with wrapped LWPs.  Since then all such entry points have been
converted to pass regular LWPs and the handler is now redundant.
This commit removes the handler and adds assertions to ensure no
wrapped LWPs are passed in future.

gdb/ChangeLog:

* x86-linux-nat.c (x86_linux_dr_get, x86_linux_dr_set):
Remove code to cope with LWPs wrapped as PIDs.
Add assertions to ensure no wrapped LWPs are passed.

gdb/ChangeLog
gdb/x86-linux-nat.c

index 25fccf38730729641ec843d4a1ccadb0671c600b..62316bbd8197398e0448e6cfc8fdb4c69e01cf5a 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-04  Gary Benson  <gbenson@redhat.com>
+
+       * x86-linux-nat.c (x86_linux_dr_get, x86_linux_dr_set):
+       Remove code to cope with LWPs wrapped as PIDs.
+       Add assertions to ensure no wrapped LWPs are passed.
+
 2014-09-04  Pedro Alves  <palves@redhat.com>
 
        * value.c (value_ranges_copy_adjusted): New function, factored out
index 0d070dda9fec8af79302516562b5a45619c862bf..67300d8053d3aeda5407b66a8aec2a45457ee616 100644 (file)
@@ -60,9 +60,8 @@ x86_linux_dr_get (ptid_t ptid, int regnum)
   int tid;
   unsigned long value;
 
+  gdb_assert (ptid_lwp_p (ptid));
   tid = ptid_get_lwp (ptid);
-  if (tid == 0)
-    tid = ptid_get_pid (ptid);
 
   errno = 0;
   value = ptrace (PTRACE_PEEKUSER, tid,
@@ -80,9 +79,8 @@ x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
 {
   int tid;
 
+  gdb_assert (ptid_lwp_p (ptid));
   tid = ptid_get_lwp (ptid);
-  if (tid == 0)
-    tid = ptid_get_pid (ptid);
 
   errno = 0;
   ptrace (PTRACE_POKEUSER, tid,
This page took 0.029503 seconds and 4 git commands to generate.