From patchwork Mon Jul 25 12:01:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 13974 Received: (qmail 128125 invoked by alias); 25 Jul 2016 12:02:04 -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 128073 invoked by uid 89); 25 Jul 2016 12:02:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Mon, 25 Jul 2016 12:01:53 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F00472086 for ; Mon, 25 Jul 2016 12:01:52 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6PC1omn028387 for ; Mon, 25 Jul 2016 08:01:51 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed 2/2] linux-procfs: Handle lowercase "t (tracing stop)" state Date: Mon, 25 Jul 2016 13:01:49 +0100 Message-Id: <1469448109-11200-2-git-send-email-palves@redhat.com> In-Reply-To: <20160724200827.GA5193@host1.jankratochvil.net> References: <20160724200827.GA5193@host1.jankratochvil.net> Since Linux 2.6.33, /proc/PID/status shows "t (tracing stop)", with lowercase 't'. Because GDB is only expecting "T (tracing stop)", GDB can incorrectly suppress errors in check_ptrace_stopped_lwp_gone: 1578 if (!check_ptrace_stopped_lwp_gone (lp)) 1579 throw_exception (ex); Ref: https://sourceware.org/ml/gdb-patches/2016-06/msg00072.html 2016-07-25 Pedro Alves Jan Kratochvil * nat/linux-procfs.c (parse_proc_status_state): Handle lowercase 't'. --- gdb/ChangeLog | 6 ++++++ gdb/nat/linux-procfs.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0840a69..c346a90 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,10 @@ 2016-07-25 Pedro Alves + Jan Kratochvil + + * nat/linux-procfs.c (parse_proc_status_state): Handle lowercase + 't'. + +2016-07-25 Pedro Alves * nat/linux-procfs.c (enum proc_state): New enum. (parse_proc_status_state): New function. diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c index 5d63e1b..f00fe29 100644 --- a/gdb/nat/linux-procfs.c +++ b/gdb/nat/linux-procfs.c @@ -102,7 +102,10 @@ parse_proc_status_state (const char *state) switch (state[0]) { + case 't': + return PROC_STATE_TRACING_STOP; case 'T': + /* Before Linux 2.6.33, tracing stop used uppercase T. */ if (strcmp (state, "T (tracing stop)") == 0) return PROC_STATE_TRACING_STOP; else