This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] linux-nat: Add function lwp_is_stepping


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0e00e962c57138f0dd8c261cbd6918782deec3c4

commit 0e00e962c57138f0dd8c261cbd6918782deec3c4
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date:   Fri Sep 16 19:25:55 2016 +0200

    linux-nat: Add function lwp_is_stepping
    
    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.

Diff:
---
 gdb/ChangeLog             | 5 +++++
 gdb/gdbserver/ChangeLog   | 4 ++++
 gdb/gdbserver/linux-low.c | 8 ++++++++
 gdb/linux-nat.c           | 8 ++++++++
 gdb/nat/linux-nat.h       | 5 +++++
 5 files changed, 30 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9e38ce3..1aef462 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2016-09-16  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
+	* nat/linux-nat.h (lwp_is_stepping): New declaration.
+	* linux-nat.c (lwp_is_stepping): New function.
+
+2016-09-16  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
 	* s390-linux-nat.c (gdbcmd.h): New include.
 	(s390_show_debug_regs): New function.
 	(s390_stopped_by_watchpoint): Call it, if show_debug_regs is set.
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index af8420f..499ae3d 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2016-09-16  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+	* linux-low.c (lwp_is_stepping): New function.
+
 2016-09-06  Carl Love  <cel@us.ibm.com>
 
 	* server.c (start_inferior):  Fixed comment, requested comment change
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..529cf26 100644
--- a/gdb/nat/linux-nat.h
+++ b/gdb/nat/linux-nat.h
@@ -85,4 +85,9 @@ 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 at the ptrace
+   level.  */
+
+extern int lwp_is_stepping (struct lwp_info *lwp);
+
 #endif /* LINUX_NAT_H */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]