diff options
author | Gary Benson <gbenson@redhat.com> | 2014-09-11 11:19:56 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-09-11 11:19:56 +0100 |
commit | f8c1d06b82ab0fd56bcffc9030cb44b5a946113e (patch) | |
tree | 5150db99cd6c829a8f3cd9d96f24ac57a549fb2a /gdb/target.c | |
parent | 721ec300e1e27c2fa7540ef97f39b6c5ce65083f (diff) | |
download | gdb-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/target.c')
-rw-r--r-- | gdb/target.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c index 711e7cb..339b1d1 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3027,6 +3027,31 @@ target_stop (ptid_t ptid) (*current_target.to_stop) (¤t_target, ptid); } +/* See target/target.h. */ + +void +target_stop_ptid (ptid_t ptid) +{ + struct target_waitstatus status; + int was_non_stop = non_stop; + + non_stop = 1; + target_stop (ptid); + + memset (&status, 0, sizeof (status)); + target_wait (ptid, &status, 0); + + non_stop = was_non_stop; +} + +/* See target/target.h. */ + +void +target_continue_ptid (ptid_t ptid) +{ + target_resume (ptid, 0, GDB_SIGNAL_0); +} + /* Concatenate ELEM to LIST, a comma separate list, and return the result. The LIST incoming argument is released. */ |