aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/server.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 5e9e4cb..4b9bc7e 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-06 Carl Love <cel@us.ibm.com>
+
+ * server.c (start_inferior): Do not call
+ function target_post_create_inferior () if the
+ inferior process has already exited.
+
2016-09-05 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER, COMPILER_CFLAGS): Remove.
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 9c06443..96e3a18 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -285,11 +285,15 @@ start_inferior (char **argv)
(assuming success). */
last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
- target_post_create_inferior ();
-
+ /* The last_status.kind was set by the call to ptrace(PTRACE_TRACEME, ...).
+ At this point, the target process, if it exits, is stopped. Do not call
+ the function target_post_create_inferior if the process has already
+ exited, as the target implementation of the routine may rely on the
+ process being live. */
if (last_status.kind != TARGET_WAITKIND_EXITED
&& last_status.kind != TARGET_WAITKIND_SIGNALLED)
{
+ target_post_create_inferior ();
current_thread->last_resume_kind = resume_stop;
current_thread->last_status = last_status;
}