public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove code to cope with LWPs wrapped as PIDs
@ 2014-09-04 14:13 Gary Benson
  2014-09-04 14:20 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Benson @ 2014-09-04 14:13 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pedro Alves

Hi all,

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, so the handler is now redundant.
This commit removes that handler.

Built and regtested on RHEL 6.5 x86_64.

Ok to commit?

Thanks,
Gary

--
gdb/ChangeLog:

	* x86-linux-nat.c (x86_linux_dr_get, x86_linux_dr_set):
	Remove code to cope with LWPs wrapped as PIDs.
---
 gdb/ChangeLog       |    5 +++++
 gdb/x86-linux-nat.c |    6 ++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 0d070dd..67300d8 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -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,
-- 
1.7.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove code to cope with LWPs wrapped as PIDs
  2014-09-04 14:13 [PATCH] Remove code to cope with LWPs wrapped as PIDs Gary Benson
@ 2014-09-04 14:20 ` Pedro Alves
  2014-09-04 14:26   ` Gary Benson
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2014-09-04 14:20 UTC (permalink / raw)
  To: Gary Benson, gdb-patches

On 09/04/2014 03:13 PM, Gary Benson wrote:

> Ok to commit?

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove code to cope with LWPs wrapped as PIDs
  2014-09-04 14:20 ` Pedro Alves
@ 2014-09-04 14:26   ` Gary Benson
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Benson @ 2014-09-04 14:26 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Pedro Alves wrote:
> On 09/04/2014 03:13 PM, Gary Benson wrote:
> > Ok to commit?
> 
> OK.

Pushed.

Thanks,
Gary

-- 
http://gbenson.net/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-04 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04 14:13 [PATCH] Remove code to cope with LWPs wrapped as PIDs Gary Benson
2014-09-04 14:20 ` Pedro Alves
2014-09-04 14:26   ` Gary Benson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).