+2015-11-30 Pedro Alves <palves@redhat.com>
+
+ * NEWS (New commands): Mention "set/show remote thread-events"
+ commands.
+ (New remote packets): Mention thread created/exited stop reasons
+ and QThreadEvents packet.
+ * infrun.c (disable_thread_events): New function.
+ (stop_all_threads): Disable/enable thread create/exit events.
+ Handle TARGET_WAITKIND_THREAD_EXITED.
+ (handle_inferior_event_1): Handle TARGET_WAITKIND_THREAD_CREATED
+ and TARGET_WAITKIND_THREAD_EXITED.
+ * remote.c (remove_child_of_pending_fork): Also remove threads of
+ threads that have TARGET_WAITKIND_THREAD_EXITED events.
+ (remote_parse_stop_reply): Handle "create" magic register. Handle
+ 'w' stop reply.
+ (initialize_remote): Install remote_thread_events as
+ to_thread_events target hook.
+ (remote_thread_events): New function.
+ * target-delegates.c: Regenerate.
+ * target.c (target_thread_events): New function.
+ * target.h (struct target_ops) <to_thread_events>: New field.
+ (target_thread_events): Declare.
+ * target/waitstatus.c (target_waitstatus_to_string): Handle
+ TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
+ * target/waitstatus.h (enum target_waitkind)
+ <TARGET_WAITKIND_THREAD_CREATED, TARGET_WAITKIND_THREAD_EXITED):
+ New values.
+
2015-11-30 Pedro Alves <palves@redhat.com>
* NEWS (New remote packets): Mention vCtrlC.
show remote multiprocess-extensions-packet
Set/show the use of the remote protocol multiprocess extensions.
+set remote thread-events
+show remote thread-events
+ Set/show the use of thread create/exit events.
+
* The "disassemble" command accepts a new modifier: /s.
It prints mixed source+disassembly like /m with two differences:
- disassembled instructions are now printed in program order, and
Equivalent to interrupting with the ^C character, but works in
non-stop mode.
+thread created stop reason (T05 create:...)
+ Indicates that the thread was just created and is stopped at entry.
+
+thread exit stop reply (w exitcode;tid)
+ Indicates that the thread has terminated.
+
+QThreadEvents
+ Enables/disables thread create and exit event reporting. For
+ example, this is used in non-stop mode when GDB stops a set of
+ threads and synchronously waits for the their corresponding stop
+ replies. Without exit events, if one of the threads exits, GDB
+ would hang forever not knowing that it should no longer expect a
+ stop for that same thread.
+
* Extended-remote exec events
** GDB now has support for exec events on extended-remote Linux targets.
+2015-11-30 Pedro Alves <palves@redhat.com>
+
+ * gdb.texinfo (Remote Configuration): List "set/show remote
+ thread-events" command in configuration table.
+ (Stop Reply Packets): Document "T05 create" stop
+ reason and 'w' stop reply.
+ (General Query Packets): Document QThreadEvents packet. Document
+ QThreadEvents qSupported feature.
+
2015-11-30 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Bootstrapping): Add "interrupting remote targets"
@tab @code{exec stop reason}
@tab @code{exec}
+@item @code{thread-events}
+@tab @code{QThreadEvents}
+@tab Tracking thread lifetime.
+
@end multitable
@node Remote Stub
remote stub must also supply the appropriate @samp{qSupported} feature
indicating support.
+@cindex thread create event, remote reply
+@anchor{thread create event}
+@item create
+The packet indicates that the thread was just created. The new thread
+is stopped until @value{GDBN} sets it running with a resumption packet
+(@pxref{vCont packet}). This packet should not be sent by default;
+@value{GDBN} requests it with the @ref{QThreadEvents} packet. See
+also the @samp{w} (@ref{thread exit event}) remote reply below.
+
@end table
@item W @var{AA}
support for multiprocess protocol extensions; see @ref{multiprocess
extensions}. The @var{pid} is formatted as a big-endian hex string.
+@anchor{thread exit event}
+@cindex thread exit event, remote reply
+@item w @var{AA} ; @var{tid}
+
+The thread exited, and @var{AA} is the exit status. This response
+should not be sent by default; @value{GDBN} requests it with the
+@ref{QThreadEvents} packet. See also @ref{thread create event} above.
+
@item O @var{XX}@dots{}
@samp{@var{XX}@dots{}} is hex encoding of @sc{ascii} data, to be
written as the program's console output. This can happen at any time
This packet is not probed by default; the remote stub must request it,
by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}).
+@anchor{QThreadEvents}
+@item QThreadEvents:1
+@itemx QThreadEvents:0
+@cindex thread create/exit events, remote request
+@cindex @samp{QThreadEvents} packet
+
+Enable (@samp{QThreadEvents:1}) or disable (@samp{QThreadEvents:0})
+reporting of thread create and exit events. @xref{thread create
+event}, for the reply specifications. For example, this is used in
+non-stop mode when @value{GDBN} stops a set of threads and
+synchronously waits for the their corresponding stop replies. Without
+exit events, if one of the threads exits, @value{GDBN} would hang
+forever not knowing that it should no longer expect a stop for that
+same thread. @value{GDBN} does not enable this feature unless the
+stub reports that it supports it by including @samp{QThreadEvents+} in
+its @samp{qSupported} reply.
+
+Reply:
+@table @samp
+@item OK
+The request succeeded.
+
+@item E @var{nn}
+An error occurred. The error number @var{nn} is given as hex digits.
+
+@item @w{}
+An empty reply indicates that @samp{QThreadEvents} is not supported by
+the stub.
+@end table
+
+Use of this packet is controlled by the @code{set remote thread-events}
+command (@pxref{Remote Configuration, set remote thread-events}).
+
@item qRcmd,@var{command}
@cindex execute remote command, remote request
@cindex @samp{qRcmd} packet
@tab @samp{-}
@tab No
+@item @samp{QThreadEvents}
+@tab No
+@tab @samp{-}
+@tab No
+
@end multitable
These are the currently defined stub features, in more detail:
The remote stub reports the supported actions in the reply to
@samp{vCont?} packet.
+@item QThreadEvents
+The remote stub understands the @samp{QThreadEvents} packet.
+
@end table
@item qSymbol::
+2015-11-30 Pedro Alves <palves@redhat.com>
+
+ * linux-low.c (handle_extended_wait): Assert that the LWP's
+ waitstatus is TARGET_WAITKIND_IGNORE. If GDB wants to hear about
+ thread create events, leave the new child's status pending.
+ (linux_low_filter_event): If GDB wants to hear about thread exit
+ events, leave the LWP marked dead and don't delete it.
+ (linux_wait_for_event_filtered): Don't check for thread exit.
+ (filter_exit_event): New function.
+ (linux_wait_1): Use it, when returning an exit event.
+ (linux_resume_one_lwp_throw): Assert that the LWP's
+ waitstatus is TARGET_WAITKIND_IGNORE.
+ * remote-utils.c (prepare_resume_reply): Handle
+ TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
+ * server.c (report_thread_events): New global.
+ (handle_general_set): Handle QThreadEvents.
+ (handle_query) <qSupported>: Handle and report QThreadEvents+;
+ (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
+ TARGET_WAITKIND_THREAD_EXITED.
+ * server.h (report_thread_events): Declare.
+
2015-11-30 Pedro Alves <palves@redhat.com>
* linux-low.c (resume_stopped_resumed_lwps): Don't check whether
struct thread_info *event_thr = get_lwp_thread (event_lwp);
struct lwp_info *new_lwp;
+ gdb_assert (event_lwp->waitstatus.kind == TARGET_WAITKIND_IGNORE);
+
if ((event == PTRACE_EVENT_FORK) || (event == PTRACE_EVENT_VFORK)
|| (event == PTRACE_EVENT_CLONE))
{
new_lwp->status_pending_p = 1;
new_lwp->status_pending = status;
}
+ else if (report_thread_events)
+ {
+ new_lwp->waitstatus.kind = TARGET_WAITKIND_THREAD_CREATED;
+ new_lwp->status_pending_p = 1;
+ new_lwp->status_pending = status;
+ }
/* Don't report the event. */
return 1;
{
if (debug_threads)
debug_printf ("LLFE: %d exited.\n", lwpid);
- if (num_lwps (pid_of (thread)) > 1)
+ /* If there is at least one more LWP, then the exit signal was
+ not the end of the debugged application and should be
+ ignored, unless GDB wants to hear about thread exits. */
+ if (report_thread_events
+ || last_thread_of_process_p (pid_of (thread)))
{
-
- /* If there is at least one more LWP, then the exit signal was
- not the end of the debugged application and should be
- ignored. */
- delete_lwp (child);
- return NULL;
+ /* Since events are serialized to GDB core, and we can't
+ report this one right now. Leave the status pending for
+ the next time we're able to report it. */
+ mark_lwp_dead (child, wstat);
+ return child;
}
else
{
- /* This was the last lwp in the process. Since events are
- serialized to GDB core, and we can't report this one
- right now, but GDB core and the other target layers will
- want to be notified about the exit code/signal, leave the
- status pending for the next time we're able to report
- it. */
- mark_lwp_dead (child, wstat);
- return child;
+ delete_lwp (child);
+ return NULL;
}
}
current_thread = event_thread;
- /* Check for thread exit. */
- if (! WIFSTOPPED (*wstatp))
- {
- gdb_assert (last_thread_of_process_p (pid_of (event_thread)));
-
- if (debug_threads)
- debug_printf ("LWP %d is the last lwp of process. "
- "Process %ld exiting.\n",
- pid_of (event_thread), lwpid_of (event_thread));
- return lwpid_of (event_thread);
- }
-
return lwpid_of (event_thread);
}
return null_ptid;
}
+/* Convenience function that is called when the kernel reports an exit
+ event. This decides whether to report the event to GDB as a
+ process exit event, a thread exit event, or to suppress the
+ event. */
+
+static ptid_t
+filter_exit_event (struct lwp_info *event_child,
+ struct target_waitstatus *ourstatus)
+{
+ struct thread_info *thread = get_lwp_thread (event_child);
+ ptid_t ptid = ptid_of (thread);
+
+ if (!last_thread_of_process_p (pid_of (thread)))
+ {
+ if (report_thread_events)
+ ourstatus->kind = TARGET_WAITKIND_THREAD_EXITED;
+ else
+ ourstatus->kind = TARGET_WAITKIND_IGNORE;
+
+ delete_lwp (event_child);
+ }
+ return ptid;
+}
+
/* Wait for process, returns status. */
static ptid_t
}
}
+ if (ourstatus->kind == TARGET_WAITKIND_EXITED)
+ return filter_exit_event (event_child, ourstatus);
+
return ptid_of (current_thread);
}
debug_exit ();
}
+ if (ourstatus->kind == TARGET_WAITKIND_EXITED)
+ return filter_exit_event (event_child, ourstatus);
+
return ptid_of (current_thread);
}
if (lwp->stopped == 0)
return;
+ gdb_assert (lwp->waitstatus.kind == TARGET_WAITKIND_IGNORE);
+
fast_tp_collecting = lwp->collecting_fast_tracepoint;
gdb_assert (!stabilizing_threads || fast_tp_collecting);
case TARGET_WAITKIND_VFORKED:
case TARGET_WAITKIND_VFORK_DONE:
case TARGET_WAITKIND_EXECD:
+ case TARGET_WAITKIND_THREAD_CREATED:
{
struct thread_info *saved_thread;
const char **regp;
status->value.execd_pathname = NULL;
buf += strlen (buf);
}
+ else if (status->kind == TARGET_WAITKIND_THREAD_CREATED
+ && report_thread_events)
+ {
+ enum gdb_signal signal = GDB_SIGNAL_TRAP;
+
+ sprintf (buf, "T%02xcreate:;", signal);
+ }
else
sprintf (buf, "T%02x", status->value.sig);
else
sprintf (buf, "X%02x", status->value.sig);
break;
+ case TARGET_WAITKIND_THREAD_EXITED:
+ sprintf (buf, "w%x;", status->value.integer);
+ buf += strlen (buf);
+ buf = write_ptid (buf, ptid);
+ break;
default:
error ("unhandled waitkind");
break;
int report_fork_events;
int report_vfork_events;
int report_exec_events;
+int report_thread_events;
int non_stop;
int swbreak_feature;
int hwbreak_feature;
if (handle_btrace_conf_general_set (own_buf))
return;
+ if (startswith (own_buf, "QThreadEvents:"))
+ {
+ char *mode = own_buf + strlen ("QThreadEvents:");
+ enum tribool req = TRIBOOL_UNKNOWN;
+
+ if (strcmp (mode, "0") == 0)
+ req = TRIBOOL_FALSE;
+ else if (strcmp (mode, "1") == 0)
+ req = TRIBOOL_TRUE;
+ else
+ {
+ char *mode_copy = xstrdup (mode);
+
+ /* We don't know what this mode is, so complain to GDB. */
+ sprintf (own_buf, "E.Unknown thread-events mode requested: %s\n",
+ mode_copy);
+ xfree (mode_copy);
+ return;
+ }
+
+ report_thread_events = (req == TRIBOOL_TRUE);
+
+ if (remote_debug)
+ {
+ const char *req_str = report_thread_events ? "enabled" : "disabled";
+
+ fprintf (stderr, "[thread events are now %s]\n", req_str);
+ }
+
+ write_ok (own_buf);
+ return;
+ }
+
/* Otherwise we didn't know what packet it was. Say we didn't
understand it. */
own_buf[0] = 0;
}
else if (strcmp (p, "vContSupported+") == 0)
vCont_supported = 1;
+ else if (strcmp (p, "QThreadEvents+") == 0)
+ ;
else
{
/* Move the unknown features all together. */
strcat (own_buf, ";vContSupported+");
+ strcat (own_buf, ";QThreadEvents+");
+
/* Reinitialize components as needed for the new connection. */
hostio_handle_new_gdb_connection ();
target_handle_new_gdb_connection ();
mark_breakpoints_out (process);
mourn_inferior (process);
}
+ else if (last_status.kind == TARGET_WAITKIND_THREAD_EXITED)
+ ;
else
{
/* We're reporting this thread as stopped. Update its
exit (0);
}
- if (last_status.kind == TARGET_WAITKIND_STOPPED)
+ if (last_status.kind == TARGET_WAITKIND_EXITED
+ || last_status.kind == TARGET_WAITKIND_SIGNALLED
+ || last_status.kind == TARGET_WAITKIND_THREAD_EXITED)
+ ;
+ else
{
/* A thread stopped with a signal, but gdb isn't
connected to handle it. Pass it down to the
resume_info.thread = last_ptid;
resume_info.kind = resume_continue;
- resume_info.sig = gdb_signal_to_host (last_status.value.sig);
+ if (last_status.kind == TARGET_WAITKIND_STOPPED)
+ resume_info.sig = gdb_signal_to_host (last_status.value.sig);
+ else
+ resume_info.sig = 0;
(*the_target->resume) (&resume_info, 1);
}
- else if (debug_threads)
- debug_printf ("GDB not connected; ignoring event %d for [%s]\n",
- (int) last_status.kind,
- target_pid_to_str (last_ptid));
}
else
{
extern int report_fork_events;
extern int report_vfork_events;
extern int report_exec_events;
+extern int report_thread_events;
extern int non_stop;
extern int extended_protocol;
}
}
+/* A cleanup that disables thread create/exit events. */
+
+static void
+disable_thread_events (void *arg)
+{
+ target_thread_events (0);
+}
+
/* See infrun.h. */
void
entry_ptid = inferior_ptid;
old_chain = make_cleanup (switch_to_thread_cleanup, &entry_ptid);
+ target_thread_events (1);
+ make_cleanup (disable_thread_events, NULL);
+
/* Request threads to stop, and then wait for the stops. Because
threads we already know about can spawn more threads while we're
trying to stop them, and we only learn about new threads when we
{
/* All resumed threads exited. */
}
- else if (ws.kind == TARGET_WAITKIND_EXITED
+ else if (ws.kind == TARGET_WAITKIND_THREAD_EXITED
+ || ws.kind == TARGET_WAITKIND_EXITED
|| ws.kind == TARGET_WAITKIND_SIGNALLED)
{
if (debug_infrun)
return;
}
+ if (ecs->ws.kind == TARGET_WAITKIND_THREAD_EXITED)
+ {
+ if (debug_infrun)
+ fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_THREAD_EXITED\n");
+ prepare_to_wait (ecs);
+ return;
+ }
+
if (ecs->ws.kind == TARGET_WAITKIND_NO_RESUMED
&& target_can_async_p () && !sync_execution)
{
prepare_to_wait (ecs);
return;
+ case TARGET_WAITKIND_THREAD_CREATED:
+ if (debug_infrun)
+ fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_THREAD_CREATED\n");
+ if (!ptid_equal (ecs->ptid, inferior_ptid))
+ context_switch (ecs->ptid);
+ if (!switch_back_to_stepped_thread (ecs))
+ keep_going (ecs);
+ return;
+
case TARGET_WAITKIND_EXITED:
case TARGET_WAITKIND_SIGNALLED:
if (debug_infrun)
static void remote_async (struct target_ops *ops, int enable);
+static void remote_thread_events (struct target_ops *ops, int enable);
+
static void sync_remote_interrupt_twice (int signo);
static void interrupt_query (void);
/* Support for the QNonStop packet. */
PACKET_QNonStop,
+ /* Support for the QThreadEvents packet. */
+ PACKET_QThreadEvents,
+
/* Support for multi-process extensions. */
PACKET_multiprocess_feature,
PACKET_exec_event_feature },
{ "Qbtrace-conf:pt:size", PACKET_DISABLE, remote_supported_packet,
PACKET_Qbtrace_conf_pt_size },
- { "vContSupported", PACKET_DISABLE, remote_supported_packet, PACKET_vContSupported }
+ { "vContSupported", PACKET_DISABLE, remote_supported_packet, PACKET_vContSupported },
+ { "QThreadEvents", PACKET_DISABLE, remote_supported_packet, PACKET_QThreadEvents },
};
static char *remote_support_xml;
if (packet_set_cmd_state (PACKET_vContSupported) != AUTO_BOOLEAN_FALSE)
q = remote_query_supported_append (q, "vContSupported+");
+ if (packet_set_cmd_state (PACKET_QThreadEvents) != AUTO_BOOLEAN_FALSE)
+ q = remote_query_supported_append (q, "QThreadEvents+");
+
/* Keep this one last to work around a gdbserver <= 7.10 bug in
the qSupported:xmlRegisters=i386 handling. */
if (remote_support_xml != NULL)
= (struct threads_listing_context *) param->input;
if (event->ws.kind == TARGET_WAITKIND_FORKED
- || event->ws.kind == TARGET_WAITKIND_VFORKED)
- {
- threads_listing_context_remove (&event->ws, context);
- }
+ || event->ws.kind == TARGET_WAITKIND_VFORKED
+ || event->ws.kind == TARGET_WAITKIND_THREAD_EXITED)
+ threads_listing_context_remove (&event->ws, context);
return 1;
}
one used by the original program. */
skipregs = 1;
}
+ else if (strprefix (p, p1, "create"))
+ {
+ event->ws.kind = TARGET_WAITKIND_THREAD_CREATED;
+ p = skip_to_semicolon (p1 + 1);
+ }
else
{
ULONGEST pnum;
event->ws.value.sig = GDB_SIGNAL_UNKNOWN;
}
break;
+ case 'w': /* Thread exited. */
+ {
+ char *p;
+ ULONGEST value;
+
+ event->ws.kind = TARGET_WAITKIND_THREAD_EXITED;
+ p = unpack_varlen_hex (&buf[1], &value);
+ event->ws.value.integer = value;
+ if (*p != ';')
+ error (_("stop reply packet badly formatted: %s"), buf);
+ event->ptid = read_ptid (++p, &p);
+ break;
+ }
case 'W': /* Target exited. */
case 'X':
{
remote_ops.to_can_async_p = remote_can_async_p;
remote_ops.to_is_async_p = remote_is_async_p;
remote_ops.to_async = remote_async;
+ remote_ops.to_thread_events = remote_thread_events;
remote_ops.to_can_do_single_step = remote_can_do_single_step;
remote_ops.to_terminal_inferior = remote_terminal_inferior;
remote_ops.to_terminal_ours = remote_terminal_ours;
}
}
+/* Implementation of the to_thread_events method. */
+
+static void
+remote_thread_events (struct target_ops *ops, int enable)
+{
+ struct remote_state *rs = get_remote_state ();
+ size_t size = get_remote_packet_size ();
+ char *p = rs->buf;
+
+ if (packet_support (PACKET_QThreadEvents) == PACKET_DISABLE)
+ return;
+
+ xsnprintf (rs->buf, size, "QThreadEvents:%x", enable ? 1 : 0);
+ putpkt (rs->buf);
+ getpkt (&rs->buf, &rs->buf_size, 0);
+
+ switch (packet_ok (rs->buf,
+ &remote_protocol_packets[PACKET_QThreadEvents]))
+ {
+ case PACKET_OK:
+ if (strcmp (rs->buf, "OK") != 0)
+ error (_("Remote refused setting thread events: %s"), rs->buf);
+ break;
+ case PACKET_ERROR:
+ warning (_("Remote failure reply: %s"), rs->buf);
+ break;
+ case PACKET_UNKNOWN:
+ break;
+ }
+}
+
static void
set_remote_cmd (char *args, int from_tty)
{
add_packet_config_cmd (&remote_protocol_packets[PACKET_vCtrlC],
"vCtrlC", "ctrl-c", 0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_QThreadEvents],
+ "QThreadEvents", "thread-events", 0);
+
/* Assert that we've registered "set remote foo-packet" commands
for all packet configs. */
{
fputs_unfiltered (")\n", gdb_stdlog);
}
+static void
+delegate_thread_events (struct target_ops *self, int arg1)
+{
+ self = self->beneath;
+ self->to_thread_events (self, arg1);
+}
+
+static void
+tdefault_thread_events (struct target_ops *self, int arg1)
+{
+}
+
+static void
+debug_thread_events (struct target_ops *self, int arg1)
+{
+ fprintf_unfiltered (gdb_stdlog, "-> %s->to_thread_events (...)\n", debug_target.to_shortname);
+ debug_target.to_thread_events (&debug_target, arg1);
+ fprintf_unfiltered (gdb_stdlog, "<- %s->to_thread_events (", debug_target.to_shortname);
+ target_debug_print_struct_target_ops_p (&debug_target);
+ fputs_unfiltered (", ", gdb_stdlog);
+ target_debug_print_int (arg1);
+ fputs_unfiltered (")\n", gdb_stdlog);
+}
+
static int
delegate_supports_non_stop (struct target_ops *self)
{
ops->to_is_async_p = delegate_is_async_p;
if (ops->to_async == NULL)
ops->to_async = delegate_async;
+ if (ops->to_thread_events == NULL)
+ ops->to_thread_events = delegate_thread_events;
if (ops->to_supports_non_stop == NULL)
ops->to_supports_non_stop = delegate_supports_non_stop;
if (ops->to_always_non_stop_p == NULL)
ops->to_can_async_p = tdefault_can_async_p;
ops->to_is_async_p = tdefault_is_async_p;
ops->to_async = tdefault_async;
+ ops->to_thread_events = tdefault_thread_events;
ops->to_supports_non_stop = tdefault_supports_non_stop;
ops->to_always_non_stop_p = tdefault_always_non_stop_p;
ops->to_find_memory_regions = dummy_find_memory_regions;
ops->to_can_async_p = debug_can_async_p;
ops->to_is_async_p = debug_is_async_p;
ops->to_async = debug_async;
+ ops->to_thread_events = debug_thread_events;
ops->to_supports_non_stop = debug_supports_non_stop;
ops->to_always_non_stop_p = debug_always_non_stop_p;
ops->to_find_memory_regions = debug_find_memory_regions;
current_target.to_async (¤t_target, enable);
}
+/* See target.h. */
+
+void
+target_thread_events (int enable)
+{
+ current_target.to_thread_events (¤t_target, enable);
+}
+
/* Controls if targets can report that they can/are async. This is
just for maintainers to use when debugging gdb. */
int target_async_permitted = 1;
TARGET_DEFAULT_RETURN (0);
void (*to_async) (struct target_ops *, int)
TARGET_DEFAULT_NORETURN (tcomplain ());
+ void (*to_thread_events) (struct target_ops *, int)
+ TARGET_DEFAULT_IGNORE ();
/* This method must be implemented in some situations. See the
comment on 'to_can_run'. */
int (*to_supports_non_stop) (struct target_ops *)
/* Enables/disabled async target events. */
extern void target_async (int enable);
+/* Enables/disables thread create and exit events. */
+extern void target_thread_events (int enable);
+
/* Whether support for controlling the target backends always in
non-stop mode is enabled. */
extern enum auto_boolean target_non_stop_enabled;
return xstrprintf ("%sno-history", kind_str);
case TARGET_WAITKIND_NO_RESUMED:
return xstrprintf ("%sno-resumed", kind_str);
+ case TARGET_WAITKIND_THREAD_CREATED:
+ return xstrprintf ("%sthread created", kind_str);
+ case TARGET_WAITKIND_THREAD_EXITED:
+ return xstrprintf ("%sthread exited, status = %d",
+ kind_str, ws->value.integer);
default:
return xstrprintf ("%sunknown???", kind_str);
}
TARGET_WAITKIND_NO_HISTORY,
/* There are no resumed children left in the program. */
- TARGET_WAITKIND_NO_RESUMED
+ TARGET_WAITKIND_NO_RESUMED,
+
+ /* The thread was created. */
+ TARGET_WAITKIND_THREAD_CREATED,
+
+ /* The thread has exited. The exit status is in value.integer. */
+ TARGET_WAITKIND_THREAD_EXITED,
};
struct target_waitstatus