From patchwork Thu Sep 4 14:13:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 2648 Received: (qmail 9026 invoked by alias); 4 Sep 2014 14:13:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 9007 invoked by uid 89); 4 Sep 2014 14:13:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 04 Sep 2014 14:13:54 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s84EDq0k010000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 4 Sep 2014 10:13:53 -0400 Received: from blade.nx (ovpn-116-86.ams2.redhat.com [10.36.116.86]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s84EDpvZ018984; Thu, 4 Sep 2014 10:13:52 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id E0A6F2640E1; Thu, 4 Sep 2014 15:13:50 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Cc: Pedro Alves Subject: [PATCH] Remove code to cope with LWPs wrapped as PIDs Date: Thu, 4 Sep 2014 15:13:50 +0100 Message-Id: <1409840030-4169-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes 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,