aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-09-11 11:19:56 +0100
committerGary Benson <gbenson@redhat.com>2014-09-11 11:19:56 +0100
commitf8c1d06b82ab0fd56bcffc9030cb44b5a946113e (patch)
tree5150db99cd6c829a8f3cd9d96f24ac57a549fb2a /gdb/gdbserver
parent721ec300e1e27c2fa7540ef97f39b6c5ce65083f (diff)
downloadgdb-f8c1d06b82ab0fd56bcffc9030cb44b5a946113e.zip
gdb-f8c1d06b82ab0fd56bcffc9030cb44b5a946113e.tar.gz
gdb-f8c1d06b82ab0fd56bcffc9030cb44b5a946113e.tar.bz2
Introduce target_{stop,continue}_ptid
This commit introduces two new functions to stop and restart target processes that shared code can use and that clients must implement. It also changes some shared code to use these functions. gdb/ChangeLog: * target/target.h (target_stop_ptid, target_continue_ptid): Declare. * target.c (target_stop_ptid, target_continue_ptid): New functions. * common/agent.c [!GDBSERVER]: Don't include infrun.h. (agent_run_command): Always use target_stop_ptid and target_continue_ptid. gdb/gdbserver/ChangeLog: * target.c (target_stop_ptid, target_continue_ptid): New functions.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/target.c32
2 files changed, 37 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index f2f63b4..8a5ee1f 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-11 Gary Benson <gbenson@redhat.com>
+
+ * target.c (target_stop_ptid, target_continue_ptid): New
+ functions.
+
2014-09-11 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index 08506e5..e51b7db 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -134,6 +134,38 @@ mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options,
return ret;
}
+/* See target/target.h. */
+
+void
+target_stop_ptid (ptid_t ptid)
+{
+ struct target_waitstatus status;
+ int was_non_stop = non_stop;
+ struct thread_resume resume_info;
+
+ resume_info.thread = ptid;
+ resume_info.kind = resume_stop;
+ resume_info.sig = GDB_SIGNAL_0;
+ (*the_target->resume) (&resume_info, 1);
+
+ non_stop = 1;
+ mywait (ptid, &status, 0, 0);
+ non_stop = was_non_stop;
+}
+
+/* See target/target.h. */
+
+void
+target_continue_ptid (ptid_t ptid)
+{
+ struct thread_resume resume_info;
+
+ resume_info.thread = ptid;
+ resume_info.kind = resume_continue;
+ resume_info.sig = GDB_SIGNAL_0;
+ (*the_target->resume) (&resume_info, 1);
+}
+
int
start_non_stop (int nonstop)
{