diff options
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 11 | ||||
-rw-r--r-- | gdb/gdbserver/remote-utils.c | 17 |
4 files changed, 26 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9932d60..d19c71a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2015-09-15 Pedro Alves <palves@redhat.com> + + PR remote/18965 + * remote-utils.c (prepare_resume_reply): Merge + TARGET_WAITKIND_VFORK_DONE switch case with the + TARGET_WAITKIND_FORKED case. + 2015-09-15 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_can_do_single_step): New diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b5de969..2cc6039 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2015-09-15 Pedro Alves <palves@redhat.com> + + PR remote/18965 + * gdb.texinfo (Stop Reply Packets): Explain that vforkdone's 'r' + part indicates the thread ID of the parent process. + 2015-09-15 Yao Qi <yao.qi@linaro.org> * gdb.texinfo (General Query Packets): Add vContSupported to diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 4ecdb8f..e80e695 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -35498,11 +35498,12 @@ indicating support. @cindex vforkdone events, remote reply @item vforkdone -The packet indicates that a child process created by a vfork -has either called @code{exec} or terminated, so that the -address spaces of the parent and child process are no longer -shared. The @var{r} part is ignored. This packet is only -applicable to targets that support vforkdone events. +The packet indicates that a child process created by a vfork has +either called @code{exec} or terminated, so that the address spaces of +the parent and child process are no longer shared. The @var{r} part +is the thread ID of the parent process. Refer to @ref{thread-id +syntax} for the format of the @var{thread-id} field. This packet is +only applicable to targets that support vforkdone events. This packet should not be sent by default; older @value{GDBN} versions did not support it. @value{GDBN} requests it, by supplying an diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index ac86dd5..78fbfac 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -1117,6 +1117,7 @@ prepare_resume_reply (char *buf, ptid_t ptid, case TARGET_WAITKIND_STOPPED: case TARGET_WAITKIND_FORKED: case TARGET_WAITKIND_VFORKED: + case TARGET_WAITKIND_VFORK_DONE: case TARGET_WAITKIND_EXECD: { struct thread_info *saved_thread; @@ -1135,6 +1136,12 @@ prepare_resume_reply (char *buf, ptid_t ptid, buf = write_ptid (buf, status->value.related_pid); strcat (buf, ";"); } + else if (status->kind == TARGET_WAITKIND_VFORK_DONE && report_vfork_events) + { + enum gdb_signal signal = GDB_SIGNAL_TRAP; + + sprintf (buf, "T%02xvforkdone:;", signal); + } else if (status->kind == TARGET_WAITKIND_EXECD && multi_process) { enum gdb_signal signal = GDB_SIGNAL_TRAP; @@ -1269,16 +1276,6 @@ prepare_resume_reply (char *buf, ptid_t ptid, else sprintf (buf, "X%02x", status->value.sig); break; - case TARGET_WAITKIND_VFORK_DONE: - if (report_vfork_events) - { - enum gdb_signal signal = GDB_SIGNAL_TRAP; - - sprintf (buf, "T%02xvforkdone:;", signal); - } - else - sprintf (buf, "T%02x", GDB_SIGNAL_0); - break; default: error ("unhandled waitkind"); break; |