From patchwork Thu Sep 15 12:01:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 15663 Received: (qmail 53771 invoked by alias); 15 Sep 2016 12:01:57 -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 53628 invoked by uid 89); 15 Sep 2016 12:01:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=H*Ad:U*uweigand, claim X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Sep 2016 12:01:55 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8FBwnxv057297 for ; Thu, 15 Sep 2016 08:01:53 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 25fr7bh8gx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Sep 2016 08:01:53 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Sep 2016 13:01:51 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Sep 2016 13:01:49 +0100 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: arnez@linux.vnet.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9314B2190023 for ; Thu, 15 Sep 2016 13:01:09 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8FC1mh750987164 for ; Thu, 15 Sep 2016 12:01:48 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8FC1mS6031098 for ; Thu, 15 Sep 2016 06:01:48 -0600 Received: from oc1027705133.ibm.com (dyn-9-152-212-159.boeblingen.de.ibm.com [9.152.212.159]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u8FC1ln5031017; Thu, 15 Sep 2016 06:01:48 -0600 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Ulrich Weigand Subject: [PATCH 5/6] linux-nat: Add function lwp_is_stepping Date: Thu, 15 Sep 2016 14:01:46 +0200 In-Reply-To: <1473940399-2891-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1473940399-2891-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16091512-0040-0000-0000-000002D3A9A9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16091512-0041-0000-0000-00001CFF6AE8 Message-Id: <1473940907-4449-4-git-send-email-arnez@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-09-15_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609150162 X-IsSubscribed: yes Add the function lwp_is_stepping which indicates whether the given LWP is currently single-stepping. This is a common interface, usable from native GDB as well as from gdbserver. gdb/gdbserver/ChangeLog: * linux-low.c (lwp_is_stepping): New function. gdb/ChangeLog: * nat/linux-nat.h (lwp_is_stepping): New declaration. * linux-nat.c (lwp_is_stepping): New function. --- gdb/gdbserver/linux-low.c | 8 ++++++++ gdb/linux-nat.c | 8 ++++++++ gdb/nat/linux-nat.h | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index fb70715..4203b92 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -176,6 +176,14 @@ lwp_stop_reason (struct lwp_info *lwp) return lwp->stop_reason; } +/* See nat/linux-nat.h. */ + +int +lwp_is_stepping (struct lwp_info *lwp) +{ + return lwp->stepping; +} + /* A list of all unknown processes which receive stop signals. Some other process will presumably claim each of these as forked children momentarily. */ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 7410f8e..8e9eb0b 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -355,6 +355,14 @@ lwp_stop_reason (struct lwp_info *lwp) return lwp->stop_reason; } +/* See nat/linux-nat.h. */ + +int +lwp_is_stepping (struct lwp_info *lwp) +{ + return lwp->step; +} + /* Trivial list manipulation functions to keep track of a list of new stopped processes. */ diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h index 2b485db..f7d1c63 100644 --- a/gdb/nat/linux-nat.h +++ b/gdb/nat/linux-nat.h @@ -85,4 +85,8 @@ extern enum target_stop_reason lwp_stop_reason (struct lwp_info *lwp); extern void linux_stop_lwp (struct lwp_info *lwp); +/* Return nonzero if we are single-stepping this LWP. */ + +extern int lwp_is_stepping (struct lwp_info *lwp); + #endif /* LINUX_NAT_H */