+2016-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * fork-child.c (startup_inferior): Replace calls to target_resume
+ by target_continue{,_no_signal}, depending on the case.
+ * linux-nat.c (cleanup_target_stop): Call
+ target_continue_no_signal instead of target_resume.
+ * procfs.c (procfs_wait): Likewise.
+ * target.c (target_continue): New function.
+ * target/target.h (target_continue): New prototype.
+
2016-08-31 Yao Qi <yao.qi@linaro.org>
* record-full.c (record_full_insert_breakpoint): Fix typo.
if (resume_signal != GDB_SIGNAL_TRAP)
{
/* Let shell child handle its own signals in its own way. */
- target_resume (resume_ptid, 0, resume_signal);
+ target_continue (resume_ptid, resume_signal);
}
else
{
break;
/* Just make it go on. */
- target_resume (resume_ptid, 0, GDB_SIGNAL_0);
+ target_continue_no_signal (resume_ptid);
}
}
+2016-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * server.c (start_inferior): New variable 'ptid'. Replace calls
+ to the_target->resume by target_continue{,_no_signal}, depending
+ on the case.
+ * target.c (target_stop_and_wait): Call target_continue_no_signal
+ instead of the_target->resume.
+ (target_continue): New function.
+
2016-08-31 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (linux_wait_1): Move event switch after unsuspend_lwps.
if (wrapper_argv != NULL)
{
- struct thread_resume resume_info;
-
- memset (&resume_info, 0, sizeof (resume_info));
- resume_info.thread = pid_to_ptid (signal_pid);
- resume_info.kind = resume_continue;
- resume_info.sig = 0;
+ ptid_t ptid = pid_to_ptid (signal_pid);
last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
{
do
{
- (*the_target->resume) (&resume_info, 1);
+ target_continue_no_signal (ptid);
last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
if (last_status.kind != TARGET_WAITKIND_STOPPED)
if ((tracing && disconnected_tracing) || any_persistent_commands ())
{
- struct thread_resume resume_info;
struct process_info *process = find_process_pid (pid);
if (process == NULL)
process->gdb_detached = 1;
/* Detaching implicitly resumes all threads. */
- resume_info.thread = minus_one_ptid;
- resume_info.kind = resume_continue;
- resume_info.sig = 0;
- (*the_target->resume) (&resume_info, 1);
+ target_continue_no_signal (minus_one_ptid);
write_ok (own_buf);
break; /* from switch/case */
/* A thread stopped with a signal, but gdb isn't
connected to handle it. Pass it down to the
inferior, as if it wasn't being traced. */
- struct thread_resume resume_info;
+ enum gdb_signal signal;
if (debug_threads)
debug_printf ("GDB not connected; forwarding event %d for"
(int) last_status.kind,
target_pid_to_str (last_ptid));
- resume_info.thread = last_ptid;
- resume_info.kind = resume_continue;
if (last_status.kind == TARGET_WAITKIND_STOPPED)
- resume_info.sig = gdb_signal_to_host (last_status.value.sig);
+ signal = last_status.value.sig;
else
- resume_info.sig = 0;
- (*the_target->resume) (&resume_info, 1);
+ signal = GDB_SIGNAL_0;
+ target_continue (last_ptid, signal);
}
}
else
{
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);
+ target_continue_no_signal (ptid);
non_stop = 1;
mywait (ptid, &status, 0, 0);
(*the_target->resume) (&resume_info, 1);
}
+/* See target/target.h. */
+
+void
+target_continue (ptid_t ptid, enum gdb_signal signal)
+{
+ struct thread_resume resume_info;
+
+ resume_info.thread = ptid;
+ resume_info.kind = resume_continue;
+ resume_info.sig = gdb_signal_to_host (signal);
+ (*the_target->resume) (&resume_info, 1);
+}
+
int
start_non_stop (int nonstop)
{
gdb_assert (arg != NULL);
/* Unpause all */
- target_resume (*ptid, 0, GDB_SIGNAL_0);
+ target_continue_no_signal (*ptid);
}
static VEC(static_tracepoint_marker_p) *
else
{
/* How to keep going without returning to wfi: */
- target_resume (ptid, 0, GDB_SIGNAL_0);
+ target_continue_no_signal (ptid);
goto wait_again;
}
}
/* This is an internal event and should be transparent
to wfi, so resume the execution and wait again. See
comment in procfs_init_inferior() for more details. */
- target_resume (ptid, 0, GDB_SIGNAL_0);
+ target_continue_no_signal (ptid);
goto wait_again;
}
#endif
target_resume (ptid, 0, GDB_SIGNAL_0);
}
+/* See target/target.h. */
+
+void
+target_continue (ptid_t ptid, enum gdb_signal signal)
+{
+ target_resume (ptid, 0, signal);
+}
+
/* Concatenate ELEM to LIST, a comma separate list, and return the
result. The LIST incoming argument is released. */
extern void target_stop_and_wait (ptid_t ptid);
-/* Restart a target previously stopped by target_stop_and_wait.
- No signal is delivered to the target. This function must be
- provided by the client. */
+/* Restart a target previously stopped. No signal is delivered to the
+ target. This function must be provided by the client. */
extern void target_continue_no_signal (ptid_t ptid);
+/* Restart a target previously stopped. SIGNAL is delivered to the
+ target. This function must be provided by the client. */
+
+extern void target_continue (ptid_t ptid, enum gdb_signal signal);
+
#endif /* TARGET_COMMON_H */