{
target_terminal_ours ();
- if (target_can_async_p ())
+ if (target_is_async_p ())
{
signal (SIGINT, handle_sigint);
quit ();
else
event_ptid = remote_wait_as (ptid, status, options);
- if (target_can_async_p ())
+ if (target_is_async_p ())
{
/* If there are are events left in the queue tell the event loop
to return here. */
case it's not possible to issue a command while the target is
running. This is not a problem in non-stop mode, because in that
case, the stub is always ready to process serial input. */
- if (!non_stop && target_can_async_p () && rs->waiting_for_stop_reply)
+ if (!non_stop && target_is_async_p () && rs->waiting_for_stop_reply)
{
error (_("Cannot execute this command while the target is running.\n"
"Use the \"interrupt\" command to stop the target\n"
/* Check whether the target supports branch tracing. */
static int
-remote_supports_btrace (struct target_ops *self)
+remote_supports_btrace (struct target_ops *self, enum btrace_format format)
{
if (packet_support (PACKET_Qbtrace_off) != PACKET_ENABLE)
return 0;
- if (packet_support (PACKET_Qbtrace_bts) != PACKET_ENABLE)
- return 0;
if (packet_support (PACKET_qXfer_btrace) != PACKET_ENABLE)
return 0;
- return 1;
+ switch (format)
+ {
+ case BTRACE_FORMAT_NONE:
+ return 0;
+
+ case BTRACE_FORMAT_BTS:
+ return (packet_support (PACKET_Qbtrace_bts) == PACKET_ENABLE);
+ }
+
+ internal_error (__FILE__, __LINE__, _("Unknown branch trace format"));
}
/* Enable branch tracing. */
static enum btrace_error
remote_read_btrace (struct target_ops *self,
- VEC (btrace_block_s) **btrace,
+ struct btrace_data *btrace,
struct btrace_target_info *tinfo,
enum btrace_read_type type)
{
return BTRACE_ERR_UNKNOWN;
cleanup = make_cleanup (xfree, xml);
- *btrace = parse_xml_btrace (xml);
+ parse_xml_btrace (btrace, xml);
do_cleanups (cleanup);
return BTRACE_ERR_NONE;
serial_async (rs->remote_desc, remote_async_serial_handler, rs);
rs->async_client_callback = callback;
rs->async_client_context = context;
+
+ /* If there are pending events in the stop reply queue tell the
+ event loop to process them. */
+ if (!QUEUE_is_empty (stop_reply_p, stop_reply_queue))
+ mark_async_event_handler (remote_async_inferior_event_token);
}
else
- serial_async (rs->remote_desc, NULL, NULL);
+ {
+ serial_async (rs->remote_desc, NULL, NULL);
+ clear_async_event_handler (remote_async_inferior_event_token);
+ }
}
static void