public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [PATCH 5/6] linux-nat: Add function lwp_is_stepping
Date: Thu, 15 Sep 2016 12:02:00 -0000	[thread overview]
Message-ID: <1473940907-4449-4-git-send-email-arnez@linux.vnet.ibm.com> (raw)
In-Reply-To: <1473940399-2891-1-git-send-email-arnez@linux.vnet.ibm.com>

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;
+}
+
 \f
 /* 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 */
-- 
2.5.0

  parent reply	other threads:[~2016-09-15 12:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 11:53 [PATCH 0/6] S390: Watchpoint enhancements and hardware breakpoints Andreas Arnez
2016-09-15 11:54 ` [PATCH] Fix order of inferiors in "thread apply all" Andreas Arnez
2016-09-15 12:03   ` Andreas Arnez
2016-09-15 11:59 ` [PATCH 1/6] S390: Avoid direct access to lwp_info structure Andreas Arnez
2016-09-15 12:01 ` [PATCH 3/6] S390: Multi-inferior watchpoint support Andreas Arnez
2016-09-15 12:02 ` Andreas Arnez [this message]
2016-09-15 15:08   ` [PATCH 5/6] linux-nat: Add function lwp_is_stepping Yao Qi
2016-09-15 12:02 ` [PATCH 6/6] S390: Hardware breakpoint support Andreas Arnez
2016-09-15 12:02 ` [PATCH 2/6] S390: Migrate watch areas from list to VEC type Andreas Arnez
2016-09-15 12:02 ` [PATCH 4/6] S390: Enable "maint set show-debug-regs" Andreas Arnez
2016-09-15 14:11 ` [PATCH 0/6] S390: Watchpoint enhancements and hardware breakpoints Pedro Alves
2016-09-16 12:43   ` Ulrich Weigand
2016-09-16 15:43     ` Pedro Alves
2016-09-16 17:30       ` Andreas Arnez
2016-09-15 14:58 ` Yao Qi
2016-09-15 17:14   ` Andreas Arnez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473940907-4449-4-git-send-email-arnez@linux.vnet.ibm.com \
    --to=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).